Documentation |
Implement stepper motor model
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 have been built with the supposition 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.
For a variable-reluctance stepper motor, the equivalent circuit for one phase is shown in the following figure.
In this model, R_{a} and L_{a}(θ) represent respectively the resistance and the inductance of phase A winding. The winding inductance varies as a function of the rotor position:
L_{a}(θ) = L_{0} + L_{1}cos(N_{r}θ),
where L_{0} is the average inductance, L_{1} is the maximum inductance variation and N_{r} is the rotor teeth number.
Note that at the reference position (θ = 0), the rotor tooth is fully aligned with A-axis pole so that the A-phase winding inductance is then maximum.
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 phase number, i_{x} is the winding current in phase x and L_{x} is the inductance function of phase x winding.
For a permanent-magnet (PM) or hybrid stepper motor, the equivalent circuit for one phase is shown in the following figure.
In this model, R_{a} and L_{a} represent respectively the resistance and inductance of A-phase winding. Due to the large value of the air gap introduced by the magnets, the winding inductance of the permanent-magnet or hybrid stepper motor can be considered to be independent of the rotor position. The voltage source e_{a}(θ) represents the motor back EMF (electromotive force) which is a sinusoidal function of the rotor position:
$${e}_{a}(\theta )=-p{\psi}_{m}\mathrm{sin}(p\theta )\frac{d\theta}{dt},$$
where p is the number of pole pairs and ψ_{m} is the motor maximum magnetic flux.
Note that at the reference position (θ = 0), the North pole on the rotor is fully aligned with A-axis pole so that the A-phase back EMF is then zero.
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} = –pψ_{m}i_{a}sin(pθ) – pψ_{m}i_{b}sin(pθ – π/2) – T_{dm}sin(2pθ).
Select Variable reluctance to implement a variable-reluctance stepper motor.
You can select 3, 4 or 5 phases.
The maximum inductance L_{max} (Henry) of each phase winding.
The minimum inductance L_{min} (Henry) of each phase winding.
The resistance R_{a} (ohm) of each phase winding.
The step angle (degrees) of the rotor movement.
The total inertia momentum J (kg.m^{2}) of the motor and the load.
The total viscous friction coefficient B (N.m.s) of the motor and the load.
The initial rotation speed ω_{0} (rad/s).
The initial rotor position Θ_{0} (degrees).
Select Permanent-magnet/Hybrid to implement a permanent-magnet or hybrid stepper motor.
You can select 2 or 4 phases.
The inductance L_{a} (Henry) of each phase winding.
The resistance R_{a} (ohm) of each phase winding.
The step angle (degrees) of the rotor movement.
The maximum flux linkage ψ_{m} (V.s) produced by the magnets.
The maximum detent torque T_{dm} (N.m) resulting from the saliency of the rotor.
The total inertia momentum J (kg.m^{2}) of the motor and the load.
The total viscous friction coefficient B (N.m.s) of the motor and the load.
The initial rotation speed ω_{0} (rad/s).
The initial rotor position Θ_{0} (degrees).
The mechanical load torque (in N.m). TL is positive in motor operation and negative in generator operation.
The Simulink^{®} output of the block is a vector containing 5 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 the case where the parameters are not available, they can be determined 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 (L_{max}), average inductance (L_{0}), and rotor inertia (J).
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}), and 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 N (rpm) and by measuring the maximum open-circuit winding voltage E_{m} (V).
The parameter ψ_{m} is then computed by the following relation:
ψ_{m} = (30/pπ)(E_{m}/N),
where p is the number of pole pairs given by p = 360 / (2m·step). Here m = phase number, step = step angle in degrees.
The power_steppermotorpower_steppermotor example illustrates the operation of a stepper motor drive using a two-phase hybrid stepper motor model.
The motor phases are fed by two H-bridge MOSFET PWM converters connected to a 28 V DC voltage source. The motor phase currents are independently controlled by two hysteresis-based controllers which generate the MOSFET drive signals by comparing the measured currents with their references. Square-wave current references are generated using the current amplitude and the step frequency parameters specified in the dialog window. The movement of the stepper drive is controlled by the STEP and DIR signals received from external sources.
The following waveforms are obtained from a simulation of 0.25 sec operation of the stepper motor drive during which the stepper rotates during 0.1 sec in the positive direction, stops for 0.05 sec, rotates in the reverse direction for 0.05 sec and stops.
Detailed waveforms are shown in the following figure.