# Magni Motion Anomalies

**URL:** <https://forum.ubiquityrobotics.com/t/magni-motion-anomalies/930>\
**Category:** General Questions\
**Created:** [January 30, 2022, 4:11pm UTC](https://forum.ubiquityrobotics.com/t/magni-motion-anomalies/930 "2022-01-30T16:11:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![edwardc](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/e/ec9cab/32.png) [@edwardc](https://forum.ubiquityrobotics.com/u/edwardc)\
**Post date:** [January 30, 2022, 4:11pm UTC](https://forum.ubiquityrobotics.com/t/magni-motion-anomalies/930/1 "2022-01-30T16:11:07Z")

</div>

Apology in advance for the long-winded post, but I wanted to be thorough.

I’ve been doing research into the behavior of the Magni’s  
PID controller with respect to some unusual movement characteristics  
we have observed in our two Magni’s, both under th Kinetic and Noetic images.  
I found that subjective evaluation wasn’t good enough, so I started collecting  
numerical data.

Using the 'rostopic echo" command on the /diagnostic topic, I was able  
to parse out and capture the left and right motor velocity, as well as  
the associated timestamp, and then plot this data.

This test was run with the following conditions:

- Firmware version v43\_20210829\_enc.cyacd
- ROS Noetic Pi image - 2020-11-07-ubiquity-xenial-lxde-raspberry-pi.img.xz
- P set to 5000, per Ubiquity recommendation
- I, D, and pid\_velocity set to 0, per Ubiquity
- teleop\_twist\_keyboard was used to drive the motors
- Motor max speed was set close to 1
- The “i” key was pressed for about 2 1/4 sec and then released  
in order to drive both motors together

The captured data stream has an update rate of 20Hz. Inspecting  
the data revealed that the values were only changing every  
six data points, resulting in a very “quantized” plot. In order  
to reduce this, I downsampled the left motor’s data by a factor of  
six, and then ran it through a cubic spline fit to smooth it.  
I left the right motor’s data in raw form as a sanity check on the  
smoothing.

 ![pid_test_5000_0_0](https://frm.ubiquityrobotics.com/uploads/default/original/1X/80876da613094d2ab14ef185f840787f0a66ac21.png)

The plot reveals three behaviors that give us problems:.

First, before starting, we hear some low-level “chatter” in the wheels. This can plainly be seen in the  
raw data, although the smoothing tends to hide it.

Second, Upon acceleration, there is a noticeable “hump” in the curve, confirming my  
visual observation of a “hesitation” when starting motion. This is not consistent on  
every run. Something odd is definitely going on there.

And lastly, the deceleration side of the curve is definitely  
steeper than the acceleration side, with no “soft landing” at  
the end. Our application has a rather tall superstructure on top of the magni,  
and, even with a max speed of only 0.3, this abrupt deceleration actually causes  
the rear wheels to lift off of the ground, causing us concern that it will tip over!

We have seen these behaviors with both the V40 and V43 firmware, under either Kinetic or Noetic images. I have also reduced the “P” value down to 2500 with similar results.

Has anyone else observed these anomalies?  
Is this a problem in the FW, in the ubiquity\_motor node, or in our setup?

---

<div class="post-metadata">

**Author:** ![anfederman](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/anfederman/32/141_2.png) [@anfederman](https://forum.ubiquityrobotics.com/u/anfederman)\
**Post date:** [February 3, 2022, 10:55pm UTC](https://forum.ubiquityrobotics.com/t/magni-motion-anomalies/930/2 "2022-02-03T22:55:32Z")

</div>

Thank you for your careful analysis. We will take a look at your data and get back to you. Since I personally am not familiar with your exact configuration, I can’t give any specific fixes. Some other variables I would consider though is where the center of gravity is relative to the front of the robot. Another is the coefficient of friction on the floor. A polished concrete floor would work differently than an outside sidewalk.

Another thing I would check is the mechanical and electrical connections. Especially check if the wheels and casters haven’t worked loose or if the chassis is bent. If the robot is driving straight, this probably isn’t an issue. As always make sure your batteries are charged.

We will be in touch, if you don’t hear back from Ubiquity Robotics by COB Monday, please contact me directly at [alan.federman@gmail.com](mailto:alan.federman@gmail.com)

---

<div class="post-metadata">

**Author:** ![anfederman](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/anfederman/32/141_2.png) [@anfederman](https://forum.ubiquityrobotics.com/u/anfederman)\
**Post date:** [February 3, 2022, 11:05pm UTC](https://forum.ubiquityrobotics.com/t/magni-motion-anomalies/930/3 "2022-02-03T23:05:56Z")

</div>

Thinking about a little more on a top heavy robot, when you start forward you tilt back with reduces the traction on the front wheels, making them more likely to slip. May explain why acceleration and deceleration curves are different, but I took calculus almost 50 years ago.

---

<div class="post-metadata">

**Author:** ![edwardc](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/e/ec9cab/32.png) [@edwardc](https://forum.ubiquityrobotics.com/u/edwardc)\
**Post date:** [February 5, 2022, 7:00pm UTC](https://forum.ubiquityrobotics.com/t/magni-motion-anomalies/930/4 "2022-02-05T19:00:53Z")

</div>

This particular plot was done with the wheels up off of the floor in order to simplify things and eliminate as much of our application’s kinematics as possible. Guess I should have noted that in the test conditions. 🥴
