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

**URL:** <https://forum.ubiquityrobotics.com/t/magni-serial-protocol-lower-bound-of-speed-that-can-be-commanded/1059>\
**Category:** Uncategorized\
**Created:** [June 12, 2023, 4:42am UTC](https://forum.ubiquityrobotics.com/t/magni-serial-protocol-lower-bound-of-speed-that-can-be-commanded/1059 "2023-06-12T04:42:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![teck\_ping](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/2bfe46/32.png) [@teck\_ping](https://forum.ubiquityrobotics.com/u/teck_ping)\
**Post date:** [June 12, 2023, 4:42am UTC](https://forum.ubiquityrobotics.com/t/magni-serial-protocol-lower-bound-of-speed-that-can-be-commanded/1059/1 "2023-06-12T04:42:49Z")

</div>

Hi everyone

According to the test motor board program at [https://github.com/UbiquityRobotics/ubiquity\_motor/blob/noetic-devel/scripts/test\_motor\_board.py](https://github.com/UbiquityRobotics/ubiquity_motor/blob/noetic-devel/scripts/test_motor_board.py) (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.

Thanks  
Teck Ping

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [July 3, 2023, 9:49pm UTC](https://forum.ubiquityrobotics.com/t/magni-serial-protocol-lower-bound-of-speed-that-can-be-commanded/1059/2 "2023-07-03T21:49:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![teck\_ping](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/t/2bfe46/32.png) [@teck\_ping](https://forum.ubiquityrobotics.com/u/teck_ping)\
**Post date:** [July 25, 2023, 3:22am UTC](https://forum.ubiquityrobotics.com/t/magni-serial-protocol-lower-bound-of-speed-that-can-be-commanded/1059/3 "2023-07-25T03:22:18Z")

</div>

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.  
Thanks.

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [August 7, 2023, 8:36am UTC](https://forum.ubiquityrobotics.com/t/magni-serial-protocol-lower-bound-of-speed-that-can-be-commanded/1059/4 "2023-08-07T08:36:21Z")

</div>

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.
