|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
setting torques directly: strange effectsHi there, I created a PD-Controller which calculates the necessary torques to maintain the angle between bodies. The following setup is used, two bodies are connected using a hinge- joint which can revolve around the x-axis. One of the bodies is fixed to the world, so the other one can revolve freely and they both won't fall down. The torques that would keep the second body level to the ground (90°) was computed by the PD-Controller (and with pen and paper) and applied using different functions: hingeAddTorque, bodyAddTorque, bodySetRelTorque of bodySetTorque. Now what happens: If the joint-body 1 (JB1) is the "fixed" one and joint-body 2 (JB) is the "other" one, and x-axis is (1,0,0) _or_ JB1 is "other" and JB2 is "fixed" and x-axis (-1,0,0): The "other" body hangs at ~45°, so it seems some torque is "lost" If I switch the above setting: JB1 "fixed" and JB2 "other" and the x- axis is flipped to (-1,0,0) _or_ "the appropriate other setting": The "other" body hangs at -90°, so nothing is "lost", but the effect isn't desired either. Funny thing: if the gravity is set to ZERO, everything works as expected. Please, if you have any hint of a slightest idea, feel free to enlighten me. Cheers, Nils --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ode-users" group. To post to this group, send email to ode-users@... To unsubscribe from this group, send email to ode-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ode-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: setting torques directly: strange effectsA PD controller with a constant external disturbance, gravity in this case, will find an equilibrium point where the deflection, the "P" or position error times the gain exactly counteracts the external disturbance. To eliminate this error, add an integral component to your controller, so it becomes a PID (position, integral, derivative) controller. To create an integral term, create an accumulator and sum the value of the error at each time interval, multiply this sum by a negative gain and add it to the commanded control torque. The good news is that, with the right gain, this will eliminate the steady state error; the bad news is that if you choose the gain wrong, you could make the system unstable. Good luck, Noel Hughes On Oct 27, 10:53 am, Nils <cs.r...@...> wrote: > Hi there, > > I created a PD-Controller which calculates the necessary torques to > maintain the angle between bodies. > > The following setup is used, two bodies are connected using a hinge- > joint which can revolve around the x-axis. > One of the bodies is fixed to the world, so the other one can revolve > freely and they both won't fall down. > > The torques that would keep the second body level to the ground (90°) > was computed by the PD-Controller (and with pen and paper) and applied > using different functions: hingeAddTorque, bodyAddTorque, > bodySetRelTorque of bodySetTorque. > > Now what happens: > If the joint-body 1 (JB1) is the "fixed" one and joint-body 2 (JB) is > the "other" one, and x-axis is (1,0,0) > _or_ JB1 is "other" and JB2 is "fixed" and x-axis (-1,0,0): > The "other" body hangs at ~45°, so it seems some torque is "lost" > > If I switch the above setting: JB1 "fixed" and JB2 "other" and the x- > axis is flipped to (-1,0,0) > _or_ "the appropriate other setting": > The "other" body hangs at -90°, so nothing is "lost", but the effect > isn't desired either. > > Funny thing: if the gravity is set to ZERO, everything works as > expected. > > Please, if you have any hint of a slightest idea, feel free to > enlighten me. > > Cheers, > Nils --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ode-users" group. To post to this group, send email to ode-users@... To unsubscribe from this group, send email to ode-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ode-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: setting torques directly: strange effectsThanks for you reply. It's basically working now. Maybe I should've mentioned, that there is an "Inverse Dynamics" module between the PD-Controller and ODE to convert the accelerations from the controller to torques for ODE. Turns out the computations are done with a _negative_ gravity, which of cource means positive. =) In other words ODE has -9.81 m/s/s and ID has +9.81. The errors that are occurring right now are probably due to me not quite understanding the ODE joint axes: Why does it matter which body is first and where the axes are pointing? In my conception it should all come down to the question if I rotate CW or CCW with negative or positive velocity. But it doesn't. So I'll keep searching... On Oct 28, 4:53 pm, noel <nhughes1s...@...> wrote: > A PD controller with a constant external disturbance, gravity in this > case, will find an equilibrium point where the deflection, the "P" or > position error times the gain exactly counteracts the external > disturbance. To eliminate this error, add an integral component to > your controller, so it becomes a PID (position, integral, derivative) > controller. To create an integral term, create an accumulator and sum > the value of the error at each time interval, multiply this sum by a > negative gain and add it to the commanded control torque. The good > news is that, with the right gain, this will eliminate the steady > state error; the bad news is that if you choose the gain wrong, you > could make the system unstable. > > Good luck, > Noel Hughes > > On Oct 27, 10:53 am, Nils <cs.r...@...> wrote: > > > Hi there, > > > I created a PD-Controller which calculates the necessary torques to > > maintain the angle between bodies. > > > The following setup is used, two bodies are connected using a hinge- > > joint which can revolve around the x-axis. > > One of the bodies is fixed to the world, so the other one can revolve > > freely and they both won't fall down. > > > The torques that would keep the second body level to the ground (90°) > > was computed by the PD-Controller (and with pen and paper) and applied > > using different functions: hingeAddTorque, bodyAddTorque, > > bodySetRelTorque of bodySetTorque. > > > Now what happens: > > If the joint-body 1 (JB1) is the "fixed" one and joint-body 2 (JB) is > > the "other" one, and x-axis is (1,0,0) > > _or_ JB1 is "other" and JB2 is "fixed" and x-axis (-1,0,0): > > The "other" body hangs at ~45°, so it seems some torque is "lost" > > > If I switch the above setting: JB1 "fixed" and JB2 "other" and the x- > > axis is flipped to (-1,0,0) > > _or_ "the appropriate other setting": > > The "other" body hangs at -90°, so nothing is "lost", but the effect > > isn't desired either. > > > Funny thing: if the gravity is set to ZERO, everything works as > > expected. > > > Please, if you have any hint of a slightest idea, feel free to > > enlighten me. > > > Cheers, > > Nils You received this message because you are subscribed to the Google Groups "ode-users" group. To post to this group, send email to ode-users@... To unsubscribe from this group, send email to ode-users+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ode-users?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |