6. Communication Protocol
This section provides detailed information about the communication protocol used to interface with the FFT Gyro board. Once the system is connected via USB, you can use this protocol to send packets for retrieving data, such as encoder readings, or to control the motors by setting their position, velocity, and torque.
For convenience, some examples are provided using MATLAB, but any tool capable of accessing the COM port can be used.
6.1 Configuration Packet
- The configuration packet is a 32 bytes packet that allows the user to set the configuration of the FFT Gyro motors and the motor's LEDs status.
6.1.2 Configuration Packet Structure
- The configuration packet is a 32 Byte data packet. Each attribute of the data packet is described below.
6.2 Read Packet
The read packet is also a 32 bytes packet, which depending on the system mode(motor or encoder) the bytes retrieved will mean different things.
The next section will explai in more detail about the read packet and each byte meaning wether the encoders are mounted on the system or the motors-
6.2.1 Read Packet Structure - Encoder
- In the Encoders mode, the read packet is used to retreive the encoder's data, this is, the absolute angle position of each encoder. The next picture depicts the 32 bytes of this packet:
6.2.2 Read Packet Structure - Motor
- In the Motors mode (as in the Encoders mode), a packet with 32 Bytes is used to read motor's position, motor's velocity, it's temperature, voltage and torque, each byte of the data packet is described below:
Note that the second byte of this packet is the one that is used to define which mode is being used (Mode system).
6.3 Write Packets
There are also write packets used to write and configurate some options from the motors. The majority of the optins of this packets only work when motors are mounted on the system.
6.3.1 Write Packet Structure Type-1
- In the write mode for Type-1 packets, a 32 Byte data packet is sent. The attributes of this packet are described below.
6.3.2 Write Packet Structure Type-2
- In the write mode for Type-1 packets, a 32 Byte data packet is sent.
- Key attribute of the data packet include parameters related to the movement of the motors, as angle limit for the CW and CCW movement, goal position in Joint mode, velocity to reach the goal position, and velocity for free spin in Wheel mode
- Each attribute of the data packet is described below.