Engee documentation

Stepper Motor

Permanent magnet stepper motor for full, half and micro steps.

stepper motor

Description

Unit Stepper Motor represents a stepper motor. Stepper motors have a permanent magnet rotor and two stator windings.

Stepper motors with smaller pitch sizes usually have rotors with teeth on the north and south poles. Stepper motors with larger pitch sizes usually have several magnets distributed around the circumference of the rotor. It is possible to model both types of devices with the block Stepper Motor and control the motor with the block Stepper Motor Driver.

You can use stepper motors to avoid the need for position measurement. Stepper motors are used in devices such as printers and in applications such as robotics and factory automation.

The block uses the input pulse sequences and , to control the mechanical output according to these equations:

where

  • and are back EMF induced in phase windings and respectively;

  • and are the currents of phase windings and ;

  • and are the voltages of phase windings and ;

  • - motor torque constant;

  • - number of teeth on each of two rotor poles. The Full step size parameters are ;

  • - winding resistance;

  • - winding inductance;

  • - magnetising resistance;

  • - rotational damping;

  • - inertia;

  • - rotor rotation speed;

  • - rotor rotation angle;

  • - amplitude of the fixation (braking) torque;

  • - electric torque.

If the initial rotor angle is zero or a multiple of , the rotor is aligned with the phase of the winding pulses . This occurs when positive current flows from port A+ to port A- and no current flows from port B+ to port B-.

Use the block Stepper Motor Driver, to create a pulse sequence for the block Stepper Motor.

The stepper motor block creates a positive torque acting from mechanical port C to R when the pulse phase of is ahead of the pulse phase of .

Averaging mode

When the Simulation mode parameters are set to Averaged for both the unit Stepper Motor*block and the block Stepper Motor Driver that controls it, the individual steps will not be simulated. This allows for faster simulation. In the averaged mode, under slip-free conditions, the motor and driver are represented by a second-order linear system that tracks a given step frequency. The target step frequency is determined directly from the voltage at *A+ and A-. So, for example, a voltage of +10 V at terminals A+ and A- is interpreted as a step frequency requirement of 10 steps per second. For more information on how to connect the driver unit to the angle control circuit, see Stepper Motor Driver.

The averaging mode includes a slip estimation sensor to predict whether the stepper motor would slip if operated in step simulation mode. Slippage is predicted if the motor torque exceeds the Vector of maximum torque values parameters by more than one step period, with the step period determined based on the current step frequency requirement. When slippage occurs, the torque generated by the motor is not normally the maximum torque possible: maximum torque is only achieved if the step controller detects slippage and adjusts the step frequency command accordingly.

The dynamics of the second-order equivalent system is determined by the values that are set for the parameters Approximate total load inertia and Maximum step rate command. It is important to set these parameters as accurately as possible so that the step rate command is monitored and the unit does not generate false slip warnings or errors.

If the motor is run in averaging mode with the auxiliary heat ports open (Modelling thermal effects), heat is added to the thermal ports assuming that the windings are always energised, even when the step frequency command is zero. The block makes adjustments for half the pitch and for the reduction in torque (and winding currents) at higher frequencies. For these corrections to be correct, the values of the Vector of maximum torque parameters must be correct. At half step at zero frequency, the heat generated by the unit is equal to the average of the heat generated at half step and full step stops.

To verify the averaged mode model configurations where slip is predicted to occur, compare the results with the same simulation performed in step mode.

Modelling thermal effects

You can open the thermal ports to simulate the effects of energy-to-heat conversion losses.

The unit will display thermal non-directional ports if the Enable thermal port checkbox is selected.

If the block contains thermal ports, the winding resistance is assumed to be linearly dependent on temperature and is defined as follows:

where

  • - resistance at temperature ;

  • - resistance at measurement temperature (or reference temperature) . Specify the reference temperature using the Measurement temperature parameters;

  • - resistance temperature coefficient, which is specified using the Resistance temperature coefficients, [alpha_A alpha_B] parameters. A typical value for copper is 0.00393 1/K.

The block calculates the temperature of each of the windings and the rotor as follows:

