Main Content

Implement stepper motor model

Simscape / Electrical / Specialized Power Systems / Fundamental Blocks / Machines

The Stepper Motor (STM) block implements a generic model that represents two most popular families of stepper motors:

Variable-reluctance stepper motors

Permanent-magnet or hybrid stepper motors

The Stepper Motor model consists of electrical and mechanical sections. The electrical section is represented by an equivalent circuit, configuration of which depends on the motor type. The equivalent circuits assume that the magnetic circuit is linear (no saturation) and the mutual inductance between phases is negligible. The mechanical section is represented by a state-space model based on inertia moment and viscous friction coefficient.

This figure shows the equivalent circuit for one phase in a variable-reluctance stepper motor.

In this model, *R _{a}* and

*L _{a}*(

where,

*L*_{0}is the average inductance.*L*_{1}is the maximum inductance variation.*N*is the rotor teeth number._{r}

At the reference position (*θ* = 0), the rotor tooth is fully aligned with
the A-axis pole to achieve the maximum A-phase winding inductance.

The total electromagnetic torque produced by the motor is the sum of the torques produced by the motor phases:

$${T}_{e}={\displaystyle \sum _{x=1}^{m}0.5{i}_{x}^{2}\frac{d{L}_{x}}{d\theta}},$$

where,

*m*is the number of phases.*i*is the winding current in phase_{x}*x*.*L*is the inductance function of phase_{x}*x*winding.

This figure shows the equivalent circuit for one phase in a permanent-magnet (PM) or hybrid stepper motor.

In this model, *R _{a}* and

$${e}_{a}(\theta )=-p{\psi}_{m}\mathrm{sin}(p\theta )\frac{d\theta}{dt},$$

where,

*p*is the number of pole pairs. The number of pole pairs*p*is given by*p*=*Nr*/2.*ψ*is the motor maximum magnetic flux._{m}

Note that at the reference position (*θ* = 0), the north pole on the rotor
is fully aligned with the A-axis pole to achieve zero value of the A-phase back EMF.

The electromagnetic torque produced by a two-phase PM or hybrid stepper motor is equal to the sum of the torque resulting from the interaction of the phase currents and magnetic fluxes created by the magnets and the detent torque, which results from the saliency of the rotor:

*T _{e}* =
–

where,

*m*is the number of phase (*m*=2) of the motor.*Nr*the number of teeth on the rotor (*Nr*= 2**p*).

**Motor type**Select

`Permanent-magnet/Hybrid`

(default) to implement a PM or hybrid stepper motor.**Number of phases**Select

`2`

(default) or`4`

phases.**Winding inductance**Inductance,

*L*, in H, of each phase winding. Default is_{a}`10e-3`

.**Winding resistance**Resistance,

*R*, in ohms, of each phase winding. Default is_{a}`1.2`

.**Step angle**Step angle, in degrees, of the rotor movement. Default is

`30`

.**Maximum flux linkage**Maximum flux linkage,

*ψ*, in V.s, produced by the magnets. Default is_{m}`0.04`

.**Maximum detent torque**Maximum detent torque,

*T*, in N.m, resulting from the saliency of the rotor. Default is_{dm}`0.02`

.**Total inertia**Total inertia momentum,

*J*, in kg.m^{2}, of the motor and the load. Default is`1e-4/5`

.**Total viscous friction coefficient**Total viscous friction coefficient,

*B*, in N.m.s, of the motor and the load. Default is`1e-3`

.**Initial speed**Initial rotation speed,

*ω*, in rad/s. Default is_{0}`0`

.**Initial position**Initial rotor position,

*Θ*, in degrees. Default is_{0}`0`

.**Sample time (-1 for inherited)**Specify the stepper motor sample time, in s. Specify

`–1`

to inherit the sample time of the powergui block in your model. Default is`–1`

.

**Motor type**Select

`Variable reluctance`

to implement a variable-reluctance stepper motor.**Number of phases**Select

`3`

,`4`

, or`5`

phases.**Maximum winding inductance**Maximum inductance,

*L*, in H, of each phase winding. Default is_{max}`10e-3`

.**Minimum winding inductance**Minimum inductance,

*L*, in H, of each phase winding. Default is_{min}`2e-3`

.**Winding resistance**Resistance,

*R*, in ohms, of each phase winding. Default is_{a}`1.2`

.**Step angle**Step angle, in degrees, of the rotor movement. Default is

`30`

.**Total inertia**Total inertia momentum,

*J*, in kg.m^{2}, of the motor and the load. Default is`1e-4/5`

.**Total friction**Total viscous friction coefficient,

*B*, in N.m.s, of the motor and the load. Default is`1e-3`

.**Initial speed**Initial rotation speed,

*ω*, in rad/s. Default is_{0}`0`

.**Initial position**Initial rotor position,

*Θ*, in degrees. Default is_{0}`0`

.**Sample time (-1 for inherited)**Specify the stepper motor sample time, in s. Specify

`–1`

to inherit the sample time of the powergui block in your model. Default is`–1`

.

`TL`

Mechanical load torque, in N.m.

`TL`

is positive in motor operation and negative in generator operation.`m`

The Simulink

^{®}output of the block is a vector containing five signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.Signal

Definition

Units

Symbol

1

Phase voltage

V

V

_{ph}2

Phase current

A

I

_{ph}3

Electromagnetic torque

N.m

T

_{e}4

Rotor speed

rad/s

w

5

Rotor position

rad

Theta

The parameters used in the stepper model are usually obtained from the manufacturer data sheets. In case the parameters are not available, you can determine them from experimental measurements.

The parameters provided by manufacturer data sheets are usually: number of phases, holding
torque, step angle, voltage per phase, current per phase, winding resistance,
*R _{a}*, maximum inductance,

The parameters provided by manufacturer data sheets are usually:

number of phases

holding torque

step angle

voltage per phase

current per phase

winding resistance,

*R*_{a}winding inductance,

*L*_{a}rotor inertia,

*J*

The maximum detent torque, *T _{dm}*, is not always
specified. This parameter can be assumed to be equal to 1-10% of the maximum holding torque.

The maximum flux linkage, *ψ _{m}*, is not always
specified. This parameter can be obtained experimentally by driving the motor to a constant
speed,

The parameter ψ_{m} is then computed by the following relation:

*ψ _{m}* =
(30/

where *p* is the number of pole pairs given by *p* =360 / (2*m*·*step*). Here *m* = phase number, *step* = step
angle in degrees.

The `power_steppermotor`

example illustrates the operation of a stepper motor drive
using a two-phase hybrid stepper motor model.

[1] T. Kenjo, A. Sugawara, *Stepping Motors and Their Microprocessor
Controls*, 2nd Edition, Oxford University Press, Oxford, 2003.

[2] P. Acarnley, *Stepping Motors - A guide to theory and practice*,
4th Edition, The Institution of Electrical Engineers, London, 2002.