This repository has been archived by the owner on Sep 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Propulsion Microcontroller API
Anthony Randell edited this page Nov 23, 2016
·
22 revisions
This page contains the commands used when communicating to and from the Wireless Communication Modules.
More details about the communication protocol can be found via the API Documentation Homepage.
Request Message:
- Payload Size: 1 byte (null)
Response Message:
- Payload Size: 1 byte
Request Message:
- Payload Size: 14 Bytes
- See Qik 2s12v10 User Guide -> Configuration Parameters for more details
Byte | Description | Valid Range |
---|---|---|
13 (MSB) | MSB of Set Indicator Word | 0b00000000 to 0b00001111 |
12 | LSB of Set Indicator Word | 0b00000000 to 0b11111111 |
11 | Device ID | 0 to 127 |
10 | PWM Parameter | 0 to 5 |
9 | Shut Down Motors on Error | 0 to 7 |
8 | Serial Timeout | 0 to 127 |
7 | Motor M0 Acceleration | 0 to 127 |
6 | Motor M1 Acceleration | 0 to 127 |
5 | Motor M0 Brake Duration | 0 to 127 |
4 | Motor M1 Brake Duration | 0 to 127 |
3 | Motor M0 Current Limit / 2 | 0 to 127 |
2 | Motor M1 Current Limit / 2 | 0 to 127 |
1 | Motor M0 Current Limit Response | 0 to 127 |
0 (LSB) | Motor M1 Current Limit Response | 0 to 127 |
Response Message:
- Payload Size: 13 Bytes
- The reponse contains the configuration as it was just set. This is used to confirm the correct change was made to the parameters
- See Qik 2s12v10 User Guide -> Configuration Parameters for more details
Byte | Description | Valid Range |
---|---|---|
12 | Reserved for Expansion | 0 |
11 | Device ID | 0 to 127 |
10 | PWM Parameter | 0 to 5 |
9 | Shut Down Motors on Error | 0 to 7 |
8 | Serial Timeout | 0 to 127 |
7 | Motor M0 Acceleration | 0 to 127 |
6 | Motor M1 Acceleration | 0 to 127 |
5 | Motor M0 Brake Duration | 0 to 127 |
4 | Motor M1 Brake Duration | 0 to 127 |
3 | Motor M0 Current Limit / 2 | 0 to 127 |
2 | Motor M1 Current Limit / 2 | 0 to 127 |
1 | Motor M0 Current Limit Response | 0 to 127 |
0 (LSB) | Motor M1 Current Limit Response | 0 to 127 |
Request Message:
- Payload Size: 1 byte (null)
- This command reads the configuration of the motor controller without modifying any of the settings
Response Message:
- Payload Size: 13 bytes
- See Qik 2s12v10 User Guide -> Configuration Parameters for more details
Byte | Description | Valid Range |
---|---|---|
12 | Reserved for Expansion | 0 |
11 | Device ID | 0 to 127 |
10 | PWM Parameter | 0 to 5 |
9 | Shut Down Motors on Error | 0 to 7 |
8 | Serial Timeout | 0 to 127 |
7 | Motor M0 Acceleration | 0 to 127 |
6 | Motor M1 Acceleration | 0 to 127 |
5 | Motor M0 Brake Duration | 0 to 127 |
4 | Motor M1 Brake Duration | 0 to 127 |
3 | Motor M0 Current Limit / 2 | 0 to 127 |
2 | Motor M1 Current Limit / 2 | 0 to 127 |
1 | Motor M0 Current Limit Response | 0 to 127 |
0 (LSB) | Motor M1 Current Limit Response | 0 to 127 |
Request Message:
- Payload Size: 9 bytes
- Used to set the speed of both motors simultaneously
Response Message:
- The response from the microcontroller to a set motor speed is to reply with the new motor speed to confirm the set was successful
- Payload Size: 9 bytes
Byte | Description | Valid Range |
---|---|---|
8 (MSB) | Reserved for Expansion | 0 |
7 | M0 Speed (MSB) | Integer -100 to 100 |
6 | M0 Speed | Integer -100 to 100 |
5 | M0 Speed | Integer -100 to 100 |
4 | M0 Speed (LSB) | Integer -100 to 100 |
3 | M1 Speed (MSB) | Integer -100 to 100 |
2 | M1 Speed | Integer -100 to 100 |
1 | M1 Speed | Integer -100 to 100 |
0 | M1 Speed (LSB) | Integer -100 to 100 |
Request Message:
- Used to request the current being consumed by both motors.
- Payload Size: 1 byte (null)
Response Message:
- Reply from the microcontroller contains the current of both motors in milliamps.
- Payload size: 9 bytes
Byte | Description | Valid Range |
---|---|---|
0 | Reserved for Expansion | 0 |
1 | M0 Current | Integer > 0 |
2 | M0 Current | Integer > 0 |
3 | M0 Current | Integer > 0 |
4 | M0 Current | Integer > 0 |
5 | M1 Current | Integer > 0 |
6 | M1 Current | Integer > 0 |
7 | M1 Current | Integer > 0 |
8 (LSB) | M1 Current | Integer > 0 |