# Velocity Control via Vibration

I am working on a robot that has an accelerometer. This accelerometer measures the vibration of the robot. When the robot hits a certain vibration, I would like it to slow down in order to reduce the vibration. I thought about a PID controller, but I don't think it would work. Does anybody have some input on different types of controllers I can use?

• Mechaman
• Are the vibrations indicative of a resonant frequency, or are they directly correlated to motor speed? – Ian Jun 30 '14 at 17:11
• The vibrations are indicative of a sort of 'resonant frequency' or rather damaging frequency of something being being held by the robot... and it cannot reach that frequency and damage the that something. – mechaman Jul 1 '14 at 21:40
• Just to check my assumptions here, are you slowing down a free-spinning load that is vibrating due to being off balance, or is this robot more like a speeding car -- slowing down when the bumpiness of the road gets too intense? – Ian Jul 2 '14 at 3:06
• I am slowing down a speeding car when it notices that the terrain has just become too bumpy. So the latter! – mechaman Jul 3 '14 at 3:30
• That changes things a bit... I put my reply into answer form. – Ian Jul 5 '14 at 16:49

Since you are attempting to slow down a car when the road gets too bumpy, a PID controller is not what you want. Or rather, the bumpiness of the road will determine the desired speed that goes into the PID, instead of being part of the PID's sensor feedback loop.

You may want to look at additive increase, multiplicative decrease as a function to control your desired speed. The basic idea would be:

good = 1
while (true):
if (bumpy_level_detected() > bumpy_level_allowed):
else:
good = good + 1



In more mathematical notation: $$speed_{desired} = \frac{k_{good} * g}{({k_{bad}})^b}$$ Where $g$ represents the number of iterations where the bump sensor was within limits, $b$ represents the number of iterations where the bump sensor was over the limit, $k_{good}$ controls how quickly the car ramps up its speed when the road is smooth, and $k_{bad}$ controls how quickly the car slows down when the road is bumpy.

(The above is just for explanatory purposes; in practice, rather than keeping $g$ and $b$ in memory and causing an overflow as they increase, you'd just apply the $k_{good}$ > 0 and $k_{bad} > 1$ constants to the running total as appropriate.)

• After thinking about this problem and getting distracted from this problem, I've came to realize that although this control scheme is good for packets... Robots or rather objects with mass and dynamic properties won't work so well. Have you seen a successful account of this control scheme for a robot? – mechaman Jul 29 '14 at 19:36
• I don't know of any robots that use this control scheme. That said, it's the simplest algorithm I know of that provides adaptability to a channel of randomly-changing capacity (in the network case, the congestion level; in your case, the bumpiness that causes the vibration). A more rigorous approach would be to model the bumps as a stochastic process. Why don't you think the AIMD approach I outlined above would work for an object with dynamic mass? – Ian Jul 30 '14 at 20:27

Your main problem is that vibration isn't a well-defined measurement; what number do you assign to vibration? Peak accel value? Average accel value? And over what time range; peak value over the last 1s, 2s, 3s?

Once you've decided precisely what measurement you plan to use, then I would initially go ahead and try a PID. If it works then you're set. Beyond that, it's hard to say what will work well. Ideally, you would use a controller that minimizes energy (e.g. $\mathcal{H}_\infty$ control) but those are quite complex and take a lot of advances math to understand and create.

• What we end up doing is taking the rms every 4 readings from the accelerometer. I considered PID, but if we have our set point of 'vibration' to be 0 then the vehicle will output a linear velocity that is 0. This is due to the case where no movement = no vibration and we don't want this to occur. What is this energy minimizer controller you speak of? – mechaman Jun 28 '14 at 2:14
• Your controller is doing more than just reducing vibration, it is also tracking a reference signal. So your controller input is now some combination of position error and vibration measurement, e.g. $\hat{e} = (p-p^d) + \alpha q$ where $p$ is your postiion, $p^d$ is your desired position, and $q$ is your vibration measurement. $\alpha$ is a coefficient for you to tune. – ryan0270 Jun 28 '14 at 13:09
• Can you describe the intuition behind including the position inside of my error equation? Perhaps a better description of my system is necessary: I have a mathematical model for my robot and I am designing for the linear velocity and the angular velocity. These two variables translate into the right and left motor velocities of my differential drive robot.For the angular velocity, I used heading error with its own PID. And for the linear velocity I want it to be minimized depending on the vibration of the vehicle. – mechaman Jun 28 '14 at 23:22
• This said, I don't see why I need to include position in my PID if I already have that handled. My robot can attain a position with the current setup given any velocity, but now I want to vary the velocity as to minimize it based on the vibrations of the robot. (Sorry had to split this up into 2 comments) – mechaman Jun 28 '14 at 23:23
• Sorry, but I don't understand your description. Are you saying that your system input is linear/angular velocity and the output is linear/angular position? Please edit your original question to make this clear. – ryan0270 Jun 29 '14 at 5:16