where

  • - is the thermal mass. Specify this value for the windings using the Winding thermal masses, [M_A M_B] parameter and for the rotor using the Rotor thermal mass parameter;

  • - temperature. Specify the initial values for the windings using the Winding initial temperatures, [T_A T_B] parameter and for the rotor using the Rotor initial temperature parameter;

  • - heat flux, which is calculated on the basis of iron losses in the windings:

where is the percentage of magnetising resistance associated with the rotor. Specify this percentage using the parameter Percentage of magnetising resistance associated with the rotor.

Assumptions and limitations

The model is based on the following assumptions:

  • This model neglects magnetic saturation effects and any magnetic coupling between phases.

  • To use the averaged mode, the stepper motor block must be directly connected to a stepper motor driver block also operating in the averaged mode.

  • Averaging mode is an approximation, and you should not expect accurate pitch tracking compared to stepper mode.

  • Slip detection in averaged mode is approximate and depends on correct estimation of load inertia and maximum step frequency. Incorrect values can lead to false slip detection.

  • In averaged mode slip modelling, it is assumed that the stepper motor driver adjusts the step frequency command so that the maximum possible torque is achieved.

  • This block cannot be used to model a hybrid stepper motor where torque is generated from both the permanent magnet and variable drag effects.

Ports

Conserving

# R — machine rotor
`rotational mechanics

Details

A mechanical port associated with the rotor of a machine.

Program usage name

rod_flange

# C — machine housing
`rotational mechanics

Details

A mechanical port connected to the body of a machine.

Program usage name

case_flange

# A+ — positive terminal of phase A
electricity

Details

Non-directional port connected to the positive phase terminal .

Program usage name

p_a

# A- — negative terminal of phase A
electricity

Details

Non-directional port associated with the negative phase terminal .

Program usage name

n_a

# B+ — positive terminal of phase B
electricity

Details

Non-directional port connected to the positive phase terminal .

Program usage name

p_b

# B- — negative terminal of phase B
electricity

Details

Non-directional port associated with the negative phase terminal .

Program usage name

n_b

# HA — heat port of phase A
heat

Details

Heat port associated with phase winding .

Dependencies

To use this port, tick the Enable thermal port checkbox.

Program usage name

thermal_port_a

# HB — heat port of phase B
heat

Details

Heat port associated with phase winding .

Dependencies

To use this port, tick the Enable thermal port checkbox.

Program usage name

thermal_port_b

# HR — rotor heat port
heat

Details

Heat port associated with the rotor.

Dependencies

To use this port, select the Enable thermal port checkbox.

Program usage name

thermal_port_rotor

Parameters

Electrical Torque

# Simulation mode — simulation mode
Stepping | Averaged

Details

Use Averaged only if the unit is connected directly to a stepper motor driver unit that also operates in averaged mode.

Values

Stepping | Averaged

Default value

Stepping

Program usage name

simulation_mode

Evaluatable

No

# Vector of rotational speeds — rotor speed
rpm | deg/s | rad/s

Details

The vector of rotational speeds at which the maximum torque values are determined for slip prediction.

Dependencies

To use this parameter, set the Simulation mode parameter to Averaged.

Values

rpm | deg/s | rad/s

Default value

[0.0, 1000.0, 3000.0] rpm

Program usage name

angular_velocity_vector

Evaluatable

Yes

# Vector of maximum torque values — maximum torque
N*m | mN*m | lbf*ft

Details

A vector of maximum torque values used to predict slip using the Vector of rotational speeds parameter. These values are often listed on the data sheet and correspond to the supply voltage and pitch type (half step or full step) specified in the driver.

Dependencies

