The CAN communication protocol in this product is CAN2.0B standard, its communication baud rate is 500 K, and its message format is the MOTOROLA format. Through the external CAN interface, users can switch the control model and control the linear speed and steering angle of the RANGER. The RANGER will real-time feedback the current movement status information (including the integrated movement information of the vehicle and the detailed movement information of each wheel) and the system status information (including self-diagnostic error codes).

Table of Contents

Connection of the CAN Cable

The 4WD chassis is shipped with a circular connector male head. The definition of its lines can refer to the figure below:

Untitled

Figure 3.1 Overview of the circular connector

Implementation of CAN command control

Start the RANGER chassis normally. At this time, the RANGER chassis will receive instructions from the CAN interface. At the same time, the host can also analyze the status of the current chassis through the real-time data fed back by the CAN bus. For specifi c protocol content, refer to the CAN communication protocol. (Note: The remote control has the fi rst control right and has the highest priority. By default, the remote control does not turn on the chassis when it is powered on, and the chassis is in standby mode.)

1. System Status Feedback Command

| Command | System Status Feedback Command | | | | | --- | --- | --- | --- | --- | | Node for sending | Node for receiving |   ID |   Period (ms) | Receive timeout (ms) | |   Drive-by-wire chassis | Decision- making and control unit |   0x211 |   20ms |   None | | Data length | 0x08 |   | | | | Byte | Meaning | Data type | Note | | |     byte [0] |   Current vehicle status |     unsigned int8 | 0x00 The system is normal 0x01 0x01 Emergency shut-down mode 0x02 The system is abnormal | | | byte [1] | Control mode | unsigned int8 | 0x00 Standby mode 0x01 Command control mode 0x03 Remote control mode | | |   byte [2] | High order byte of battery voltage |       unsigned int16 |     Actual voltage X 10 (the unit is 0.1 V) | | |   byte [3] | Low order byte of battery voltage |       unsigned int16 |     Actual voltage X 10 (the unit is 0.1 V) | | |   byte [4] | Highest order byte of error message | unsigned int32 | Refer to the error message table for details | | |   byte [5] | High order byte of error message | unsigned int32 | Refer to the error message table for details | | |   byte [6] | Low order byte of error message | unsigned int32 | Refer to the error message table for details | | |   byte [7] | Lowest order byte of error message | unsigned int32 | Refer to the error message table for details | |

3. System Status Feedback Command

| Byte | Bit | Meaning | | --- | --- | --- | | byte [4] |   bit [0] | Right front steering servo warning (0: unfaulty; 1: faulty) | | |   bit [1] | Right rear steering servo warning (0: unfaulty; 1: faulty) | | |   bit [2] | Left rear steering servo warning (0: unfaulty; 1: faulty) | | |   bit [3] | Left front steering servo warning (0: unfaulty; 1: faulty) | | | bit [4] | Reserved, the default value is 0. | | | bit [5] | Reserved, the default value is 0 | | | bit [6] | Reserved, the default value is 0 | | | bit [7] | Reserved, the default value is 0 | | byte [5] |   bit [0] | Right front steering zero point calibration status (0: unfaulty; 1: faulty) | | |   bit [1] | Right rear steering zero point calibration status (0: unfaulty; 1: faulty) | | |   bit [2] | Left rear steering zero point calibration status (0: unfaulty; 1: faulty) | | |   bit [3] | Left front steering zero point calibration status (0: unfaulty; 1: faulty) | | |   bit [4] | Steering calibration timeout (0: unfaulty; 1: faulty) | | |   bit [5] | Safety edge collision status, (0: normal; 1: triggered, the chassis should be stopped immediately.) | | | bit [6] | Reserved, the default value is 0 | | | bit [7] | Reserved, the default value is 0 | | byte [6] | bit [0] | driver status (0: unfaulty; 1: faulty) | | |   bit [1] | Communication connection status with upper layer (0: unfaulty; 1: faulty) | | |   bit [2] | No. 5 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [3] | No. 6 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [4] | No. 7 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [5] |   No. 8 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [6] | over temperature protection status (0: normal; 1: triggered) | | |   bit [7] | Overcurrent protection status (0: normal; 1: triggered) | | byte [7] |   bit [0] | Battery undervoltage status (0: normal; 1: triggered) | | |   bit [1] | Ultrasonic obstacle avoidance status (0: normal; 1: triggered) | | |   bit [2] | Remote control lost connection protection status (0: normal; 1: triggered) | | |   bit [3] | No. 1 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [4] | No. 2 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [5] | No. 3 motor driver communication status (0: unfaulty; 1: faulty) | | |   bit [6] | No. 4 motor driver communication status (0: unfaulty; 1: faulty) | | | bit [7] | Reserved, the default value is 0. |

3. Motion Control Feedback Command

The motion control feedback frame includes the current linear speed and steering angle of the vehicle. The details of the protocol are as follows

| Command | Motion Control Feedback Command | | | | | --- | --- | --- | --- | --- | |   Node for sending |   Node for receiving |   ID |   Period(ms) |   Receive timeout (ms) | |   Drive-by-wire chassis |   Decision-making and control unit |     0x221 |     20ms |     None | | Data length | 0x08 |   |   | | |   Byte |   Meaning |   Data type |   Note | | |         byte [0] byte [1] |       High order byte of speed Low order byte of speed |           signed int16 |         Actual speed X 1000 (the unit is 0.001 m/s) | | | byte [2] | Reserved |

| 0X00 | | | byte [3] | Reserved |

| 0X00 | | | byte [4] | Reserved |

| 0X00 | | | byte [5] | Reserved |

| 0X00 | | |         byte [6] byte [7] |     High order byte of steering angle Low order byte of steering angle |           signed int16 |         Actual steering angle X 100 (the unit is 0.01 °) | |

4. Speed/Steering angle control command

The motion control frame includes the linear speed control command and the steering angle control command. The details of the protocol are as follows:

| Command | Control Command | | | | | --- | --- | --- | --- | --- | |   Node for sending |   Node for receiving |   ID |   Period (ms) |   Receive timeout. (ms) | |     Decision-making and control unit |     Node for the chassis |       0x111 |       20ms |       500ms | | Data length | 0x08 |   |   |   | |   Byte |   Meaning |   Data type |   Note | | |                         byte [0] byte [1] |                   High order byte of linear speed Low order byte of linear speed |                         signed int16 |                   Speed of the vehicle, whose unit is mm/s (valid value + -2500; valid value + -1250 when the steering angle > 20°; taking effect in front and rear Ackerman mode and oblique motion mode) Forward direction is positive | | |   byte [2] |   Reserved |

|   0X00 | | | byte [3] | Reserved |

| 0X00 | | |               byte [4] byte [5] |         High order byte of spin speed Low order byte of spin speed |               signed int16 |           Speed of the vehicle, whose unit is mm/s (valid value + -1000, taking effect in spin mode) Counterclockwise spinning is positive. | | | byte [6] byte [7] | High order byte of steering angle Low order byte of steering angle | signed int16 |                 Steering angle, whose unit is 0.01° (valid value +- 4000 in front and rear Ackerman mode, valid value +- 9000 in oblique motion mode, only taking effect in front and rear Ackerman mode and oblique motion mode) | |

As shown in Figure 3.2.1, when the RANGER is in front and rear Ackerman mode, the feedback steering angle is (α+β)/2, left steering is negative, and right steering is positive; the feedback speed is the average value of the four wheels’ speed (that is, the linear speed of the chassis), reversing is negative, and moving forward is positive. If you need to check the detailed steering angle and speed of each wheel, please refer to 0X271 and 0X281 feedback frames.

Untitled