control speed of both wheels when it
is rotating is same directions (not under load). In this case, motors
reach needed value but quickly speed up until max speed"
We must check :
under load motherboard closed loop algorithm is fine
But in this case, how can we drive a light robot with this platform?
A solution would be to modify / rewrite motherboard source code (runs on STM32 F103). For now, I have not found any projects about it.
Power your robot, chair, couch, with an overboard! Gives anything two wheels drive! Hoverboard are chinese low cost products. Hacking it can give a meaningful platform to give a two wheels drive platform to anything
### Components Analysis Refer ifixit for a detailed analysis of hoverboard. Interesting parts are :
how do these components interact?
is it possible to control hoverboard externally?
### Daughterboard / motherboard communication
Daughterboard can be used either on right/left. So we only bought 1 daughterboard to decode Daughterboard / motherboard exchanged data. We connected a single daughterboard to left and left motherboard/daughterboard connectors. In this case when rotating daughterboard, wheels are rotating in two different directions.
#### Protocol Probing a logic analyser on daughterboard 4 wire connectors gives some interesting info :
logic level = 3.3V
bit duration ~ 38.10µs => baud rate ~ 26300kbps
there is no clock provided on given lines => Async protocol
get maximum frame length taking for example a frame of 0 or a frame of 0/1/0/ and so on... After that you will conclude (helped with Salae logic ananlysers):
Daughterboard send data to motherboard using 3.3V UART @26300bps - 1 stop bit - no parity bit.
#### Exchanged data
Here are decoded data with UART analyzer in Salae Logic software :
Do not move daughterboard, power motherboard and read decoded data. We can see :
redondant 256 integer : it is frame start => frame size = 6 9bits integers
Now let's play with photodiode used in daughterboard contacts :
if we hide at least one of it last frame integer = 85
otherwise last frame integer = 170
If 170 value is sent to motherboard : motors won't be driven (it means user to not have its feet on hoverboard)
4 remaining bytes must be decoded : two of these bytes repeats. Rotating daughterboard gives indication :
little move only modify a frame integer => this integer must be low significant 9bit
more rotation modifies other integer => rotation seems to be encoded on 2 9 bit integers.
Rotating around 0 helps us : Angular value is coded in 2x9bits signed integer value (2's complement)
We can check it is only an angular value applying linear acceleration to daughterboard. In this case angular value do not change.
## hardware In order to control hoverboard we need an external MCU to :
send left and right foot angular position => we need two UART Tx lines supporting 9bits UART @ 26300bps
optionally read daughterboard current postion (for tests) => we need 1 UART Rx line supporting 9bits UART @ 26300bps
Different MCU can be used, we could use UART bitbanging libraries... But a nice solution is to use teensy 3.1/3.2 :
### software As we saw in our first tests, when same daughterboard is connected to two motherboards/daughterboard connectors :
wheels rotating direction is different. Hoverboard is rotating
In this case same angular value on left foot and right foot is sent to motherboard. In order to have hoverboard moving forward / backward we must apply for example :
a positive angular value on right foot daughterboard Uart
negative angular value on left foot daughterboard Uart
function : it reads current angular value from daughterboard to control hoverboard in forward direction.
After testing we can easily :
control speed of both wheels when it is rotating in different direction (under load or not)
But we cannot :
control speed of both wheels when it is rotating is same directions (not under load). **In this case, motors reach needed value but quickly speed up until max speed**
We can suppose, closed loop algorithm on motherboard does not support forward / backward mooving when it is not under load.
Seeing that you guys are smarter than me, especially regarding reverse engineering strange software, has there been any project to create a driver board which could be directly driven by a computer such as the raspberry pi?
I am looking into using and modifying the scooter controllers available cheap on ebay. Then control them with a PI board...
Seeing that you guys are smarter than me, especially regarding reverse engineering strange software, has there been any project to create a driver board which could be directly driven by a computer such as the raspberry pi?
I am looking into using and modifying the scooter controllers available cheap on ebay. Then control them with a PI board...
Any intrest?
william...