CAN Expander

General Description

Veronte CAN Expander stands as a powerful peripheral to ease the reduction of wire in autonomous vehicles at the time it permits to increase the number of devices in the system. It makes possible to relocate and to group sensors, actuators, payloads, motor controllers… enhancing the I/O connectivity in the Veronte Autopilot. With its easy integration, Veronte CAN Expander becomes a quick solution for increasing connectivity capacity and allowing wiring optimization, especially in large systems.

CAN Expander render

CAN Expander render

Wiring Optimization

It is especially in large vehicles, where wire optimization plays a critical role permitting a significant weight reduction. This upgrade is achieved thanks to the reduction of cable length and because of the added flexibility so the right device can be installed in the right location. Another advantage of the use of Veronte CAN Expander is the robustness of the CAN Bus, being resistant to electromagnetic interferences and permitting the installation of long cables with no signal loss. Furthermore, it includes redundancy with CAN bus isolation, making it fail operational even in case of a CAN bus line break.

Enhanced I/O

With the use of Veronte CAN Expander, the data capacity for input and output in Veronte Autopilots is increased in a great manner. The advanced design makes possible to control several peripherals (PWM, UART, Digital Output, I2C, Analog Inputs…) through the CAN Bus. It can be used for both, expanding the I/O capacity in Veronte Autopilot, or for controlling peripherals with a robust communications protocol. In case it is needed, several CAN Expander boards can be installed in the same network for increasing the number of I/O ports or because of system architecture needs.

Applications

In aviation, a field where weight means such an important agent in design, struggling with wiring is one of the most common issues faced during the vehicle design. With the use of Veronte CAN Expander, not only this issue would be reduced, but a bunch of opportunities for different sensors and payload could arise:

  • By adding more I/O interfaces, a more complex payload control can be achieved, adding enhanced connectivity.
  • Advanced control of actuators and peripherals becomes feasible, being possible to condensate the connection of control, feedback, sensors… in a single board.
  • Devices can be installed at long distances from the autopilot with no signal degradation thanks to the robustness of the CAN Bus.

Assembly

CAN dimensions

CAN dimensions

CAN Expander does not integrate a Termination resistance in order to allow for multiple CAN Expander connected to the same line. Considering Veronte Auotpilot includes one entrance resistance of 120 Ω, a second resistance needs to be placed at the end of the line (again 120 Ω).

CAN assembly diagram

CAN assembly diagram

Pinout

Board CAN Expander

Warning

Consider the color code for the 2 different connectors. A misuse could result in the product to stop working.

Connector A (Colored)
PIN Nº I/O
1 Power supply 1
2 Power supply 2
3 GND
4 CAN A (H)
5 CAN A (L)
6 CAN B (L)
7 CAN B (H)
8 UART A (TX)
9 UART A (RX)
10 GND
11 UART B (TX)
12 UART B (RX)
13 GND
14 I2C SCL
15 I2C SDA
16 GND
17 3.3V
18 GND
19 5V
20 GND
Connector B (Black)
PIN Nº I/O
1 PWM 1
2 PWM 2
3 PWM 3
4 PWM 4
5 PWM 5
6 PWM 6
7 PWM 7
8 PWM 8
9 ECAP 1
10 ECAP 2
11 ECAP 3
12 ECAP 4
13 ANALOG 1 (3.3V)
14 ANALOG 2 (3.3V)
15 ANALOG 3 (5V)
16 ANALOG 4 (5V)
17 ANALOG 5 (12V)
18 ANALOG 6 (12V)
19 ANALOG 7 (36V)
20 ANALOG 8 (36V)

I/O Specifications

  • All inputs are ESD protected

  • Double Power Supply, to provide power redundancy to the CAN Expander.

  • Input voltage/current

    • Power input: 6 to 60V (DC)
    • Power: 3W (6W max.)
  • Vmax = 60V

    • IMax: 1.5A, Inom: 0.3A
  • CAN

    • Complies with standards.
    • Isolated (4kV)
    • Speed up to 1 Mbps
  • UART

    • TTL 3.3V signals up to 115200 baud.
  • I2C

    • 3.3V Signals up to 400 KHz.
  • 3.3V Output

    • 100 mA fuse protected.
  • 5V Output

    • 100 mA fuse protected.
  • PWM Output

    • Voltage is 5V.
    • Current I (oh) = 16 mA and I (ol) = -16 mA
    • Micro Edge Positioning (MEP) step size = 150 ps.
  • Digital Inputs (ECAP)

    • Maximum voltage = 5V.
    • Maximum input current = 2.5 mA
    • Sampling rate: up to 1 micro s
  • Analog signals

    • Input impedance: 10 GOhm

    • Resolution:

      • 0-3.3V pins: 0.00080 V
      • 0-5V pins: 0.0012 V
      • 0-12V pins: 0.0029 V
      • 0-36V pins: 0.0087 V

