1
$\begingroup$

I am trying to create a model for the NAO [robot]'s motors. The figure below shows the step response for the knee motor. Afaik the NAO internally uses a pid controller to control the motor. I have no control over the pid or it's parameters. Thus I would like to treat the motor including pid as a black box. Theoretically it should be possible to model pid+motor as a $pt_2$ system, i.e. a second order lti system. A $pt_2$ system is defined by the following differential equation:

$$T^2\ddot{y}(t) + 2dT\dot{y}(t)+y(t) = Ku(t)$$.

I tried fitting a $pt_2$ model but was unable to find good parameters.

Any idea what model to use for this kind of step response?

edit: I tried modifying the equation to add a maximum joint velocity like this:

$$T^2\ddot{y}(t) + (\frac{2dT\dot{y}(t) + m - |2dT\dot{y}(t) - m|}{2})+y(t) = Ku(t)$$ where $m$ is the maximum velocity. The fraction should be equivalent to $min(2dT\dot{y}(t), m)$.

However I am not sure if this is the correct way to introduce a maximum joint velocity. The optimizer is unable to find good parameters for the limited velocity formula. I am guessing that is because the min() introduces an area where parameter changes do not cause any optimization error changes.

Step response image

$\endgroup$
9
  • $\begingroup$ You have access to matlab + system identification toolbox?? $\endgroup$
    – TobiasK
    Oct 26 '14 at 22:25
  • $\begingroup$ Be careful when trying to apply pure theoretical models on real systems. I am pretty sure what is happening there is the servo is reaching it's maximum speed thus saturating. Have you tried including a saturation component in the derivative of the position(angle) of your pt2 model? $\endgroup$ Oct 27 '14 at 0:53
  • $\begingroup$ @Kinkilla No I don't $\endgroup$ Oct 27 '14 at 11:54
  • $\begingroup$ I have thought about that. However I have no idea how to include the saturation component into the differential equation. $\endgroup$ Oct 27 '14 at 13:42
  • $\begingroup$ You can't simply add saturation to the equation, it has to be done with software so you can properly simulate the behaviour of the servo. Are you trying to do this without a computer? $\endgroup$ Oct 27 '14 at 13:53
0
$\begingroup$

Try something like:

if(angle'> max)
    angle'=max
else if(angle'< min)
    angle'=min
end

Try 0.1 (and -0.1) for the max velocity of the servo, I came up with that value from the graph you showed.

$\endgroup$
1
  • $\begingroup$ It works. I was just too stupid to correctly use the CMA-ES optimizer :) thx! The maximum velocity calculated by the optimizer is 0.08 btw. $\endgroup$ Oct 29 '14 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.