Difference between revisions of "Throttle"

From 'Engineers of Innovation Wiki'
Jump to navigation Jump to search
Line 45: Line 45:
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t
| 0xAA || Control type || MSB int16_t  || LSB int16_t|| MSB int16_t  || LSB int16_t
|-
|-
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Max value for lever completely backward (Positive for reverse)
| Hardcoded command|| See Table Above || colspan=2 | Max value for lever completely forward || colspan=2 | Same but for backward (Positive for reverse)


|}
|}

Revision as of 17:48, 17 March 2024

The throttle controls the motor and is operated by the pilot during sailing. It controls the duty cycle of the motor via the CAN bus using the standard VESC message format.

Usage

Throttle shown in the inactive (green led) neutral position

To use the throttle to control the motor the green illuminated arm-button will have to be pressed for a few seconds, however some conditions need to be met to ensure a safe start of the motor.

  1. The dead-man cord needs to be applied to the bottom of the throttle body, should snap in place magnetically
  2. The throttle lever Should be in its neutral position, pointing straight up with a noticeable tactile bump
  3. The CAN bus need to be actively acknowledging packets, which means other devices need to be active on the bus
  4. No other error should have occurred inside the electronics


If one of these conditions is not met, the throttle will beep the number of times indicated above.

Programming Throttle Position

The throttle position is read out by a magnet attached tot the throttle lever, because the orientation of this magnet is not know in the firmware, this position can be programmed into the EEPROM. To enter programming mode hold down the arm button during power-on. A four beep descending tone should be played, and the LED should do a double blink in red continuously. To program the throttle push lever as far forward as possible and press the button, a single beep be heard. Repeat this twice with the lever in the center and finally with the lever all the way backwards. After three beeps the throttle is reprogrammed and normal operation is resumed.

If no programming is desired leave the lever alone for 10 seconds and the lever will reboot into normal mode.

Can Protocol

The Throttle controls the VESC motodriver with the default CAN format implemented inside the VESC. More info on the format. The throttle supports four modes:

Different control modes of the throttle
Control Mode Configuration Byte Value Unit Additional data required
Duty Cycle 0x01 Percentage None lever in the maximum forward position is 100%
Filtered Duty Cycle 0x02 Percentage None lever in the maximum forward position is 100%
Current Control 0x03 100mA Specify the max current for forward and backwards in two int16_t's
RPM Control 0x04 RPM Specify the rpm for forward and backwards in two int16_t's


These modes can be send to the throttle when the throttle is off. If the throttle is on the configuration will be ignored. A sound will play when a message is received. The message has to be send to the Throttle address 0x1337, same as the reboot command. the format is as follows:

Can Message
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5
0xAA Control type MSB int16_t LSB int16_t MSB int16_t LSB int16_t
Hardcoded command See Table Above Max value for lever completely forward Same but for backward (Positive for reverse)