# Can I remove my step response overshoot?

I am working on a balance controller for a robot. I found the open loop transfer function between the motor voltage and robot pitch angle:

G1 =

-589300 s^4 - 7.71e08 s^3 - 1.435e11 s^2 - 2.566e12 s - 7.683e09
--------------------------------------------------------------------------------------------------
s^7 + 2418 s^6 + 1.317e06 s^5 + 1.977e08 s^4 + 1.312e10 s^3 + 1.796e11 s^2 - 9.658e11 s - 1.525e13


The system has the open loop bode plot and nyquist plot:-

This system has one RHP pole and no RHP zeroes, so it is an unstable system (beucase there are no encirclements of -1). To fix stability while also enhancing the performance I added the following terms to my balance controller.

1. A negative proportional gain: $$\K_p = -1 \$$
2. A post integrator: $$\G_{ip} = \frac{0.05s + 1}{0.05s} \$$
3. An integrator: $$\ G_i\frac{0.5s + 1}{0.5s}\$$
4. A lead term in the forward branch: $$\G_d = \frac{0.06086s + 1}{0.01826s + 1} \$$

After adding these to my controller, the entire system is now stable. I plotted the step response with the following code (there is unity feedback):

Gcl = feedback(G1*Kp*Gip*Gi*Gd,1)


The step response has a fast rise time, but about 50% overshoot. The settling time is also fine and there is no oscillations, so I am just looking for a way to remove that overshoot, even if it means a slower system. Is there a way to do that?

## Edit

Playing and reducing the gains gives me these step responses:-

Here is the root locus plot of the original open loop system without my terms:-

## Edit 2

I added a lowpass filter like Andy suggested, and I hope I did it right, by first finding the closed loop transfer function (there is unity feedback): $$\G_{cl}=\frac{G_{ol} \cdot G_{low}}{1+G_{ol}} \$$ and it gives me these step responses for different lowpass filters:-

• OK, instead of altering anything, what if you forcibly slowed down the input step change with a low pass filter (outside the loop)? Try it. Mess with it and understand it. Apr 18, 2021 at 17:54
• yes. root locus of plant * Gip * Gi * Gd * Kp. zoom in to show region bounded by +-100 on both axis as well as +-10 also. see if any gain values exist where all poles are to the left of a line described by y=-x; for x<0. if not, a low overshoot solution probably doesn't exist for this combination of controller poles and zeros. tune the zeros of the controller to see if the root locus will take all poles to the left of the above mentioned line for a single gain value. It is difficult to give a ready made solution for such a problem (IMHO).
– AJN
Apr 18, 2021 at 18:09
• @Andyaka I edited the question and added the step responses after I added a lowpass filter to the system. And it seems the overshoots for 1/(s+1) and 1/(0.5s+1) actually disappear!
– Carl
Apr 18, 2021 at 18:17
• root locus that i plotted
– AJN
Apr 18, 2021 at 18:19
• Somewhere between s and 0.5s looks about right then. Apr 18, 2021 at 20:34

In a series controlled motor arm, the mechanical inertia and hysteresis and high slew rates, it is normal to have overshoot. Damping the input with a LPF blocks the spectrum that results in the overshoot but also reduces phase margin in the feedback loop. Putting the LPF after the loop may be impractical with a shock absorber to the arm or loading the output mechanically both reduce the overshoot.

Reducing the Kp gain will reduce the slew rate and thus the spectral content that produced the overshoot,BW -3 dB = 0.35/Tr (10 to 90%) but also reduce the phase margin in the loop.

In human arms and legs all muscles are bipolar opposing forces that contract and relax to control force and position. If you can modelled your design on this , then the hysteresis would drop and stability would be far better with opposing motors keeping the minimum tension for control, stability and rigidity from interference.

The problem logically is the stored energy to accelerate is not scaled to the load which might vary so the step response will change unless you change your maximum acceleration/torque current and use a profile that ramps up then predicts when to deaccelerate with zero overshoot in the fastest possible time. This is how arms work in magnetic hard disk drives (HDD). So there are 3 controls for a,v,x with multiple feedbacks for current, servo velocity and position error. This is how I think you ought to control your system, not by analyzing the step response. Keep in mind thermal effects on motor torque and load variations that dampen the response as well as hysteresis.

• I appreciate the answer Tony, but I think it's way beyond the scope of what we are trying to do. Perhaps when I have a lot more experience I will fully understand your answer. But at this point my problem was solved by adding a prefilter in the form of a lowpass filter.
– Carl
Apr 18, 2021 at 19:30
• It’s not complicated, , make current your acceleration and velocity ramps up to max then negative current deacceleration ramp Down in velocity and then close the loop on a velocity ramp down just before going into position error tracking. With a simple algorithm based on the mass being moved and f=ma = current then x time = distance to brake before going into Position tracking , it works well every time a= /———\ then Position tracking at the right moment for the last little bit. Otherwise your filter will over damp small moves and underdamped large moves with more mass. Apr 18, 2021 at 20:49
• I assume you have current feedback and position feedback right? So you can compute velocity. step response is not the best test, but a whole range of seeks with different directions , mass and path length. Apr 18, 2021 at 20:50