© 2013 SPiiPlus Training Class Stepper Control Modes 1
Mar 16, 2016
© 2013
SPiiPlus Training Class
Stepper Control Modes
1
© 2013
Stepper Motors
Stepper motors are electric motors that can provide many benefits to an application including:
o Open loop operation (no position sensor)o Good holding torqueo Relatively inexpensiveo Can act as a cheap DC brushless motor
However, there are several disadvantages that should be considered including:
o Resonances from steppingo Large torque rippleo Always draws current / power (when running in open loop)
2
© 2013
Stepper Motor: Operation
3
© 2013
Stepper Motor: Unipolar vs. Bipolar
4
© 2013
Stepper Motor: MicrosteppingMicrostepping:
o Energize both windings, but with currents 90° out of phase
o Magnet will align according to the ratio of phase A to phase B currents
5
© 2013
Stepper Motor: CommutationCommutation:
o Treats stepper has high pole count DC Brushless
o Difference is that two phases are 180° out of phase
6
© 2013
UDM Wiring
7
UDM
R
S
T
Stepper Motor
© 2013
UDM Limitations
Because the UDM only uses a 6 transistor bridge (as opposed to an 8 transistor bridge), there are a few limitations that should be noted.
o The maximum output voltage is 0.707 * bus voltage
o The effective peak drive current† is 0.707 * peak drive current
† All current limits (XCURI, XCURV and XRMS) are percentages of effective drive peak current
8
© 2013
Important ACSPL+ Variables
When you setup a stepper motor using the Adjuster Wizard, the low level ACSPL+ variables are set automatically. The following is a list of the important variables:
o MFLAGS().2 (#MICRO) ON if running stepper motor in micro-step mode
o MFLAGS().6 (#STEPENC) ON if micro-step mode stepper motor has encoder feedback
o MFLAGS().10 (#PHASE2) ON if the controlled motor has 2 phases
o SLCPRD() In micro-step mode, it defines the number of micro-steps per rev In closed-loop mode, it defines the number of encoder counts per rev
o STEPF() In micro-step mode, it defines the user units per micro-step
o SLCNP() Number of equivalent poles (full steps / 2)
9
© 2013
Operation Mode: Open Loop
In open loop mode, the stepper motor is driven as a normal micro-stepping motor.
o Standard ACSPL+ motion commands (PTP, JOG, etc) are used to command the motion profile
o Standard motion parameters (VEL, ACC, etc) are used to control the motion profile.
The winding current is controlled as follows:o At idle, XCURI defines the amount of currento In motion, XCURV defines the amount of current
In open loop mode, it is possible to lose steps.
10
© 2013
Operation Mode: Open Loop Verification
It is possible to improve the accuracy and repeatability of the stepper motor positioning by using an encoder for verification.
Verification mode:o At idle, if steps are lost, a simple verification servo is used to correct
the positiono In motion, the motor runs as a normal open loop stepper
An ACSPL+ program is necessary to implement the verification.
11
© 2013
Operation Mode: Open Loop Verification
!!! Variable Declarationsglobal real ST_PE ! position errorglobal real ST_OUT ! output of servo loopglobal real ST_KP ! proportional gainglobal real S_LIM ! max correction rateglobal int AXIS! axis number
!!! Variable InitializationAXIS = 4S_LIM = 900 ST_KP = 10ST_OUT = 0ST_PE = 0
!!! Disable to startDISABLE (AXIS)
!!! Reset position errorSET APOS(AXIS) = FPOS(AXIS)SET PE(AXIS) = 0
!!! Toggle default connection bit
MFLAGS(AXIS).17 = 1MFLAGS(AXIS).17 = 0 ! Allow non-default connection
!!! Setup connect functionCONNECT RPOS(AXIS) = APOS(AXIS) + ST_OUTDEPENDS (AXIS),(AXIS)
!!! Enable and run verification programENABLE (AXIS)while 1; block! Calculate position offsetST_PE = APOS(AXIS)-FPOS(AXIS)! Check if commanded motion completeif ((APOS(AXIS)-DAPOS(AXIS)) = 0)! Update correction outputST_OUT=ST_OUT+sat(ST_KP*ST_PE,-S_LIM,S_LIM)*CTIME/(1000/CTIME)endend; endSTOP
! Reset correction output when disabledON ^MST(AXIS).#ENABLED; ST_OUT=0;ret
12
© 2013
Operation Mode: Closed Loop
It is possible to run a stepper motor like a high pole count DC brushless motor under closed loop control.
Closed Loop Mode:o Requires motor commutation†
o Requires normal closed loop tuningo When there is no position error, there is no motor current (i.e. no
holding torque)
Setup and tuning is done using the Adjuster Wizard
† It is required to have adequate commutation resolution. At a minimum, there should be 100 encoder counts per motor pole (10,000 counts per rev for a 200 step motor)
13
© 2013
Stepper Control Mode Example: 1
Use the Adjuster Wizard to setup axis 4 in open loop mode.
When the motor is enabled, try to move it by hand out of position.
14
© 2013
Stepper Control Mode Example: 2
Modify the setup of axis 4 so that it can use encoder feedback for verification.
Use the ‘Programming XX – Stepper Motor Verification.prg’ program to setup the verification correction.
When the motor is enabled, try to move it by hand out of position.
15
© 2013
Stepper Control Mode Example: 3
Use the Adjuster Wizard to setup axis 4 in closed loop mode.
When the motor is enabled, try to move it by hand out of position.
16