Difference between revisions of "ECUs implementing Sensorboards and Actorboard"

From ConceptCar
Jump to: navigation, search
Line 11: Line 11:
 
==Sensorboard Steering==
 
==Sensorboard Steering==
  
This ECU decodes the steering PWM channel from the radio receiver and the wheel speed sensors from the rear left and front right wheels. Analogue amplifiers (MCP6002) increase the signal level of the wheel speed sensors so their signal can be decoded on a digital input of the AT90CAN128.
+
This ECU decodes the steering PWM channel from the radio receiver and the wheel speed sensors from the rear left and front right wheels. Analogue amplifiers (MCP6002) increase the signal level of the wheel speed sensors so their signal can be decoded on a digital input of the AT90CAN128.  
  
 
Table 1.2 presents the CAN messages for the Sensorboard steering.
 
Table 1.2 presents the CAN messages for the Sensorboard steering.

Revision as of 10:36, 18 February 2010

The interfaces between the sensors and actuators and the Concept Car’s CAN Bus are implemented using AT90CAN128 boards. Their main purpose is to do low level tasks, for example PWM de- and encoding.

In the following, the AT90CAN128 board is presented and the ECUs that are implemented over AT90CAN128 boards are described in details. Those ECUs were presented in the Section Electronic_System in the Input and Output Processing levels of the Figure 1.3.

The AT90CAN128 board

The AT90CAN128 board is composed by an 8-bit RISC Microcontroller with AVR core, 128K bytes of programmable Flash memory, 4K byte EEPROM and 4K byte of internal SRAM, 53 general purpose I/O lines, 32 general purpose working registers, CAN Controller , 4 timers, and others resources described in [Atm08].

In the following, a table is presented for each ECU showing the CAN messages this ECU emits. In those tables, the "CAN-IDs" column presents the integer representing the ID of the message. Column "Semantics" describes the type (or meaning) of the message. Column "Interval" describes the interval in which the message is sent. Finally, the column "Conversion" holds a formula that is used for converting the message content which is usually a float value to the integer data that is packed into the message.

Sensorboard Steering

This ECU decodes the steering PWM channel from the radio receiver and the wheel speed sensors from the rear left and front right wheels. Analogue amplifiers (MCP6002) increase the signal level of the wheel speed sensors so their signal can be decoded on a digital input of the AT90CAN128.

Table 1.2 presents the CAN messages for the Sensorboard steering.

Table 1.2: Sensorboard Steering's CAN messages
CAN ID Semantics Interval Conversion
0x025 Desired steering angle (α) for the steering servo. Negative values mean “steer left”. Value range is -30° to 30°. Radio receiver’s frequency, 20ms typ.
Error creating thumbnail: Unable to save thumbnail to destination
0x00a Wheel speed (ω) from rear left wheel 50ms
Error creating thumbnail: Unable to save thumbnail to destination
0x009 Wheel speed (ω) from the front right wheel 50ms
Error creating thumbnail: Unable to save thumbnail to destination

Sensorboard Throttle

This ECU decodes the throttle PWM channel from the radio receiver and the wheel speed sensors from the front left and rear right wheels. Analogue amplifiers (MCP6002) increase the signal level of the wheel speed sensors so their signal can be decoded on a digital input of the AT90CAN128.

Table 1.3 presents the CAN messages for the Sensorboard Throttle.

Table 1.3: Sensorboard Throttle's CAN messages
CAN ID Semantics Interval Conversion
0x022 Desired throttle value for the engine control. Conversion result is percentage of controller’s maximum value, +100% means full speed, -100% is full stop, 0% is neither brake nor speedup. Radio receiver’s frequency, 20ms typ.
Error creating thumbnail: Unable to save thumbnail to destination
0x008 Wheel speed (ω) from front left wheel 50ms
Error creating thumbnail: Unable to save thumbnail to destination
0x00b Wheel speed (ω) from the rear right wheel 50ms
Error creating thumbnail: Unable to save thumbnail to destination

Sensorboard Distance

This ECU accesses the distance sensors over an I²C-Bus. It features safety architecture, described in [Zim09].

Table 1.4 presents the CAN message for the Sensorboard Distance.

Table 1.4: Sensorboard Distance's CAN message
CAN ID Semantics Interval Conversion
0x030 Distance (d) to the next obstacle up front. 65ms
Error creating thumbnail: Unable to save thumbnail to destination

Sensorboard Acceleration & Datalogging

This ECU controls the acceleration (longitudinal and lateral) and rotation (yaw rate) sensors over a SPI-Bus. It also measures the voltage of the battery that supplies the electrical components.
Error creating thumbnail: Unable to save thumbnail to destination
Sensors for acceleration and yaw rate. Arrows indicate positive values.

It additionally features data logging capabilities; it dumps all data on the CAN-Bus to a file on a FAT-formatted SD- or MMC-Card.

Atop of this, since revision 1.2, it features a 8x2 digits LCD display and a 8 Pin DIP switch, intended for selecting the currently displayed information. The display gets updated every 250ms.

