|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#16
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
Quote:
Note the two different pages, 'mdl' and 'rdk'. MDL is the module version (same exact firmware, but sold as an individual unit) and RDK is the Reference Design Kit that comes with more development tools to develop with Jaguar. That is why the source code is listed on the RDK page and not the MDL page. |
|
#17
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
But if you are are trying to hold position against an external load, and you zero the I term when you reach the target, then the position will change and the controller will have to re-seek the target. |
|
#18
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
|
|
#19
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
|
|
#20
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
![]() |
|
#21
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
Are you telling me I have to pay you $200+ to get the source code so I can analyze it and determine what should be a readily available piece of information to the people that programed this PID function? ![]() Please tell me that's not what you're telling me. What is the difference between the links you just provided and this: http://www.luminarymicro.com/products/rdk-bdc24.html Because on that previously provided link the RDK CD is available for free download. Last edited by techhelpbb : 31-01-2011 at 11:49. |
|
#22
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
You can also click on the Software Updates link. |
|
#23
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
I suspect I'm going to find that the ideal PID algorithm was implemented as I've seen with other TI PID loops in the past. |
|
#24
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
From the RDK (pid.c):
// By using a derivitive gain of zero, this reduces to a simple PI controller. // By using a integral and derivitive gain of zero, it reduces to an even // simpler P controller. The response requirements of the process being // controlled determines the terms required to achieve that level of response. // Controlling motors can typically be done with a simple PI controller. Yeah okay. Now in reality when you set the I and D to zero whatever those units are supposed to be, not only does it not reach the set point even with a small value, but when you make the P value too large it overshoots and becomes unstable. So no...this comment is not correct, we can confirm this as our system is one CIM in a gear box driving a tire with an optical encoder on the output of the gear box and the tire is suspended in mid air. We should be able to reach the desired set point like this if this comment from the Jaguar source code is to be believed. Even if we become unstable at the set point, the actual Jaguar doesn't actually get there it stops short of that goal by a not so trivial amount. Normally P loops do experience offset from the disturbances that weren't factored into reaching the set point, but in this case what is the source of the disturbance? The gear box maybe? Course I'll have to dig more, but maybe the Jaguar thinks the motor response is linear and it's really not, so it when it tries to compensate it misses but can't continue to reduce the value as it now see's zero in the P gain. P is gain so it's essentially without a unit (at least if I believe the way the source code names the variables). I allows you to change the I gain, but it doesn't tell you the repeat time. D allows you to change the D gain, but it doesn't tell you the preact time or rate time. So this brings me back to the question of actual Jaguar PID characteristics... The deadtime or deadzone isn't just a product of code. The I and D are dependent on the speed at with the PID loop can execute. Last edited by techhelpbb : 31-01-2011 at 13:30. |
|
#25
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
I have noticed that with position control that PID works correctly. When using speed on the other hand it isn't quite where it should be. Maybe the PID in the speed loop isnt looking at speed properly . . . meh.
Our solution was to tune the loop to be "quiet" as in no chatter on the drive train at low and high speeds. In the robot code once output stabilized we calculated the error and just increased our set-point by the same percentage. Eventually we got the output we wanted . . . eventually. |
|
#26
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Course I suppose we can get quick and dirty by taking P up to instability (with I and D at 0), then backing off 30%. Then taking I up to instability (with D at 0 and that 30% reduced value of P) and backing off 30%. Then finally taking D to instability and backing off 30% if we even need a D.
|
|
#27
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
What you're doing by shifting the set point is a 'manual reset'. With just 2 speeds it's not so bad, but if you have a lot of speeds you'd have a heck of a time making the changes because...if I'm right...the algorithm doesn't account for the way the motors actually respond to the change in output. It basically thinks the response is more linear than it really is. I expect this to a small extent...but to this extent it makes me wonder if the feedback is really correct...especially in the case of the older Jaguar hardware. However, that is what the I does. It's an 'automatic reset'. Basically the I recognizes that when the loop repeats it didn't get to it's desired output the last time(s) and compensates by 'pushing' the output. The amount of 'pushing' is a combination of the gain (which they apparently let you set) and is scaled by time (repetition rate). However, I don't see as they specify the repetition rate for this code and usually it's something that is measured, not just programmed. The I has a draw back in the sense that if the I 'pushes' too hard it overshoots the set point. In a drive train, that sort of thing might happen because you had a momentary impact and so the I climbed rapidly but then...suddenly...the resistance is lost and now the I is too high. So I is usually capped. As mentioned earlier in cases like that where the disturbance (the impact) happens often you might find that 'reseting' the I is a good idea because if you let I climb to a maximum it'll stay there for a bit till the last few operations even it out. If you don't reset the I in situations were repeated disturbances of noise (especially at a fundamental frequency) you'll get into a situation where the control appear to become erratic or less responsive until the loop figures out that the integration needs to reset. Last edited by techhelpbb : 31-01-2011 at 13:44. |
|
#28
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
Here are the differential equations governing a motor, if you ignore the effect of the inductance in the motor (a pretty good assumption for most things.) I'll stick with differential equations to make it easier to follow rather than using the laplace transform. Code:
V - Km * d/dt theta = R I Kt I = torque Code:
torque = J * d^2/dt^2 theta Code:
V = P * (goal - d/dt theta) Code:
P * goal - R / Kt * J * d^2/dt^2 theta = d/dt theta * (P + Km) Code:
goal * P / (P + Km) = d/dt theta A similar analysis can be used to show that you absolutely need the I term in order to get 0 steady state error. I can go through that math if it isn't clear. Treat the I term when doing a velocity loop as if it were the P term when you tune a position loop, and the P term as though it were the D term when tuning a position loop. |
|
#29
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
However, why such a huge error? I mean if you've got people with 50% error is the feedback that far off the actual measurements? At least our system (one CIM, one Jaguar, one gear box, one tire, encoder on the output) is sitting at 10-15% error (when suspended in the air) at least on one version of the Jaguar as long as we keep the P gain low enough to avoid instability and that's with I and D set to 0. I wonder if they are tuning for speed under load on the ground. That would do it because the noise and disruptions would increase. Last edited by techhelpbb : 31-01-2011 at 15:07. |
|
#30
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
I'm getting lazy, so I'm going to switch to the laplace domain in this following explanation. If you or anyone has trouble following, I'll clarify by request. After a while working with differential equations, I get tired of typing d/dt... (Without going into the details, you can pretty much replace s with d/dt, and 1/s with an integral)
Quote:
Code:
num_motors = 4 m = 150 / 2.20462262 r = 0.0508 R = 12.0 / 133.0 / num_motors / 0.85 + 0.024 + .003 Kt = 0.0182326082 Km = (12.0 - R * 2.7) / (5310.0 / 60.0 * 2.0 * math.pi) G = 40.0 / 12.0 * 48.0 / 15.0 * 22.0 / 15.0 Code:
V = Km * G / r * s * x + R * r / (Kt * G) * s^2 * x The transfer function from ref to s * x (ie, if you ask for a velocity, what do you actually get) is then Code:
s * x / ref = Kp/(Km * G / r + Kp + R * r / (Kt * G) * s) Code:
Kp / (Km * G / r + Kp) Code:
x / ref = Kp/(s Km * G / r + Kp + R * r / (Kt * G) * s^2) Quote:
Quote:
I'm going to take the position that if someone is using just a P controller to try to get the robot to drive at a velocity, they are doing it wrong. They should first start with the I term, and leave the rest of them 0. Would you every try just using the D term in a PID loop when trying to go to position? You'd say that the person was doing it wrong if they did that. Lets show this. Let V = (ref - s * x) * 1/s * Ki, ie a simple I controller. This gives Code:
sx / ref = Ki / (Ki + Km * G / r * s + R * r / Kt * G * s^2) If you pattern match, this I controller for velocity control has the same form as the P controller when doing position control. This says that the I term in the Jaguar's velocity loop acts like the P term in the Jaguar's position loop. A similar analysis will show that the P term in the Jaguar's velocity loop acts like the D term in the Jaguar's position loop. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|