PID control for steering
I implemented PID control for the steering of my car driving at the constant 50 km/hr. But when i start using the variable speeds, sometimes the car overshoots and oscillates for a while that is not found while testing at the constant speed 50 km/hr. Do i need to precalculate different values of Kp and Kd of different speeds or there is some equation do do with or i have to derive equation for it...what could be the possible solutions for it...cause it looks me very lenghty work to precalcluate the different car's different PID values at different speeds.
Guys Help me out..i am running out of time...:(
[Edited by jpetrie: All-caps are not neccessary]
I would assume this is impossible to help you with, without knowing the inputs and outputs to your system. If I remember correctly, oscillation is a sign of an under-damped system, so reduce the integral term and/or increase the differential term.
I would also hypothesise that if you can change the units of your inputs so that they implicitly include current speed, then your outputs will be closer to what you want. eg. use time rather than distance when measuring how far something is, so when you travel at twice the speed, the output is affected by a power of two also.
I would also hypothesise that if you can change the units of your inputs so that they implicitly include current speed, then your outputs will be closer to what you want. eg. use time rather than distance when measuring how far something is, so when you travel at twice the speed, the output is affected by a power of two also.
What you have found is that the PID you tuned for one set point speed is not stable at other set points. This is indicative of a nonlinear control problem.
What exactly are you trying to control with your PID? Is it the position of the vehicle relative to a target trajectory (such as the 'racing line'), or are you trying to get it to drive to a certain position and stop there? Without knowing what you are trying to achieve it is difficult to offer you a solution to your problem.
Regards,
Timkin
What exactly are you trying to control with your PID? Is it the position of the vehicle relative to a target trajectory (such as the 'racing line'), or are you trying to get it to drive to a certain position and stop there? Without knowing what you are trying to achieve it is difficult to offer you a solution to your problem.
Regards,
Timkin
I am trying to drive the car on the road line in Follow the carrot mode. In my steering algorithm, PID cotroller is being used to minimize the heading error of the vehicle. say deltaT = currentsteering got from PID control. Then to ensure that car orientation is changing at the safe rate, i limited this rate by alpha in a following way
DeltaT = +alpha if DeltaT>alpha
-alpha if DeltaT<alpha
DeltaT(value fron PID)
Then to correct the oscillation further, i made a dead time under which car wil stop changing its orientation. Each time it approach closest to the line, Its to ensure that vehicle won't overshoot leading to heading error.
for that i used TurnTime (car takes time to turn to desired orientation) and TurnRelease (car takes times to stop turning)
TurnTime = HeadingError/AngularVelocity and TurnRelease = mod(dT)/alpha
Here dT = current steering lies in value[-1, 1] range.
DeltaT = +alpha If(TurnTime<TurnRelease) && (dT<0)
= -alpha If(TurnTime<TurnRelease) && (dT>0)
= DeltaT(otherwise)
First car wil corrects itself based on heading error, then car will override previoius correction for safe turing and at last it further overrides to ensure that there is no overshoot.
Finally dt += DeltaT
clamp(dt, -1, 1)
Here i am tuning three values Kd, Kd, Ki(its set to value 0) and alpha.
Help me out....Is there any possible other ways to correct my above algorithms or what should i do in the above algorithms to make it automatic adjustable in all speeds of a car.........:(
DeltaT = +alpha if DeltaT>alpha
-alpha if DeltaT<alpha
DeltaT(value fron PID)
Then to correct the oscillation further, i made a dead time under which car wil stop changing its orientation. Each time it approach closest to the line, Its to ensure that vehicle won't overshoot leading to heading error.
for that i used TurnTime (car takes time to turn to desired orientation) and TurnRelease (car takes times to stop turning)
TurnTime = HeadingError/AngularVelocity and TurnRelease = mod(dT)/alpha
Here dT = current steering lies in value[-1, 1] range.
DeltaT = +alpha If(TurnTime<TurnRelease) && (dT<0)
= -alpha If(TurnTime<TurnRelease) && (dT>0)
= DeltaT(otherwise)
First car wil corrects itself based on heading error, then car will override previoius correction for safe turing and at last it further overrides to ensure that there is no overshoot.
Finally dt += DeltaT
clamp(dt, -1, 1)
Here i am tuning three values Kd, Kd, Ki(its set to value 0) and alpha.
Help me out....Is there any possible other ways to correct my above algorithms or what should i do in the above algorithms to make it automatic adjustable in all speeds of a car.........:(
You aren't answering Timkin: you still don't describe at all the physical model that computes the car's movements (represented by many joints, a car is not a rigid body!) from the balance of many different forces and torques (wheel/road drag, engine, steering wheel, elasticity of wheels and suspensions, wind, etc.) with the help of many parameters that describe the car (inertia tensors, sizes and distances, drag coefficients, etc.).
Your very loose explanation also suggests that you are confusing at least three variables: the heading of the car body (presumably your PID input, but what is its reference?), the position of the steering wheels, and something actually controlled such as how much force is applied to the steering wheel.
Your very loose explanation also suggests that you are confusing at least three variables: the heading of the car body (presumably your PID input, but what is its reference?), the position of the steering wheels, and something actually controlled such as how much force is applied to the steering wheel.
Omae Wa Mou Shindeiru
THNX for ur concern Guys...[:)]
You put some light on it but Here is i don't know what to do...I am working on other programs too meanwhile....so its very tough time for me to thinking on it ..but i am trying wel on it...But u know sometime brain wont works the way it used too...[:)]
I am trying to move the car along the spline path.
My car is stable in manual drive and also very well controlling the throttle and breaking at the track's waypoints. Are you asking me to describe the physics model of the car...[:o]
In manual Drive, car runs good with physics. Yes its considering all the physical aspects of cars physics that is what u said.
In PID, i have Heading error and deltaTime as input that gives the desirable steering value as output.
i am facing problem with the tuning of PID control parameters and alpha(rate of change of steering) that i want to be automatically adjustable in all speeds of a car.
At the tested speed(50 km/hr), AI drives the car gud. But in different speeds (say 30 45 75 80 or 90), the car won't drives the way it should along the line. Now my approach is incremental steering (fSteer += deltaSteer) that lies between -1 and 1. I don't want to tune up the parameters for all speeds but to make it automatic adjustable for all speeds.
.
Quote: I would also hypothesise that if you can change the units of your inputs so that they implicitly include current speed, then your outputs will be closer to what you want. eg. use time rather than distance when measuring how far something is, so when you travel at twice the speed, the output is affected by a power of two also.
You put some light on it but Here is i don't know what to do...I am working on other programs too meanwhile....so its very tough time for me to thinking on it ..but i am trying wel on it...But u know sometime brain wont works the way it used too...[:)]
Quote: What exactly are you trying to control with your PID?
I am trying to move the car along the spline path.
Quote:
You aren't answering Timkin: you still don't describe at all the physical model that computes the car's movements (represented by many joints, a car is not a rigid body!) from the balance of many different forces and torques (wheel/road drag, engine, steering wheel, elasticity of wheels and suspensions, wind, etc.) with the help of many parameters that describe the car (inertia tensors, sizes and distances, drag coefficients, etc.).
My car is stable in manual drive and also very well controlling the throttle and breaking at the track's waypoints. Are you asking me to describe the physics model of the car...[:o]
In manual Drive, car runs good with physics. Yes its considering all the physical aspects of cars physics that is what u said.
Quote:
Your very loose explanation also suggests that you are confusing at least three variables: the heading of the car body (presumably your PID input, but what is its reference?), the position of the steering wheels, and something actually controlled such as how much force is applied to the steering wheel.
In PID, i have Heading error and deltaTime as input that gives the desirable steering value as output.
i am facing problem with the tuning of PID control parameters and alpha(rate of change of steering) that i want to be automatically adjustable in all speeds of a car.
At the tested speed(50 km/hr), AI drives the car gud. But in different speeds (say 30 45 75 80 or 90), the car won't drives the way it should along the line. Now my approach is incremental steering (fSteer += deltaSteer) that lies between -1 and 1. I don't want to tune up the parameters for all speeds but to make it automatic adjustable for all speeds.
.
Quote: Original post by idreamlovey
Now my approach is incremental steering (fSteer += deltaSteer) that lies between -1 and 1.
The problem is that your steering problem is nonlinear, as I indicated in my earlier post. Essentially, the rotational rate of the vehicle is a function of its forward speed. Thus, you cannot use a single controller to control the heading of the vehicle across a range of speeds. You need to linearise the control problem about a number of velocity set points and devise steering controllers for those set points. There are a variety of strategies for devising a control for velocities between the given set points, but essetially they boil down to a 'mixture of experts' control approach, with different mixture functions (nearest set point, average of neighbours, weighted average, etc.).
There is a heap of free literature online about steering control of vehicle models. Try [google]. ;) If you're not sure how to implement some of it, or need assistance understanding the material, just holler.
There is another approach - although it is one that I am hesitant to recommend for those not having any grounding in control theory - and that is a multiloop control architecture. If you want more details, just holler.
Cheers,
Timkin
[Edited by - Timkin on June 9, 2008 9:44:44 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement