The structure of a typical harmonic drive consists of a rigid circular spline, a flexible flexspline, and an elliptical wave generator. The wave generator is coupled to the motor shaft and hence is rotated at high speed. The circular spline has internal teeth. Between the two are the flexspline that has teeth on the outside surface. As the wave generator turns, it deforms the flexspline causing its teeth to mesh with the teeth of circular spline. The effective gear ratio is determined by the difference in the number of teeth of the flexspline and circular spline. In , a linear math model of a harmonic drive from the motor torque to the load angle is derived, without considering the actuator dynamics. The complete model is left as an exercise (problem 6-15). In this article we show how to develop an overall linear model of a DC motor equipped with harmonic drive mechanism, and then perform some computation and simulation with Scilab. Consult  for some basic discussion on using Scilab for independent robot joint control.
Overall Transfer FunctionA robot joint actuated by DC motor with harmonic drive can be described as in Figure 1. The left side is just an equivalent electrical circuit of DC motor, and on the right is the mechanical subsystem. Note the harmonic drive mechanism is represented as a gear transmission through a flexible shaft with stiffness k. This is the model suggested in . Our task is to include the motor dynamics and gear ratio to the equations already derived there.
(4)where and are torque constant and back EMF constant, respectively. To simplify the notation a bit, we assume here that and are the inertia and friction of motor after transmission through the gear ratio. For real motor parameters, one must adjust these values to achieve a precise model. Taking Laplace transform and rearranging terms yield
(7)where and are defined as
(9)Substitute (7) into (6)
(11)together with gear relation (3), substitute into (10) and rearrange terms
(12)It is straightforward for the reader to verify that the overall transfer function of this system equals
(13)To study a concrete example, we need to assign parameters to (13). Below we write a Scilab script file hmdrv.sce that creates (13) with some fictitious parameter values. Feel free to change them as desired.
Executing the file to yield the linear transfer function . The script also computes the open-loop poles.
// HMDRV.SCE // Dew JUn 16,2014 // modeling of robot joint with DC motor and harmonic drive km = 100; // torque constant kb = 1; // back EMF constant k = 1000; // torsional stiffness of harmonic drive r = 10; // gear ratio L = 0.1 // armature inductance R = 1; // armature resistance Jm = 1; // motor inertia Bm = 0.01; // motor shaft friction Jl = 3; // load inertia Bl = 0.05; // load friction s=poly(0,'s'); pnum = km*k; pl = Jl*s^2+Bl*s+k; pm = Jm*s^2+Bm*s+k; pden = (L*s+R)*pm*pl - k^2*(L*s+R) + r*km*kb*s*pl; P = syslin('c',pnum,pden); disp("P = ") disp(P) [A,B,C,D]=abcd(P); disp("Open-loop poles "); disp(spec(A))
This is a stable plant with an integrator and two pairs of complex conjugate poles, one is under-damped. Observe the Bode frequency response in Figure 2 by issuing the command
-->exec('hmdrv.sce',-1); P = 100000 -------------------------------------------------- 2 3 4 5 1000060s + 4056.0005s + 3400.0801s + 3.008s + 0.3s Open-loop poles 0 - 4.5241679 + 104.88968i - 4.5241679 - 104.88968i - 0.4891654 + 17.383778i - 0.4891654 - 17.383778i
Notice the magnitude peak from the under-damped poles. We will show later how this affected the feedback system.
System Block Diagram
For simulation purpose, it is more convenient to express this electro-mechanical system (13) as a block diagram in Figure 3.
Simple PID Control
To investigate this linear block diagram, we start with PID feedback control schemes. Following the setup in , Figure 5 shows an Xcos model pid_hmdrvsim_mf.zcos, a closed-loop system with motor angle used as feedback to the PID controller. The step-response simulation in Figure 6 is the result from PID gains . Download the model at the bottom of this article (all contained in a zip file) and experiment by yourself to see if you could get a nicer closed-loop response.
It is interesting to note from Figure 6 that, while the motor angle (red) tracks the step command quite nice, the load angle (green) shows oscillatory response that barely dies out. This is reasonable. From the block diagram in Figure 3 or 4 we see that the transfer function from motor angle to load angle is effectively outside the feedback loop. When that under-damped mode is excited, the closed-loop system cannot compensate the undesirable oscillation.
ConclusionIn this article we show how to derive a linear model for robot joint with harmonic drive mechanism. This model may be suitable for basic control system analysis and design. Research control literature exists where more advanced math models of harmonic drive are developed. They may contain nonlinear elements such as hysteresis. Even for this simple linear model, it is shown that the oscillatory mode resulting from flexible coupling in the harmonic drive can be challenging for simple PID control. In upcoming articles, we will craft higher order controllers to improve stability and performance of this motion control system.
Scilab Script and Model Files
The files used this document are
- hmdrv.sce : Scilab script file for parameter initialization and transfer function computation
- pid_hmdrvsim_mf.zcos : Xcos model file for PID with motor angle feedback
- pid_hmdrvsim_lf.zcos : Xcos model file for PID with load angle feedback
- M.W.Spong, S. Hutchinson and M. Vidyasagar, Robot Modeling and Control. John Wiley & Sons. 2006.
- V. Toochinda, Robot Analysis and Control with Scilab and RTSX, Mushin Dynamics, 2014.