# Tag Info

9

The paper Controlling of Quadrotor UAV Using a Fuzzy System for Tuning the PID Gains in Hovering Mode by E. Abbasi, M. J. Mahjoob explains how to tune PID gains with fuzzy logic. You can find many papers about singleton tuning but this paper shows totally fuzzy control find PID gains with ziegler-nichols (or another technique) Create a fuzzy PID gain ...

8

Embedded.com has moved my article yet again, but here is where it is now. This shows you both how to write a PID loop (figuring out how to do it in something other than floating point is left as an exercise to the reader) and how to tune it. PID Without a PhD The best way depends a lot on your abilities. The way to get the best tuning, assuming you're an ...

4

I don't think this is related to integral windup at all. I noticed that the I-error does not converge to zero That's a good thing, because it means your integral term is not useless. The integral term is there to compensate for steady-state errors. If you set the integral gain to 0, you should see that your system never reaches the setpoint. The I-...

4

I'll try to expand a little from my experience for those who may be interested. I think the problem is we have a lot of control theory that is somewhat inaccessible (and sometimes not useful) and then we have rules of thumb that make assumptions about systems that are often inaccurate. Stability Let's talk first about why control loops become unstable. ...

2

Based on the videos, it looks like the answer is, unfortunately, "the test setup you have might be insufficient to say one way or the other". There is too much slack in the tethers to draw any meaningful conclusions about whether your code is doing the right thing. The quadcopter seemed to be reacting somewhat correctly to the way it was being tugged by ...

2

I assume that you'd aim to place the poles in $-0.5 \pm 0.2 \cdot i$ for stability reasons. In the s-domain, the transfer function is: $$\frac{\Phi_c}{\Phi}=\frac{K_p}{s^2+K_ds+K_p}.$$ Computing the closed-loop poles, hence the roots of the characteristics polynomial $s^2+K_ds+K_p$, gives you: $$\begin{array}{cc} K_d=1 \\ K_p=1.16/4 \end{array}.$$

2

Welcome to Robotics, Bloopie Bloops! You haven't stated what platform/language this is, so I'll just give some illustrative pseudo code. As Mark Booth mentioned, the typical way to evaluate/critique controller performance is by plotting the reference and output values together. There are several glaring issues with your code, so I'll go over those. You're ...

2

Your goal is a bit unclear. In the sense that you don't really care about your motor control input, what you want is a given rotational velocity. the pid is going to give you the command (motor input) to achieve it given the desired one and the current one (plus derivative). Most likely this command is going to be a PWM signal which will be fed to a motor ...

2

Well you have two methods to go with really. As I don't know you're system at all, it's mostly difficult to tell you what to start with. Model it and Auto tune, then fine adjust by hand (how I would generally do things) Your system is a pretty basic mechanical system with damper...so you can use an equation such as: $$x''(t)+2 D \omega _0 x'(t)+\omega _0^... 1 Look for highly nonlinear problems where a single PID is not suitable to work at its best within the whole operational range thus requiring multiple controllers. Here's an example in Simulink. In your case, instead of having a repertoire of PID controllers already tuned up to operate in different points, you might consider sticking to a single PID whose ... 1 When I look at your graphs of position error and integral error, I don't see any unexpected behaviors for a system which is not quite tuned well enough. You are not showing integral windup nor saturation. Make sure to use the integral loop of your controller only when holding at a steady-state position and you will avoid windup. It looks like your ... 1 It is in frequency domain instead of time domain.$$ G(s)=\frac{K(s+a)^2}{s} = \frac{Ks^2+2Kas+Ka^2}{s} $$according to the Laplace form of the PID controller$$ G(s)=\frac{K_ds^2+K_ps+K_i}{s} $$so$$ K_d = K, K_p = 2Ka, K_i = Ka^2 

1

What does your code look like that you use to calculate your errors? I had suggestions to revise your code, but you're just linking back to your earlier questions so I don't know if that's current or not. If you are calculating your error terms correctly, you could try an experimental tuning method like Ziegler-Nichols, but again, this relies on your error ...

1

A standard approach (using opencv solvePnP) is using at least 4 points in the image that define landmarks of a known geometry. You can then get the pose of the camera relative to the object. For example if you had a blue rectangle of which you could detect the corners in the image, and you knew the dimensions of this rectangle, you could work out the ...

1

On the condition that you don't care about the position of the quadrotor regarding your target, but instead only of the absolute distance, I would say that for starters, you can extract the distance information from your OpenCV algorithm. Have a target with a clear contour (eg a coloured ball) and find its relative position from the center of the camera ...

1

:EDIT: I've edited out most of the content I had previously written because your code does work (except for the mis-matched parenthesis), but it threw me off because this is not really a complimentary filter. You have a hodge-podge here that is confusing to look at initially. First you have a lag filter on the accelerometer output: alpha = 0.98; ...

1

Your PID calculation is all wrong. You have: //calculate power_difference of motors power_difference = error/(Kp/100) + derivative*(Kd/100); First, you need correct error terms. You calculate: //make calculations error = position - 2500; derivative = error - lastError; I'm assuming here that 2500 is the signal you are expecting if you are exactly ...

1

I have to say that $G(s)$ seems to represent quite a strange physical system with a settling time of 15.8 hours, especially compared with the requirement. There might have been some mistakes in identifying the system, maybe? The known term of the denominator is out of scale. Perhaps the data you collected to identify the model are not correctly scaled. ...

Only top voted, non community-wiki answers of a minimum length are eligible