Skip to content

Commit 89d971c

Browse files
ArduinoBotmarqdevxsebromeroaliphysFr4ng
authored
Arduino PLC IDE - Launch (Tutorials + Software Page) (#713)
* Software: Add PLC-IDE page [PC-1038] (#209) * Update paragraph (#228) Co-authored-by: sebromero <[email protected]> * PLC IDE Tutorials [PC-1041, PC-1003] (#219) * PLC IDE setup guide [PC-974] (#172) Co-authored-by: Ali Jahangiri <[email protected]> Co-authored-by: Fr4ng <[email protected]> Co-authored-by: BenjaminDannegård <[email protected]> * Fix naming * PLC IDE: Programming with IEC standard languages introdution [PC-975] (#174) Co-authored-by: BenjaminDannegard <[email protected]> Co-authored-by: Fr4ng <[email protected]> * Move setup tutorial to correct folder * Fix and align metadata * Create Pin Mapping for PMC on the Arduino PLC IDE [PC-1002] (#189) Co-authored-by: Julián Caro Linares <[email protected]> * Empty-Commit * PLC IDE + PMC, Pin Map tutorial: Small tweaking [PC-1050] (#225) * Small tweaking * Minor rewording * Pin Map bold * Tweak explanation * map table bold * Update content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/plc-ide-pin-mapping/content.md Co-authored-by: Julián Caro Linares <[email protected]> * Re-order, rename headings * Title case * Update content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/plc-ide-pin-mapping/content.md Co-authored-by: Julián Caro Linares <[email protected]> * Requirements rewording Co-authored-by: Julián Caro Linares <[email protected]> * Add symlinks to the software page * Update license and PLC IDE links * Add 2 executables info * PLC-IDE CAN set up [PC-1000] (#227) * First commit * Lint and remove tags * Fix typo * Apply suggestions from code review Co-authored-by: Julián Caro Linares <[email protected]> * Fix typo, title case and next-step paragraph Co-authored-by: marqdevx <[email protected]> * Add paragraph from feedback * Hide settings list Co-authored-by: Julián Caro Linares <[email protected]> * PLC-IDE ModBus set up [PC-1001] (#215) * First commit * Add screenshot * MD fixes * Lint fix and added RTU naming * Lint fix * PLC IDE + PMC ModBus: tutorial fix (#226) * Added ModBus TCP * Add modbus node configration * MD fixes * assets fix * Empty-Commit * Fix overview * Add TCP and move Parametrization section * Add ethernet note * ModBus capitalization * Add software metadata Co-authored-by: canchebagur <[email protected]> * Add symlinks Co-authored-by: Ali Jahangiri <[email protected]> Co-authored-by: Fr4ng <[email protected]> Co-authored-by: BenjaminDannegård <[email protected]> Co-authored-by: Julián Caro Linares <[email protected]> Co-authored-by: canchebagur <[email protected]> * PLC IDE launch, fixes (#229) * Fix software metadata * Update CAN tutorial * Fix ModBus tutorial Co-authored-by: Pablo Marquínez Ferrándiz <[email protected]> Co-authored-by: Sebastian Romero <[email protected]> Co-authored-by: Ali Jahangiri <[email protected]> Co-authored-by: Fr4ng <[email protected]> Co-authored-by: BenjaminDannegård <[email protected]> Co-authored-by: Julián Caro Linares <[email protected]> Co-authored-by: canchebagur <[email protected]>
1 parent d2526f9 commit 89d971c

File tree

69 files changed

+142646
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+142646
-75
lines changed

content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/can-setup/assets/PMC-CAN-pins.svg

Lines changed: 141731 additions & 0 deletions
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: 'CAN Bus Setup with Arduino PLC IDE'
3+
description: 'This tutorial will show you how to set up the CAN bus communication with the Arduino PLC IDE.'
4+
tags:
5+
- PLC
6+
- CAN
7+
author: 'Pablo Marquínez'
8+
hardware:
9+
- hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control
10+
software:
11+
- plc-ide
12+
---
13+
14+
## Overview
15+
16+
The Arduino Portenta Machine Control has the **TJA1049T** CAN transceiver which allows to use the **Controller Area Network (CAN) protocol** communication.
17+
18+
### What Is CAN
19+
20+
CAN is the acronym used for Controlled Area Network. This protocol was developed to be used on automotive and industrial applications to communicate with precise and critical demanding sensors.
21+
22+
The main advantages of the CAN bus protocol are:
23+
24+
* **Reduced wiring:** The CAN communication only uses two wires, creating a bus communication where all the devices of the network are connected. This is a huge advantage for industrial applications, like the automotive one, where we can connect all the electronic components of a car to the same network using only two wires, saving cost, materials, and simplifying the programming and manufacturing process.
25+
26+
* **Fast speed communication:** The CAN protocol is one of the most used communication protocols in the industry not only for its simplicity but also for its speed rates.
27+
28+
* **Strength and reliability:** Thanks to the twisted pair cables and the differential signal between them, the CAN bus protocol protects the data against electrical noise in industrial environments keeping the critical information safe and without data losses.
29+
30+
Structure of a CAN network:
31+
* **Main device:** Main controller or orchestrator of the communication. It interacts with the rest of the devices on the network, sending and receiving data from them. It usually is a controller device like the Portenta Machine control.
32+
* **Node or ECU (Electronic Control Unit):** Devices capable of interacting on the data bus. Although every device on the network can listen to the data that is being transferred on the bus each device has an unique number (ID) to communicate with that is included in every message, ignoring the messages that do not match their ID. However, all the nodes have access to the messages of the network, being possible for a node to read and use the data from another node if necessary.
33+
34+
CAN has built-in error detection so the application can handle its own errors in case of data loss (like CRC).
35+
36+
## Goals
37+
38+
- Set up the Portenta Machine Control with the Arduino PLC IDE
39+
- Configure the CAN communication inside the IDE
40+
41+
## Required Hardware and Software
42+
43+
- [Arduino Portenta Machine Control](https://store.arduino.cc/products/arduino-portenta-machine-control) board
44+
- [Arduino PLC IDE](../../software/plc-ide) license
45+
46+
## Set Up
47+
48+
### Software
49+
50+
In order to configure the Portenta Machine Control you will need to connect to the device through the Arduino PLC IDE:
51+
52+
1. Connect the device to the computer through USB
53+
2. Click "Connects to the target" button on the PLC IDE
54+
55+
***The device needs to be activated with a license, check the steps on the [PLC IDE Set-up tutorial](./plc-ide-setup-license)***
56+
57+
### Hardware
58+
59+
In order to use the CAN communication, you will need to:
60+
1. Supply the board with 24V DC, through the 24VIn and GND
61+
2. Connecting the CANH, CANL, and GND with a CAN Device
62+
63+
![Header pinout for CAN communication](assets/PMC-CAN-pins.svg)
64+
65+
## Enable The CAN Communication
66+
67+
Inside the Arduino PLC IDE navigate to the left side panel and click on the "Resources" tab.
68+
69+
![Arduino PLC IDE Resources panel, -> CANopen CAN0](assets/CAN-configuration.png)
70+
71+
### CANopen Configuration
72+
73+
To configure in depth the settings you need to add the **Generic CANopen device** from the item's catalog.
74+
75+
![Add Items to CANopen's resource](assets/CAN-configuration-add.png)
76+
77+
![Item from the catalogue](assets/CAN-configuration-add-catalog.png)
78+
79+
Once the **Generic CANOpen device** has been added you can customize the configuration to comply your needs.
80+
81+
![CANopen configuration window](assets/CAN-configuration-general.png)
82+
83+
<!--
84+
Below, you will find an enumeration of the options located in each of the CAN configuration tabs and windows.
85+
86+
#### Network Settings Tabs
87+
88+
* Node number
89+
* Node Guard Period(ms)
90+
* Life time factor
91+
* Boot time elapsed
92+
* Wait boot-up message
93+
* Node heartbeat producer time
94+
* Node heartbeat consumer time
95+
* Master heartbeat consumer time
96+
* Mandatory
97+
* Identify Object Check
98+
99+
#### PDO Mapping
100+
101+
* PDO Auto Mapping
102+
103+
#### PDO Tx Communication Settings Tab
104+
Modes:
105+
* User Defined Mode
106+
* Sync Mode
107+
* Event mode
108+
* Cyclic mode
109+
110+
#### PDO Rx Communication Settings Tab
111+
Modes:
112+
* User Defined Mode
113+
* Sync Mode
114+
* Evemt Mode
115+
-->
116+
117+
### Parametrization Tab
118+
119+
![CANopen objects mapping table](assets/CAN-configuration-parametrization.png)
120+
121+
This window allows to create objects and set the addresses, this is called a mapped variable table.
122+
123+
### PDO Tables
124+
125+
This table customize the PDO (Process Data Object) dictionary, so you will set the variables for the information that you want to have usually cause they are time-critical, any device can overwrite those addresses, so it acts like shared variables.
126+
127+
You can edit the table by adding, removing new variables, you can also assign and unassign existing variables on your programs (Global Variables) to this table.
128+
129+
#### PDO Tx Input Tab
130+
131+
![CANopen PDO Tx configuration](assets/CAN-configuration-pdo-tx.png)
132+
133+
#### PDO Rx Output Tab
134+
135+
![CANopen PDO Rx configuration](assets/CAN-configuration-pdo-rx.png)
136+
137+
### Next Steps
138+
139+
Now that you have completed the setup of the Portenta Machine Control and its CAN bus communication with the Arduino PLC IDE, you can continue with:
140+
- Plug a CAN sensor to your device and get its data.
141+
- Expand your CAN bus network with more nodes sending and receiving messages from each one of them.

0 commit comments

Comments
 (0)