billmania / roboquest_core

The backend functionality for the RoboQuest project
1 stars 0 forks source link

Fixed two defects affecting joystick motor control #46

Closed billmania closed 1 year ago

billmania commented 1 year ago

There were two separate defects with the way joystick velocity commands were transformed to individual motor velocity commands. One defect affected the variability of velocity and the other affected the ability to turn.

Removed some unnecessary floating point arithmetic, further reducing motor control latency by an additional small amount.

Tested by mounting the motors on a board, attaching their drive sprockets, and placing a tiny bit of yellow tape on each sprocket (to make direction and speed more easily visible). Fiddled with the motor speed control and then commanded via both joystick and keys. Motor speed control properly constrains both keys and joystick. Both keys and joystick spin the motors in a suitable direction. Lastly, joystick values from 0 to 100 affect the motor speed correctly.

Anecdotally, minimum motor speed is about 8% of maximum.

https://github.com/billmania/roboquest_core/issues/45