Magni Serial Protocol: Lower Bound of Speed that can be commanded

Hi everyone

According to the test motor board program at (line 101), the lower bound of the speed that can be commanded to the Magni is -254 (by using this program). However, since 254 is 00000000 11111110, -254 is 11111111 00000010 in Two’s complement. The LSB does not correspond to the LSB computed by this function, which is 00000001.

I think the LSB should be evaluated using 256+speed for negative speeds. This means the lower bound should be -256 instead, since the Two’s complement of -256 is 11111111 00000000.

Teck Ping

Negative numbers mean reverse direction. There is a limit for the rate that is well before 254 or -254 from what I recall.

Let me ask if you are trying to go faster than about 1 meter per second and that is your real need? Thanks

Hi Mark
Thanks for the clarification. I’m teaching a course using the Magni, so I would like to know what is the actual allowable maximum ticks/100ms that can be commanded to the Magni, for safety reasons. I don’t need to go above 1m/s.

We do not have a spec for max rate of incoming speed commands. Knowing what I know as the firmware designer I would then suggest you limit your speed commands to about 25 per second. You may be able to send faster but we only check for packets at a given rate so if you sent lets say 100 speed commands per second that would be a bit excessive and we may be able to eat characters at that rate but realistically due to our rate of control for the PID loop it really would not help you do do that high of a rate but it ‘may’ be a sort of upper limit. Again, I don’t have a spec for this nor have I tried to see the upper limit because we control that rate on the raspberry Pi so this question is more of a motor controller only specification and we just have not characterized it at this time.