To use this parameter, set the Simulation mode parameter to `Averaged'.

Values

N*m | mN*m | lbf*ft

Default value

[2.0, 2.0, 1.0] N*m

Program usage name

torque_vector

Evaluatable

Yes

# Approximate total load inertia — total load inertia
g*cm^2 | kg*m^2 | lbm*ft^2 | lbm*in^2 | slug*ft^2 | slug*in^2

Details

Approximate total load inertia including rotor inertia. This value is used to predict slip during sudden accelerations.

Dependencies

To use this parameter, set Simulation mode to Averaged.

Values

g*cm^2 | kg*m^2 | lbm*ft^2 | lbm*in^2 | slug*ft^2 | slug*in^2

Default value

1e-4 kg*m^2

Program usage name

J_total

Evaluatable

Yes

# Maximum step rate command — maximum command frequency
Hz | GHz | MHz | kHz

Details

The maximum command frequency of the stepper system. Used to determine a suitable bandwidth for second-order system approximation for the stepper motor and driver.

Dependencies

To use this parameter, set the Simulation mode parameter to Averaged.

Values

Hz | GHz | MHz | kHz

Default value

10.0 Hz

Program usage name

max_step_rate

Evaluatable

Yes

# Phase winding resistance — phase impedance
Ohm | GOhm | MOhm | kOhm | mOhm

Details

Phase winding resistance and .

Dependencies

To use this parameter, set the Simulation mode parameter to Stepping.

Values

Ohm | GOhm | MOhm | kOhm | mOhm

Default value

0.55 Ohm

Program usage name

R_phase_winding

Evaluatable

Yes

# Phase winding inductance — phase inductance
H | mH | nH | uH

Details

Phase winding inductance and .

Dependencies

To use this parameter, set the Simulation mode parameter to Stepping.

Values

H | mH | nH | uH

Default value

0.0015 H

Program usage name

L_phase_winding

Evaluatable

Yes

# Motor torque constant — electromagnetic torque
Wb | N*m/A | mN*m/A

Details

Constant motor torque.

Dependencies

To use this parameter, set Simulation mode to Stepping.

Values

Wb | N*m/A | mN*m/A

Default value

0.19 N*m/A

Program usage name

torque_constant

Evaluatable

Yes

# Detent torque — torque amplitude
N*m | mN*m | lbf*ft

Details

The amplitude of the sinusoidal change in torque observed when the shaft of a non-running motor is rotating.

Dependencies

To use this parameter, set the Simulation mode parameter to Stepping.

Values

N*m | mN*m | lbf*ft

Default value

0.0 N*m

Program usage name

detent_torque

Evaluatable

Yes

# Magnetizing resistance — phase magnetisation resistance
Ohm | GOhm | MOhm | kOhm | mOhm

Details

The total magnetisation resistance of each of the phase windings. The value must be greater than zero. By default, the value implies no iron losses.

Dependencies

To use this parameter, set the Simulation mode parameter to Stepping.

Values

Ohm | GOhm | MOhm | kOhm | mOhm

Default value

Inf Ohm

Program usage name

R_m

Evaluatable

Yes

# Full step size — step size
deg | rad | rev | mrad

Details

Step size for phase current polarity reversal or .

Values

deg | rad | rev | mrad

Default value

1.8 deg

Program usage name

step

Evaluatable

Yes

Mechanical

# Rotor inertia — rotational inertia
g*cm^2 | kg*m^2 | lbm*ft^2 | lbm*in^2 | slug*ft^2 | slug*in^2

Details

The conservative force counteracting the acceleration of the rotor.

Values

g*cm^2 | kg*m^2 | lbm*ft^2 | lbm*in^2 | slug*ft^2 | slug*in^2

Default value

4.5e-05 kg*m^2

Program usage name

J

Evaluatable

Yes

# Rotor damping — rotational damping
N*m/(rad/s) | ft*lbf/(rad/s)

Details

Dissipative force counteracting the rotational speed of the rotor.

Values

N*m/(rad/s) | ft*lbf/(rad/s)

Default value

0.0008 N*m/(rad/s)

Program usage name

D

Evaluatable

Yes

# Initial rotor angle — initial angle
rpm | deg/s | rad/s

Details

Rotor angle at the beginning of the simulation.

Values

rpm | deg/s | rad/s

Default value

0.0 rpm

Program usage name

angular_position_start

Evaluatable

Yes

# Initial rotor speed — initial speed
deg | rad | rev | mrad

Details

The rotor speed at the beginning of the simulation.

Values

deg | rad | rev | mrad

Default value

0.0 deg

Program usage name

angular_velocity_start

Evaluatable

Yes

Temperature Dependence

# Resistance temperature coefficients, [alpha_A alpha_B] — temperature coefficients
1/K | 1/degR | 1/deltaK | 1/deltadegC | 1/deltadegF | 1/deltadegR

Details

A two-element vector defining the coefficient in the equation relating resistance to temperature, as described in Modelling Thermal Effects. The first element corresponds to the winding , and the second element corresponds to the winding . The value by default corresponds to copper.

Values

1/K | 1/degR | 1/deltaK | 1/deltadegC | 1/deltadegF | 1/deltadegR

Default value

[3.93e-3, 3.93e-3] 1/K

Program usage name

alpha_vector

Evaluatable

Yes

# Measurement temperature — reference temperature
K | degC | degF | degR | deltaK | deltadegC | deltadegF | deltadegR

Details

The temperature for which the motor parameters are determined.

Values

K | degC | degF | degR | deltaK | deltadegC | deltadegF | deltadegR

Default value

25.0 degC

Program usage name

T_measurement

Evaluatable

Yes

# Stepping mode — selecting the step mode in averaging mode
Full stepping | Half stepping

Details

Defines the average stepping mode. When Full stepping is selected, the motor takes a full step in one pulse, when Half stepping is selected, the motor takes a half step in one pulse.

Dependencies

To use this parameter, select the Enable thermal port check box and set the Simulation mode parameter to Averaged.

Values

Full stepping | Half stepping

Default value

Full stepping

Program usage name

stepping_mode

Evaluatable

No

Thermal Port

# Enable thermal port — option to enable thermal ports

Details

Select this checkbox to enable thermal ports.

Default value

false (switched off)

Program usage name

has_thermal_port

Evaluatable

No

# Winding thermal masses, [M_A M_B] — winding thermal masses
J/K | kJ/K

Details

A two-element vector defining the thermal mass for windings and respectively. Thermal mass is the energy required to increase the temperature by one degree.

Dependencies

To use this parameter, select the Enable thermal port checkbox.

Values

J/K | kJ/K

Default value

[100.0, 100.0] J/K

Program usage name

thermal_mass_vector

Evaluatable

Yes

# Winding initial temperatures, [T_A T_B] — initial winding temperatures
K | degC | degF | degR | deltaK | deltadegC | deltadegF | deltadegR

Details

A two-element vector defining the thermal port temperatures for windings and at the start of the simulation.

Dependencies

To use this parameter, select the Enable thermal port checkbox.

Values

K | degC | degF | degR | deltaK | deltadegC | deltadegF | deltadegR

Default value

[25.0, 25.0] degC

Program usage name

T_winding_vector_start

Evaluatable

Yes

# Rotor thermal mass — rotor thermal mass
J/K | kJ/K

Details

Rotor Thermal Mass. Thermal mass is the energy required to raise the temperature by one degree.

Dependencies

To use this parameter, select the Enable thermal port checkbox.

Values

J/K | kJ/K

Default value

50.0 J/K

Program usage name

rotor_thermal_mass

Evaluatable

Yes

# Rotor initial temperature — initial rotor temperature
K | degC | degF | degR | deltaK | deltadegC | deltadegF | deltadegR

Details

Rotor temperature at the beginning of the simulation.

Dependencies

To use this parameter, select the Enable thermal port checkbox.

Values

K | degC | degF | degR | deltaK | deltadegC | deltadegF | deltadegR

Default value

25.0 degC

Program usage name

T_rotor_start

Evaluatable

Yes

# Percentage of magnetizing resistance associated with the rotor — rotor magnetisation in per cent

Details

The percentage of magnetising resistance associated with the magnetic path through the rotor. It determines how much of the heating from iron losses is accounted for by the rotor heat port HR, and the winding heat ports HA and HB.

Dependencies

To use this parameter, select the Enable thermal port checkbox.

Default value

90.0

Program usage name

R_m_percentage_rotor

Evaluatable

Yes

Literature

[1] M. Bodson, J. N. Chiasson, R. T. Novotnak and R. B. Rekowski. "High-Performance Nonlinear Feedback Control of a Permanent Magnet Stepper Motor." IEEE Transactions on Control Systems Technology, Vol. 1, No. 1, March 1993.

[2] P. P. Acarnley. Stepping Motors: A Guide to Modern Theory and Practice. New York: Peregrinus, 1982.

[3] S.E. Lyshevski. Electromechanical Systems, Electric Machines, and Applied Mechatronics. CRC, 1999.