(And I really must be crazy to stay up late doing this)
At 115200 there is also a pattern (and why did I start with 57600?)
00 00 00 00 00 00 00 54 22 00 10 20 B9 D8 00 00 00 00 00 00 00 00 27 D8 00 00 00 00 00 00 00 00 27 D8 00 00 00 00 00 00 00 00 27 D8 00 00 00 00 00 00 00 00 27 ...
First position notification says ’08 00 45 01 00 00 00 00′ so the encoder is at zero.
Sending 5x the command to turn 1 degree I get 3 position changes:
08 00 45 01 01 00 00 00 08 00 45 01 04 00 00 00 08 00 45 01 05 00 00 00
(1º, 4º and 5º)
and a decent capture:
D8 00 00 00 00 00 00 00 00 27 D8 00 01 00 00 00 00 00 00 26 D8 00 02 00 00 00 00 00 00 25 D8 00 02 00 00 00 00 00 00 25 D8 07 03 00 00 00 00 00 00 23 D8 07 04 00 00 00 00 00 00 24 D8 03 05 00 00 00 00 00 00 21 D8 03 05 00 00 00 00 00 00 21 D8 00 05 00 00 00 00 00 00 22 D8 00 05 00 00 00 00 00 00 22 D8 00 05 00 00 00 00 00 00 22
So clearly the 3rd byte is the position (but passing through 2º and 3º seems to have been ignored by the Hub) and the 2nd byte is related to the speed and direction of the rotation.
Now the 1st and last byte: 27 is the ones’ complement of D8
And probably this isn’t the right algorithm but it works at 4 am: if we calculate ‘S’ as the XOR of all payload bytes, the last byte is 27 – S.
Now I ‘just’ need to understand the first bytes received after power up:
00 00 00 00 00 00 00 54 22 00 10 20 B9
It must be the announcement that complements the AutoID…. but does it have some kind of meaning?
Ideas?
“Now I ‘just’ need to understand the first bytes received after power up”
I have a hunch this *is* the auto-id. I think all IDs on PF2 devices are given via UART.
It would be interesting to see what the other sensors send during startup as well an compare them to what the motor sends.
I’m planning to program an Arduino to send this then just keep repeating all the other 10 byte to see what happens.
I was expecting something more complex like sending the desired position through the UART and letting the motor do all the work… I don’t see this kind of hub doing hard work robotics with this kind of motors, the micro hasn’t enough oomph. Perhaps a new MINDSTORMS is on the way and this motors are just the Small version of new tacho motors.
The motor driver chips are in the BOOST, so I don’t think the motor will be that smart/autonomous.