# NAO motor model identification

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. • You have access to matlab + system identification toolbox?? Oct 26 '14 at 22:25
• 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? Oct 27 '14 at 0:53
• @Kinkilla No I don't Oct 27 '14 at 11:54
• I have thought about that. However I have no idea how to include the saturation component into the differential equation. Oct 27 '14 at 13:42
• 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? Oct 27 '14 at 13:53

if(angle'> max)