CAN Expander MC

CAN Expander pinout configuration

CAN Expander pinout configuration

PIN Nº I/O PIN Nº I/O
1 PWM 1 23 GND
2 PWM 2 24 Power supply 1
3 PWM 3 25 Power supply 2
4 PWM 4 26 GND
5 PWM 5 27 CAN A (H)
6 PWM 6 28 CAN A (L)
7 PWM 7 29 CAN B (L)
8 PWM 8 30 CAN B (H)
9 GND 31 232_TX
10 ECAP 1 32 232_RX
11 ECAP 2 33 GND
12 ECAP 3 34 RX+
13 ECAP 4 35 RX-
14 GND 36 TX-
15 ANALOG 1 (3.3V) 37 TX+
16 ANALOG 2 (3.3V) 38 GND
17 ANALOG 3 (5V) 39 I2C SCL
18 ANALOG 4 (5V) 40 I2C SDA
19 ANALOG 5 (12V) 41 3.3V
20 ANALOG 6 (12V) 42 GND
21 ANALOG 7 (36V) 43 5V
22 ANALOG 8 (36V) 44 GND

Configuration

Configuration and CAN addresses are set depending on the user’s needs.

If the user is willing to change the configuration of its own CAN Expander(s), a programming tool is available at Embention.

CAN Expander Software

Veronte Pipe Configuration

  • cmd (8): cmd type
  • data[56]: cmd data

First byte refers to the message type:

Message type Value Description
t_arbitration 0 Arbitration message. Sent by Veronte and Arbiter
t_version 1 Version request / response
t_pwm_0_3_set 2 4 PWMs. Can only work on PWMs 0 to 3
t_pwm_4_7_set 3 4 PWMs. Can only work on PWMs 4 to 7
t_mcu_tm 4 Lift MCU telemetry data
t_esc_tm 5 Lift ESC (escorpion) telemetry data
t_esc_tm2 6 Jeti ESC telemetry data
t_bec_tm1 7 Jeti BEC telemetry data
t_bec_tm2 8 Jeti BEC telemetry data (more data)
t_temp_tm 9 Jeti Temperature sensor telemetry data
t_telemetry_v0 10 telemetry Vector0 (v2)
t_telemetry_v1 11 telemetry Vector1 (v2)
t_telemetry_v2 12 telemetry Vector2 (v2)
t_telemetry_v3 13 telemetry Vector3 (v2)
t_telemetry_v4 14 telemetry Vector4 (v2)
t_telemetry_v5 15 telemetry Vector5 (v2)

The following bytes refer to the specific message:

The command needed to ask the version is the following:

  • cmd (8): t_version

  • data0 (8): App -> 9 CEXv2

  • data1 (8): Version

  • data2 (8): Major

  • data3 (8): Minor

  • data4 (8):

    • bits 7-3: 0
    • bit 1: arbitration_enabled
    • bit 0: arbitrating

Each PWM is configured including a subID that defines the PWM number.

Each message is composed by 4 PWMs.

It exists a timeout that means during how many seconds (normally us) the last received PWM is kept before to switch to the configured “start_value”.

PWMs from 0 to 3 are commanded with a message with 4 PWMs coded with a 12-bit integer:

  • cmd (8): t_pwm_0_3_set (2)
  • pwm0 (12)
  • pwm1 (12)
  • pwm2 (12)
  • pwm3 (12)

PWMs from 4 to 7 are commanded with a message with 4 PWMs coded with a 12-bit integer:

  • cmd (8): t_pwm_4_7_set (3)
  • pwm0 (12)
  • pwm1 (12)
  • pwm2 (12)
  • pwm3 (12)
PWM Message

PWM Message

In Pipe, each PWM has to be sent with the following format:

  • Compress bits unsigned: 12
  • Input: 0.0 , 1.0
  • Output: 0, 4095 (changed with respecto to v1.XX)

Conversion to the current width is made taking into account the configuration.

PWM Output

PWM Output

The message format will depend on how Telemetry is configured.

We will have:

  • cmd (8): ranges from t_telemetry_v0 to t_telemetry_v5
  • data: defined in configuration
Telemetry reading

Telemetry reading

