Integration examples¶
CAN communication¶
CEX can send and receive messages via CAN.
CAN messages transmission¶
Users must follow the steps below to send telemetry via CAN and configure an Autopilot 1x to read this telemetry:
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Connect a CAN Custom Producer Telemetry to a CAN Output Filter as follows:
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) CAN Telemetry tab.
This tab must corresponds to the selected CAN Custom Producer Telemetry. In this case CAN Telemetry 0 as the Producer is CAN Custom Producer 0 Telemetry.
Select the fields to send in TX or TX Ini, as it is a Producer. More information on the configuration of telemetry messages can be found in the CAN Telemetry - Input/Output section of this manual.
For example, a telemetry message with a variable set to ID 90:
Configure the Autopilot 1x to read telemetry from CEX, following the CAN messages reception - Integration examples section of the 1x PDI Builder user manual.
Note
The configured CAN ID must match the one in CEX.
CAN messages reception¶
Users must follow the steps below to read CAN messages via CAN and configure an Autopilot 1x to send this telemetry:
Configure the Autopilot 1x to send telemetry to CEX, following the CAN messages transmission - Integration examples section of the 1x PDI Builder user manual.
Go to Input/Output menu \(\rightarrow\) CAN Setup panel.
Configure a mailbox acccording to the message to receive. In this example, a message with ID 90 is received through CAN A:
Note
The configured ID must match the one in 1x.
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Connect a CAN Input Filter to a CAN Custom Consumer Telemetry as follows:
Click on the button of the CAN Input Filter and configure the Port and CAN Id according to the message to receive.
Note
The configured CAN Id must match the one in 1x.
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) CAN Telemetry 0 tab (as CAN Custom Consumer 0 Telemetry has been selected as consumer).
Add a field to receive the message in RX, since it is a Consumer, and configure it to store the received value in a user variable. More information on the configuration of Telemetry messages can be found in the CAN Telemetry - Input/Output section of this manual.
Note
The configured CAN Id must match the one in 1x.
CAN Isolator¶
CEX can operate as a CAN bus isolator, since it manages both CAN buses as desired. The system has a built-in microcontroller; which manages CAN buses in real-time. Both buses are not electrically connected, in consequence, electrical signals that do not follow the CAN protocol will be isolated.
The functionalities of a CAN isolator are the following:
The following diagram summarizes the behavior of CEX as a CAN bus isolator:
Filtered CAN subnet¶
With CEX it is possible to isolate CAN nets, by filtering certain messages from one CAN line and only transmitting specific information through CEX to the other one.
In this example, only a certain range of CAN IDs will be allowed to cross from one CAN line to the other using the two CAN ports of CEX. Specifically, information will pass from CAN B of CEX to CAN A of CEX:
The allowed range will be from 0x550 to 0x55F.
Create a new mailbox entry for CAN B.
To do this, go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) CAN B tab.
Assign some of the mailboxes to it and set the ID to 0x550. This example uses an ID expressed in hexadecimal notation.
Set a Mask which will ignore the last 4 bits.
Note
Although the ID has been entered in hexadecimal notation, note that the Mask has been set in binary format.
Go to Input/Output \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Configure CAN Input Filter 2 on CAN B, with the same settings as the Mailbox.
Important
This menu only allows setting the Id with decimal numbers. For this example the Id 0x550 is represented as 1360 in decimal format.
Bind CAN Output Filter 2 to CAN Input Filter 2, and configure CAN Output Filter to CAN A.
CAN tunnel¶
CAN tunnel is a specific type of a message tunnel; where messages are tunneled from one CAN port of CEX to the other.
In this example, a transparent tunnel will be created. So, any messages received on Interface A will be sent through Interface B.
Optionally, the mailboxes can be equally distributed to support both standard and extended CAN IDs.
Create a new mailbox entry for Interface A.
To do this, go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) CAN A tab.
Assign half of the mailboxes to it and set a Mask of 0.
Go to Input/Output \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Configure CAN Input Filter 2 on CAN A, with a Mask of 0 and Both as frame format type.
Bind CAN Output Filter 2 to CAN Input Filter 2, and configure the CAN Output Filter to CAN B.
Commanding/Reading PWMs¶
The appropriate PWM message format is described in the Command PWMs - CAN Bus Protocol section of CEX Software Manual.
The user can follow the following steps to achieve PWM commanding from 1x to CEX:
1x PDI Builder side¶
Go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) Configuration tab.
Connect a CAN custom message to an Output filter to send the message:
Go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) Custom Message 2 tab (as CAN custom Message 2 has been selected as producer).
Build a CAN custom message using the PWM variable and the appropriate message format.
Select the fields to send in the TX as it is a Producer. CAN ID is arbitrary, for this example ID 100 will be used:
Message format:
Matcher (2) [8 bits]
PWM 0 [12 bits]
PWM 1 [12 bits]
PWM 2 [12 bits]
PWM 3 [12 bits]
Matcher (3) [8 bits]
PWM 4 [12 bits]
PWM 5 [12 bits]
PWM 6 [12 bits]
PWM 7 [12 bits]
Each PWM variable has to be set using the following format:
Variable: PWM X
Compression: Compress - Bits Unsigned
Bits: 12
Encode: Min=0.0 / Max=1.0
Decode: Min=0 / Max=4095
CEX PDI Builder side¶
Go to Input/Output menu \(\rightarrow\) CAN Setup panel.
Create the mailbox to receive the new message (ID 100):
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Connect a CAN Input Filter with the right CAN ID to the Application Processor consumer:
Go to Input/Output menu \(\rightarrow\) PWM panel \(\rightarrow\) PWM 1 tab (as PWM 1 has been selected in 1x PDI Builder).
Configure parameters for PWM 1:
Go to Input/Output menu \(\rightarrow\) GPIO panel.
Check that this PWM pin (PWM 1 in this case) has correctly switched from GPIO to PWM.
It should look like this:
IO: GPIO as output.
Function: Mux 1.
Finally, save the changes.
GPIO Command¶
The following are the steps to send a GPIO command from the Veronte Autopilot 1x, receive it at CEX and process it, so that CEX carries out the command.
Warning
Remember that for the reception of CAN messages, Mailboxes need to be configured accordingly.
GPIO Command is very similar to PWM command with a few exceptions.
1x PDI Builder side¶
Go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) Configuration tab.
Connect, as Producer, a ‘CAN GPIO remote’ to an Output filter:
CAN GPIO remote must be configured. For more information on its configuration, see CAN Setup - Input/Output section of the 1x PDI Builder user manual.
Go to Automations menu.
GPIO must be activated using an ‘Output action’:
CEX PDI Builder side¶
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Finally, connect a CAN Input Filter to the CAN GPIO consumer:
The Id must match the one configured in the 1x PDI Builder as Output filter:
Reading/Sending RPMs¶
This section presents the steps to follow to read RPMs.
CEX PDI Builder side¶
Go to Input/Output menu \(\rightarrow\) GPIO panel.
RPM can be read on the available digital inputs GPIO/ECAP 0-3. The chosen pin needs to be configured as “GPIO as input”. In the example shown here, GPIO/ECAP 1 is chosen.
Go to Input/Output menu \(\rightarrow\) Digital Input panel.
There are 4 possible producers: CAP 0-3. One needs to be chosen and linked to one of the RPMs consumers (RPMs 0-3). For more information on Digital input configuration, see Digital Input - Input/Output section of this manual.
Then, select an edge dectection option: “First rising edge” or “First falling edge”.
Go to Sensors menu \(\rightarrow\) RPM panel \(\rightarrow\) RPM 1 tab (as RPM 1 has been selected in the Digital Input panel).
Here the expected pulse needs to be defined. For more information on RPM configuration, see RPM - Sensors section of this manual.
Go to Input/Output menu \(\rightarrow\) CAN I/O panel \(\rightarrow\) Configuration tab.
Connect a CAN Custom Producer Telemetry to a CAN Output Filter as follows (in this example, the RMP1 variable is sent via CAN B bus of the CEX):
Go to the CAN Telemetry tab that corresponds to the selected CAN Custom Producer Telemetry. In this case CAN Telemetry 1 as the Producer is CAN Custom Producer 1 Telemetry.
A new telemetry message needs to be created with its correspondent ID, endianness and period.
Can ID: 1200.
Endianness: Little endian.
Period: 0.01 s.
In the telemetry message one of CEX’s variables needs to be selected. As RPM 1 has been chosen as consumer in the Digital Input, the variable to be sent is RPM1.
More information on the configuration of Telemetry messages can be found in the CAN Telemetry - Input/Output section of the present manual.
1x PDI Builder side¶
Go to UI menu \(\rightarrow\) Variables panel \(\rightarrow\) Real Vars tab.
Rename a Real User Variable (32 bits) that will be used to store the value received from CEX:
Go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) Mailboxes tab.
Configure, in CAN B, some mailboxes to receive the message with ID 1200:
Go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) Configuration tab.
Connect an Input filter to a Custom message consumer. Both CAN buses of the Autopilot 1x can be used, as well as normal IDs and extended IDs:
Go to Input/Output menu \(\rightarrow\) CAN Setup panel \(\rightarrow\) Custom message 1 tab (as Custom Message 1 has been selected as consumer).
Configure the reading of the message and store the received value in the user variable renamed above:
Serial communication¶
The user can send information through the serial ports of the CEX. For this purpose, please note the following explanation:
CEX PDI Builder side¶
I/O Setup configuration
Reception of serial information on RS232-A (producer) is stored in Serial to CAN 2 (consumer).
Transmission of serial information is sent using the CAN to Serial 2 (producer) via RS232-A (consumer).
(‘Serial to CAN’ and ‘CAN to Serial’ are explained in the CAN I/O - Input/Output section of this manual.)
CAN I/O configuration
The information that will be sent via serial port RS232-A is going to be received on the CEX through its CAN B port. A CAN Id of 51 is added to the CAN Input Filter. The incoming information (from Veronte Autopilot 1x) is processed in ‘CAN to Serial 2’.
The information coming from port RS232-A and processed as ‘Serial to CAN 2’ is going to be linked to a CAN Output Filter. The information of ‘Serial to CAN 2’ is going to be sent via CAN B with a CAN ID of 50 (to be read by Veronte Autopilot 1x).
CAN Setup (mailboxes) configuration
Mailboxes need to be defined for the reception of CAN messages. In the example above, mailboxes for ID 51 need to be added on CAN B port.
1x PDI Builder side¶
I/O Setup configuration
On the I/O Setup panel, link an ‘RS custom message’ to a ‘Serial to CAN’ with the serial data that the Autopilot 1x is going to send to CEX.
Then, link a ‘CAN to Serial’ to another ‘RS custom message’ with the expected serial messages that the CEX will receive in the selected serial port.
CAN Setup configuration
As for the CAN I/O, the same IDs employed in CEX for the CAN Input and CAN Output Filters are going to be employed on Veronte Autopilot 1x side, but they need to be inverted.
Therefore, the Input filter linked to the chosen ‘CAN to Serial’ needs to have ID 50. And the Output filter linked to the chosen ‘Serial to CAN’ will have ID 51.
Mailboxes configuration
Some mailboxes with ID 50 will have to be created on whichever chosen reception CAN bus.
External devices¶
The step-by-step instructions for the following external devices are explained in detail in the following sections: