-
Notifications
You must be signed in to change notification settings - Fork 17
Hints on getting started
Whenever I start a session with the hoverboard, the first thing i do is disable the poweroff timer. This can be done from the ascii protocol by sending:
unlockASCII\n
P\n
and will stop your board from screaming at you after a few minutes of non action, and then powering down.
send
?\n
to list commands.
using the ascii protocol, send
Iw\n
to enable immediate commands with PWM control.
then press 'w' repeatedly until the wheels move (>~40).
to disable all, press x (e.g., you have hit a wall!). to exit immediate mode, press q.
send:
Ip\n - for PID controlled positional immediate commands.
Is\n - for PID controlled speed immediate commands.
Send cmd 'T' with some data, and expect a msg 't' back with the same data. Use this to send random data and random data lengths to qualify your driving code & connection.
To set PID controlled speed demand in mm/s, use subcmd 03 to set 'speedData'. send a message containing the first two longs only (unless you want to change the max power settings). This will enable PID controlled speed on write.
To set PWM directly (no PID control), use subcmd 0x0D or 0x0E to set 'PWMData'. send a message containing the first two longs only (unless you want to change the max power settings). This will enable PWM write.
To set position, use subcmd 0x04 to set a new position in mm (beware - always read where it believes it is first - it really will try to drive to Canada if you tell it!)
To INCREMENT position (much safer), use subcmd 0x05 to increment the current position by mm.
Note that you can read positon in mm (left and right wheel mm moved), or XYT (subcmd 0x0C) which is a dead reckoning estimation of location (mm) and angle (degrees). (currently, reset of the dead reckoner is not implemented - functions are available, but it needs to be integrated into protocol.c).