Due to a design failure in revision 1.2, the display is mounted at the bottom side of the sensor board. This will be corrected in the next revision.

  • If DIP switch 1 is "on", the display shows the current longitudinal acceleration (acc_x).
  • Else if DIP switch 2 is "on", the display shows the current lateral acceleration (acc_y).
  • Else if DIP switch 3 is "on", the display shows the current yaw rate.
  • Else if DIP switch 4 is "on", the display shows the current supply voltage.
  • Else if DIP switch 5 is "on", the display shows the filename that the data is logged to (if SD card is present) and the total number of bytes that have been written to this file so far.
  • Independent of the other switches, the DIP 8 switch selects the mode of the display. If it is set to "on", the current raw value (as transferred over the CAN bus) is shown, if it is set to "off", the display shows the value converted to its respective physical unit (m/s^2, °/s, V).

Table 1.5 presents the CAN messages for the Sensorboard Acceleration & Datalogging.

Table 1.5: Sensorboard Acceleration's CAN messages
CAN ID Semantics Interval Conversion
0x010 Longitudinal Acceleration (ax) 50ms
Error creating thumbnail: Unable to save thumbnail to destination
0x011 Lateral Acceleration (ay) 50ms
Error creating thumbnail: Unable to save thumbnail to destination
0x012 Rotation (ω) 50ms
Error creating thumbnail: Unable to save thumbnail to destination
0x00d Voltage (U) of the electrical system’s battery 200ms
Error creating thumbnail: Unable to save thumbnail to destination

Data Logging

The Sensorboard Acceleration & Datalogging can write data to a FAT16-formatted SD or MMC card that is inserted into the card reader slot. When the board is booted and a valid card is detected, a new file is created and data from all messages on the can bus is written into this file. There is no mechanism to specifically close the log file. Just remove the card or power down the board.

LED "LOGGER ON"
When this LED is on, the SD card is present, has been detected and the file could be opened for writing.
LED "LOGGER WRI"
This LED blinks once each time a 512 Byte sector is dumped to the SD card. A good indicator if logging actually works. Every 8 sectors the file size is updated, resulting in an irregularity in the blinking. Thus, the filesize always is a multiple of 512 * 8 = 4096 Bytes. You can configure this number in the Makefile.
The Write LED is turned on after the SD card has been initialized. If it stays on and the "LOGGER ON" LED stays off, the file system could not be initialized. Most likely this means that the SD card has the wrong format, but for some reasons even if the format is correct, filesystem initalization always fails on some cards.
  • File Naming Scheme
    • The data is stored to a newly created file with the naming scheme LOG<nr>.CAN. The <nr> part is a consecutive number to name all files differently and not to overwrite an older log. An internal counter increments each time a new log file is written, and the counter state is conserved in EEPROM over reboots. Reflashing the board resets the counter to 0.
  • Requirements for the card
    • The SD or MMC card must meet the following conditions:
      • A partition table exists.
      • The "DOS compatibility flag" must be set.
      • There is exactly one primary partition.
      • The partition's type is "FAT16" (set partition code to 0x06 with fdisk).
      • The partition is formatted with FAT16, two fats.

Using a Unix/Linux system, if /dev/mmcblk0 is your MMC/SD card device,

 > mkfs.vfat -F 16 /dev/mmcblk0p1

would create a valid FAT 16 partition.

On a Windows XP system, formatting the card with FAT (not FAT32!) works.

Despite having the correct partition scheme and formatting, some cards just did not work. We can not tell you why and how, just check if the red LED indicates that the logger works. Cards with 2GB or more tend to be problematic, try using a 1GB card.

  • Log file format
    • The log file has a binary format, containing a dump of all CAN messages including a timestamp for each. For each CAN message, the following data fragment is written:
 /----------------------------------------------------------\
 | Header | Timestamp | CAN ID  | Data Length |     Data    |
 |  0xca  |  4 Bytes  | 2 Bytes |    1 Byte   | 0 - 8 Bytes |
 \----------------------------------------------------------------------------------------/

The Header field is always one Byte with hex value 0xca. The Timestamp field holds the time in ms since the board was booted up. The remainder of the data fragment is the CAN message's id and content. For each received CAN message, a new fragment of this sort is appended to the log file. The writing format is set in [1]. Since there is no mechanism for explicitly closing the log file, the last message fragment in the log file is usually cut off.

Actorboard

The ActorBoard's task is the creation of the PWM signals to drive the actuators. It receives the CAN messages and generates the respective PWM signals for controlling the ConceptCar’s actuators.

With a switch, the board can be toggled to use either the radio receiver decoders’ data from the Sensorboards (CAN ids 0x22 and 0x25) or processed values from the Controlboard (CAN ids 0x122 and 0x125) as inputs.

Based on the value from the CAN bus, the ECU implements the following features:

  • Entering a safe mode, i.e. producing a PWM signal that makes the car stop if one of these conditions hold:
    • A Sensor Board detects a malformed PWM input signal and throws an error message on the CAN bus
    • No new values arrive from the CAN bus (lost connectivity)
  • A hardware switch to select different CAN-IDs and by these different sources for the generated PWM signals.

As described above, the Concept has two actuators, throttle motor and the steering servo.

  • Throttle
    • The brushless controller gets as input a PWM signal generated by the Actuator Board based on the received CAN messages.
  • Steering Servo
    • Steering is performed by a steering jumbo-servo that turns both front wheels. The steering servo directly processes the PWM signal that is generated by the Actuator Board.

Table 1.6 presents the CAN messages for the Actorboard.

Table 1.6: Actorboard's CAN messages
CAN ID Semantics Interval Conversion
0x020 Selected source for actuator control. The source can be selected with the switch on the Actorboard. 1s
Error creating thumbnail: Unable to save thumbnail to destination