Arbiter will send using its CAN-TX ID and in little endian format.

  • Variable value message: (same as the 4XV)

    • Byte0 0 : t_arbitration message (CANstdp)
    • Byte1 N : Autopilot [0, 3]
    • Byte2-5 VVVV : Autopilot score as Float (32 bits)
  • Status message: (same as the 4XV. However, 4XV sends more data)

    • Byte0 0 : t_arbitration message (CANstdp)

    • Byte1 0xFF : Status flag

    • Byte2

      • bits6-0 : Chief autopilot (current, selected)
      • bit7 : Arbitrating 0:false, 1:true
    • Byte3:

      • bit0 : AP0 Alive
      • bit1 : AP1 Alive
      • bit2 : AP2 Alive
      • bit3 : AP3 Alive (external)
      • bit4 : AP0 Ready
      • bit5 : AP1 Ready
      • bit6 : AP2 Ready
      • bit7 : AP3 Ready (external)
Arbiter telemetry reading

Arbiter telemetry reading

CEX Setup


"arb_id" // Defines the ID of the 4XV arbiter. It is used to parse its messages and change the current AP to match him.
"cfg" : {
        "preferred" // Preferred autopilot. Selected on start (0).
        "method" // Selection method. Can be one of:
            "always_best"
            "change_if_worst"
            "fixed_0"
            "fixed_1"
            "fixed_2"
            "fixed_3"
        "autopilots" // Defines each autopilot  configuration. Currently only variable weights. Note that all must have same weights count and that defines the amount of variables to be used
            {"weights" : [1,1,1] }  // Weights for an autopilot
"can":{                         // Configuration for CAN-A and CAN-B
    "speed" : 1000000,          // Baud rate for CAN
    "rx_ids": [                 // RX IDs array. Up ot four elements. Element index represents Autopilot in arbitration mode
        [                   // Autopilot0 config
            {
                "sz": 4,                // Mailboxes used for this entry
                "flt": {                // Filter for this entry
                    "id": {
                        "ext": false,   // Extended ID
                        "id": 10        // ID
                    },
                    "msk": 2047         // ID mask for the filter. 0 means don't care. 1 Means exact mach is needed.
                }
            },
            {
                "sz": 4,
                "flt": {
                    "id": {
                        "ext": false,
                        "id": 11
                    },
                    "msk": 2047
                }
            }
        ],
        [                   // Autopilot1 config
            {
                "sz": 4,
                "flt": {
                    "id": {
                        "ext": false,
                        "id": 20
                    },
                    "msk": 2047
                }
            },
            {
                "sz": 4,
                "flt": {
                    "id": {
                        "ext": false,
                        "id": 21
                    },
                    "msk": 2047
                }
            }
        ]
    ],
    "tx_id": {  // Transmit CAN ID. Used to send messages from this CEX
        "extended": false,
        "id": 100
    },
    "num_ser_can_rx_mb": 4, // Number of CAN to Serial reserved mailboxes
    "cansuite": {           // CAN Suite configuration
      "canInFilt": [
        {                   // Input filter 0 configuration
          "port": "can_ab", // Accepted ports (can_a, can_b ot can_ab)
          "filter": {       // Accepting CAN filter
            "id": {
              "ext": false,
              "id": 10
            },
            "msk": 2047
          }
        },
        {                   // Input filter 1 configuration
          "port": "can_ab",
          "filter": {
            "id": {
              "ext": false,
              "id": 11
            },
            "msk": 2047
          }
        },
        {
          "port": "can_ab",
          "filter": {
            "id": {
              "ext": false,
              "id": 0
            },
            "msk": 0
          }
        }
      ],
      "canOutFilt": [
        {                   // Output filter 0 configuration
          "port": "can_ab"  // Output ports (can_a, can_b ot can_ab)
        },
        {
          "port": "can_ab"
        },
        {
          "port": "can_ab"
        }
      ],
      "serCan": [
        {                   // Serial to CAN producer 0 configuration
          "id": {           // CAN ID for generated frames
            "ext": false,
            "id": 10
          },
          "timeout": 6.7E-4 // Timeout to send a CAN frame if it is not full.
        },
        {
          "id": {
            "ext": false,
            "id": 11
          },
          "timeout": 6.7E-4
        }
      ]
    }
  }
}

Connects CAN oriented producers and consumers. The configuration map is build as:

"xpccan": {
    "cpmap": {
        "can_out_filt0" : "ser_can0",   // Connects SerialToCAN0 producer to CANoutFilter0 consumer
        "can_out_filt1" : "ser_can1",   // Connects SerialToCAN1 producer to CANoutFilter1 consumer
        "can_out_filt2" : "cex",        // Connects CEX producer to CANoutFilter2 consumer
        "can_ser0" : "can_in_filt0",    // Connects CAN input filter 0 producer to CANtoSerial 0 consumer
        "can_ser1" : "can_in_filt1",    // Connects CAN input filter 1 producer to CANtoSerial 1 consumer
        "cex"      : "can_in_filt2"     // Connects CAN input filter 2 producer to CEX consumer
    }
},

