The simulation primitive elements in the library "mech" enable simulation of the devices described in this paper. This library makes use of the basic mechanical components of moment of inertia, friction and stiffness. These components can serve as building blocks for multiple element models of a rotational load, a gearbox and a motor.
The table below shows the relationships between the basic mechanical rotational elements and electrical elements. The units of ounce, inch, radian and second are convenient for comparing results with measurement data. It is also possible to use other convenient sets of units such as metres, radians and seconds, but units that give values of torque and velocity close to unity reduce the possibility of numerical problems in SPICE.
Comparing differential equations for the basic mechanical rotational elements yields the following relationships, where T is torque, w is angular velocity, J is moment of inertia, K is spring stiffness, and B is the coefficient of friction:
Other analogues are possible, but this set gives the best similarity between the mechanical system and the electrical equivalent circuit.
The models in this library of inertia, stiffness, and three types of friction (viscous, coulomb and static) permit simulation of a mechanical network by entering the mechanical parameters and making the interconnections.
Moment of Inertia Equals Capacitance
The above equations state that the electrical analogue of moment of inertia is capacitance. It is unnecessary to create a separate symbol for this, and a capacitor from the SPICE library is adequate. The mechanical equivalent of the electrical ground is the reference point for all motion, which is usually represented by a similar symbol, and is known as mass.
The one important thing to note is that mass and moment of inertia are absolute quantities, and are always referenced to space (unlike friction and stiffness, which can be relative to a platform or some other point of reference, and capacitance, which can be floating). The electrical analogue of moment of inertia must be relative to space - node 0, or ground.
Friction can be linear or nonlinear
Equation 3 describes viscous friction - the simplest type of friction. The electrical analogue of viscous friction is reciprocal resistance.
Although viscous friction is linear, Coulomb and static friction are non- linear. Coulomb friction is a constant retarding torque whose sign changes with the reversal of the direction of the angular velocity (Ref.6). The following equation defines Coulomb friction, FC:
This function can be modelled in SPICE by a comparator or switch with a bipolar dead-band, or hysteresis, whose magnitude is equivalent to the angular velocity value, in rad/sec, during which the Coulomb friction changes sign. When w equals 0, the Coulomb friction equals 0.
During ac analysis, this nonlinearity can cause a problem because the change in Coulomb friction from plus to minus at w equal to 0 causes a low impedance rather than the usual infinite impedance of a constant current source.
When the magnitude of w is less than the limiting angular velocity, the Coulomb friction model will have an impedance equal to (the limiting angular velocity / FC). For ac analysis, you should either bias w so that its magnitude is greater than the limiting angular velocity, or set FC equal to 0.
Static friction, another type of friction, is a retarding torque that tends to prevent motion from beginning. The following equation defines static friction:
The model for static friction is almost exactly the same as for Coulomb friction, the difference being that, whereas Coulomb friction is a constant drag, which merely changes sign with the angular velocity input, static friction is a trapezoidal pulse, which also changes sign with the input.
When the magnitude of w is greater than WS, the static friction is 0. When w equals 0, the model sets static friction to 0.
This non-linearity causes a problem for ac analysis due to low impedance in the regions where the static friction is changing sign, such as it did for the model of Coulomb friction. Thus, for ac analysis you should either bias the magnitude of w greater than WS or set FS equal to 0.
This particular type of nonlinearity also causes problems when SPICE computes a transient solution. Typically WS, the width of the static friction region is very small, for example, 1e-3 rad/sec. When SPICE computes a transient solution, the input voltage could easily skip from -10e-3 rad/sec to 10e-3 rad/sec from one solution to the next. That is, the program might never compute a solution with an input between -1e-3 to 1e-3, thereby skipping over the entire static friction region.
To deal with these nonlinear elements, you need to ensure that the program takes small enough steps and that it catches any torque changes that occur as w passes through 0.
More mechanical analogues
Mass unbalance represents the torque required to hold an unbalanced rotational load stationary against the force of gravity. An equation for the mass unbalance torque when it is only a function of its own axis orientation is:
where A is the angle of the shaft from the horizontal axis.
The following Spice3 netlist defines an unbalanced mass:
The current source GP and capacitor C3 integrate the shaft speed at node 1 to yield the shaft position in radians at node 3. The current source BGMU then gives the mass unbalance torque in oz-in.
Although the mass unbalance torque is generally a complex function of orientation in three-dimensional space, it is typically modelled as a constant torque. Using enhanced versions of SPICE, the model can be made as complex or as simple as required.
The first of our library models is a rotational load ('rotload').
This model includes elements for moment of inertia, viscous damping, Coulomb friction, shaft stiffness, and mass unbalance. A constant torque approximates the mass unbalance, which is a valid approximation if the shaft-angle variations are small.
As may be seen from the drawing, which is generic, it assigns negligible default values to the parameters defined as J, B, KS, BKS, FC, and MU. The generic drawing should be copied to one which will represent the actual component to be used, and then it is a simple matter to change the properties to the actual values.
The external nodes are SHAFTSPEED - the shaft speed in rad/sec relative to space - and BODYSPEED - the platform speed in rad/sec relative to space. Note that the torque delivered to the shaft will not equal the torque returned to the platform because the returns from the moment of inertia and mass unbalance connect directly to space or ground.
The platform connection allows an independent platform velocity input. You might need to use such an input in the case of an airborne application in which the airframe can undergo rapid velocity changes.
This rotational load model contains no Coulomb friction, since the two controlled sources are linear, but these can be replaced by appropriate switching functions to simulate this. If this is done, be sure to set this parameter to zero for ac small-signal analysis, or bias the solution away from the transition regions.
Gear Train Model
The gear train is another mechanical subsystem and is analogous to an electrical transformer. The output torque or current is equal to the input torque times the gear ratio.
The output shaft velocity or voltage is equal to the input shaft velocity divided by the gear ratio.
For an ideal gear train or transformer, the output power equals the input power. The drawing 'gears' includes input and output inertia, friction and stiffness. The voltage-controlled voltage source and current-controlled current source in the centre, whose gain properties are N2/N1, model the ideal portion of the gear.
The remaining elements model inertia, friction and stiffness of the input and output gears. The parameters N1 and N2 are the number of teeth on the input and output gears, respectively, and define the gear ratio, N, which equals N2/N1.
The comments at the top and bottom of the drawing define the parameters.
The external nodes ISHAFTSPEED, OSHAFTSPEED, IBODYSPEED, OBODYSPEED define the connection of the gear train to the system. There are two independent platform connections, IBODYSPEED, OBODYSPEED, allowing for movement between and input platform and an output platform. Generally, you would tie these together to a single platform.
The gear train model is linear, due to the incorporation of linear controlled sources. If these are replaced by switches, then the two Coulomb friction parameters, F1 and F2, should be set to zero for ac small-signal analysis, or the solution should be biased away from the transition region.
This gear train model ignores backlash. However, in some gear trains, backlash is an important parameter. If the amount of backlash is too large, the servo system can oscillate. Backlash occurs when the input and output gears do not mesh, which stops the transmission of power.
Although we do not include a model of a gear train with backlash, the following discussion may assist those intending to design their own.
To derive the equations for backlash, first define the following variables:
N = the gear ratio, N2/N1 HD = backlash halfwidth angle at output gear in radians
When the two gears are in contact, the tangential velocities, v1 and v2 are equal. Thus,
Because R2 = N.R1, it follows that
In order for the two gears to contact, the linear distance travelled by the first gear relative to the second gear starting from the centre position must be
Dividing this entire equation by R1, substituting N.R1 for R2, and using small angle approximation yields the following condition for gear contact in the positive direction:
If contact is to occur in the positive direction, v1 must be greater than v2 prior to contact. If, after contact occurs, v1 falls below v2, the gears will separate until contact is made in the negative direction when the following condition exists:
This equation is the condition for gear contact in the negative direction. If contact is to occur in the negative direction, v1 must be less than v2 just before contact.
By dividing the differential linear velocity dv, which equals v1-v2, by the radius R1, you can derive the differential angular velocity at the input gear as follows:
The differential angle at the input gear is
The differential angle at the output gear is
From equations 1 and 2, the gears mesh when either
Alternately, the gears are in the backlash region when the absolute value of dA(out) is less than HD; that is, when the relative angle of the gears is less than the backlash halfwidth angle.
The Backlash Circuit Switch
To model backlash, a switch must connect the input to the output of the geartrain. In the backlash region, the switch must be an open circuit, disconnecting the input gear from the output gear. When the gears mesh, the switch must act as a short, connecting the input and output gears.
As in all simulations, models should be only as complex as required. If backlash is negligible, then the model 'gears' is perfectly adequate. The backlash model can greatly lengthen the simulation time because fast transients occur whenever the gear hits the backlash region, an event that can occur many times during a simulation. Backlash also causes a problem for ac small-signal anaysis because the backlash condition prevents signals from transmitting through the gear train. For ac analysis, either bias the gear out of the backlash region or use the model provided, which has no backlash.
Servo Motor Model
The servo motor connects the electrical and mechanical parts of a servo system. The motor's input is electrical and its output is mechanical. The dc motor with armature control and the permanent magnet motor are analogous to an electrical transformer. The input's electrical power is equal to the output's mechanical power. The torque is proportional to the armature current, IA, and equals
where KT is the motor's torque constant. The back EMF, EB, produced in the armature circuit is proportional to the motor speed, wM, as follows:
KE is the back EMF constant. For an ideal dc motor,
The drawing 'dcmotor' shows the analogous equivalent circuit for the dc motor.
RA is the armature resistance, and LA is the armature inductance. Additional parameters define the motor inertia. viscous friction, and shaft stiffness. In addition, a tachometer output is provided at node TACH. The armature voltage connects across nodes ARMPOS and ARMNEG. Node SHAFTSPEED represents the motor shaft speed, while Node BODYSPEED represents the motor platform speed.
The model is linear and fairly simple. The models for the dc motor with field control and the ac motor are even simpler, and may be seen in the drawings 'motor' and 'servomotor'.
Note that, although individual parameters are provided for the back EMF constant (KE) and the motor's torque constant (KT), these parameters are not independent, even though they are often specified independently. KE equals KT in the SI system of units (Newton, metre, radian, second), KE = (7.06e-3 * KT).
These relationships come from setting the input electrical power equal to the output mechanical power for an ideal motor. Measurements of KE and KT may differ due to parasitic losses, which are not accounted for.
Servo Loop Model
The following example, which has been embodied into the drawing 'servo', combines these mechanical models with standard electrical components to simulate the innermost loop of the roll axis of a complex airborne antenna-positioning servo system. The power amplifier uses current feedback to control the motor armature current, thereby controlling the motor torque. The demodulator provides a feedback signal from the motor tachometer output, allowing control of the motor shaft speed. The op amp acts as a summer, closing the loop.
Open Loop Characteristics
The components LOL, COL and VOL, along with their assigned values of 1kH, 1kF, and 1V ac, respectively serve to open the loop for ac analysis while maintaining the correct dc operating point.
VOL injects a 1V ac signal through COL, which is a short at ac, while LOL is an open at ac. Under these conditions, and with VIN equal to zero, the voltage at node TACHO equals the loop gain.
To perform meaningful ac analysis, the models must not include step-type nonlinearities or you must bias the circuit outside the non-linear regions. Thus, the power amplifier model has no dead-zone, the gear model is without backlash, and the load is a simple rotational load model.
If we simulate the ac open-loop gain and phase of the tachometer feedback loop, we should find that the open-loop crossover frequency is 9.5Hz, and the phase margin is 90 deg. A notch at 21Hz and peak at 40Hz are due to the gear-stiffness parameter K2 resonating with the load inertia and motor inertia. The gear-shaft damping parameter BK2, determines the Q of this resonance. The values for K2 and BK2 match the measured data. The gain margin for the tachometer loop is 12dB at 190Hz.
Closed Loop Characteristics
You can obtain the ac closed-loop response by setting LOL = 1 nH, COL = 1 pF, VOL = 0V ac, and VIN to 1V ac.
GEARSPEED, the motor shaft speed node, now represents the closed-loop gain. Simulating the closed loop gain and phase of the tachometer loop at the motor shaft at node GEARSPEED, would show that the -3dB bandwidth of the tachometer loop at this node is 10hZ. A notch resulting from the gear-shaft stiffness will be clearly seen at 21Hz.
The closed-loop characteristic measured at node LOADSPEED shows that the response at the load is down 3dB at a cross-over frequency of 30Hz where the phase shift is -120 deg. Note that this response should be a 2-pole roll-off and that the notch at 21Hz should no longer be present. A notch at 300Hz is caused by the high parasitic stiffness, KS = 1G, included in the rotational load model and is of no consequence at such a high frequency.
To test the loop's transient response, the input voltage VIN, defined by the PWL statement, steps from 0 to 10v in 0.1sec, remains steady for 0.1sec, and then steps down to -10v in 0.2sec. It then remains steady for a further 0.2sec before returning to zero (see drawing 'servo').
This input corresponds to commanding the motor speed to go to 1000rad/sec for 0.2sec then to -1000rad/sec for 0.2sec before returning to zero.
If motor speed and load speed response are plotted, it will be seen that there is significant slewing because of the power amplifier's 3.5A current limit.
The load torque will show some ringing because of the gear-shaft stiffness, but the load-speed response will be smooth. These responses must be obtained with no dead zone and no backlash.