Connects Byte oriented producers and consumers. The configuration map is build as:

  • Producers:

    “scia”, “scib”, “scic”

  • Consumers:

    “scia”, “scib”, “scic”, “lift_esc”, “lift_mcu”, “jeti_box”, “jeti_tm_0”, “jeti_tm_1”

“start value” is the initial value and also the value that is set when no command is received within “timeout” seconds. “time_mode” indicates a time based (in microseconds) or duty mode [0.0, 1.0]

The first four sub-ids(0 to 3) are commanded with command == t_pwm_0_3_set (2) The last four sub-ids(4 to 7) are commanded with command == t_pwm_0_3_set (3)

Each PWM can listen to any sub-id. Multiple PWMs can listen to the same sub-id.

  • Up to 4 ECAPs can be configured.
  • “wrap” possible values are “wrap1”, “wrap2”, “wrap3”, and “wrap4”
  • “trigger” possible values are “trig_rising” and “trig_falling”
  • For pps measurement, set triggers to “trig_rising”.
  • For pulse measurements set trigers alternating from “trig_rising” to “trig_falling”
  • Up to 4 CAP-PPSs can be configured.
  • Configuration is as Veronte’s.
  • Up to 4 CAP-Pulses can be configured.
  • Configuration is as Veronte’s.

Connects ECAPs with PPSs or Pulses. The configuration map is build as:

"cpmap": {
    "consumer1" : "producer1",
    "consumer2" : "producer2",
    // etc...
}
  • Producers:

    “ecap1”, “ecap2”, “ecap3”, “ecap3”,

  • Consumers:

    “pps0”, “pps1”, “pps2”, “pps3”, “pulse0”, “pulse1”, “pulse2”, “pulse3”

fsets are the vectors of fields we want to send. We can set up to 6 vectors with up to 6 variables in each. Each vector can not be larger than 56 bits as it must fit in a CAN message For every Field we have an ID in the route: “key”/”cfg”/”id”

Warning

For the telemetry IDs we must provide its number, not the description string.

Possible IDs:

Message Value Description
v_pps0 1 PPS sensor 0
v_pps1 2 PPS sensor 1
v_pps2 3 PPS sensor 2
v_pps3 4 PPS sensor 3
v_pulse0 5 Captured pulse 0
v_pulse1 6 Captured pulse 1
v_pulse2 7 Captured pulse 2
v_pulse3 8 Captured pulse 3
v_adc0_3_3 9 ADC0 3.3V input
v_adc1_3_3 10 ADC1 3.3V input
v_adc2_5 11 ADC2 5.0V input
v_adc3_5 12 ADC3 5.0V input
v_adc4_12 13 ADC4 12.0V input
v_adc5_12 14 ADC5 12.0V input
v_adc6_36 15 ADC6 36.0V input
v_adc7_36 16 ADC7 36.0V input
v_adc_vin1 17 ADC vIn 1
v_adc_vin2 18 ADC vIn 2
v_pcb_temp 19 PCB temperature (from ADC input)
v_pwm_0 20 PWM 0 output value
v_pwm_1 21 PWM 1 output value
v_pwm_2 22 PWM 2 output value
v_pwm_3 23 PWM 3 output value
v_pwm_4 24 PWM 4 output value
v_pwm_5 25 PWM 5 output value
v_pwm_6 26 PWM 6 output value
v_pwm_7 27 PWM 7 output value

Generate smart.bin

  1. Copy all the .json files needed inside the generation folder received from Embention.
  2. Edit the _gen.bat file in order to include as many lines as needed. Save it and close it.
_gen.bat configuration

_gen.bat configuration

  1. Launch the _gen.bat file.
  2. Wait until all the smart.bin files are generated.

Flash Firmware

  1. Download and install the CCS UniFlash.
  2. Select “New target configuration” and configure it in order to use “Texas Instrument XDS2xx USB Debug Probe” programmer tool and “TMS320F28335” micro.
  3. Plug the programmer tool USB to the PC.
  4. Plug the programmer connector to the CEX and feed it.
  5. Select: Program - Erase (Wait until the process is completed).
  6. Select: Program - Load Binary:
  • Path to target: select the correct smart_xxxx.bin.
  • Start address: 0x300000.
  • Click on OK.
  1. Restart the board.