You are on page 1of 4

DESIGNfeature

TOM HOPKINS, Director of Engineering

STMicroelectronics

Stepper pp p Motor Controller/Driver Simplifies Stepper Motor System


A stepper motor controller/ driver IC integrates a digital control core which enables a single microcontroller to easily manage several motors, because it only has to issue high-level movement commands to the IC.

A
Driver

OSC1 OSC2

VREG

ADCIN

new controller IC, the L6470 for stepper motors, integrates the power stage along with a digital control core on a monolithic IC. The device can receive motion profile commands across the SPI interface and autonomously execute the complete movement using the programmed acceleration and speed profile. It can also autonomously accelerate the motor up and keep it running at a programmed speed. Fig. 1 shows a block diagram of the device. The Control Logic is a programmable state machine that can receive and store parameters for the acceleration rate, deceleration rate, start speed, run speed, phase current control (PWM) parameters and step mode. Eight step modes, from full step to 1/128 microstepping are supported by the controller. For any selected step mode, the internal absolute position counter counts the number of steps, or microsteps, to continually track the motor position with a resolution equal to the step mode. Rotating a 1.8 degree per step motor one full rotation in 1/128 microstepping would increment (or decrement) the position counter by 25600 counts (128 200 steps). An SPI interface receives all the motion parameters and the movement commands. The commands, like move forward a number of steps, are interpreted by the control logic that controls the output step time and number of steps to accelerate the motor from the starting speed to the running speed and back down to stop while moving the total number of steps commanded. Complex movements can be made by programming queuing up and sending a set of movement commands to be sent across the SPI to the device. CP V
BOOT

Charge pump Clock generator Internal 3V regulator ADC UVLO OUT_A1 VDD A1 A2 Driver OUT_A2 PGNDA VSB OUT_B1 Driver B2 Driver OUT_B2 PGND B Thermal sensing DGND DACs and comparators Current sensing AGND VSA

MOVEMENT AND POSITION COMMANDS


The Digital Core can execute five movement commands and four stop commands included in Table 1. Before any movement is made the operating parameters, Minimum Speed, Maximum Speed, Acceleration Rate, Deceleration Rate, and other operating values are set using the SetParam command across the SPI interface. To insure motion integrity, many of the motion profile settings are locked during a movement

Interface

dSPIN core

Fig. 1. The L6470 is a programmable state machine that can receive and store motion parameters.

24

Power Electronics Technology y | August 2010

www.powerelectronics.com

STEPPERMOTORcontroller

and can only be updated when the motor is stopped. Fig. 2 shows a typical movement profile for the Move command. When the device receives a Move command, it calculates the required profile and executes the profile to accelerate from the minimum speed to the maximum speed and back down to end at a position N steps from the starting
Maximum speed From 15.25 to 15610 steps/s (15.25 steps/s resolution)

Speed

Time Minimum speed From 0 to 976 steps/s (0.24 step/s resolution) Acceleration & Deceleration From 14.55 to 59590 step/s2 (14.55 step/s2 resolution)

Fig. 2. Typical movement profile for the Move command.


Speed (step frequency) SPD3

SPD1 SPD2 Run (SPD2, FW) Minimum speed Maximum speed Run (SPD1, FW) SPD4 Run (SPD3, FW)

position, all under control of the digital core hardware. The GoTo command tells the driver to move the motor to a specific position based on the internal 22-bit absolute position counter. There are two GoTo commands, one that will move in the specified direction and the other that will move in most direct path, determining the direction to move that moves the least number of steps to reach the desired position. For a 1.8 degree per step motor operation at 1/128 microstepping, the resolution of the 22-bit position counter is equivalent to about 164 revolutions of the motor. Even with a significant gear reduction, the usable resolution is still well within the range of the position counter. The movement profile for the GoTo command looks the same as a Move command, but the number of steps is automatically calculated to reach the commanded absolute position. The Run and GoUntil commands are used to run the motor at a constant speed until a stop command (Run) is received or an external event (GoUntil) occurs. When a stop command is received the device either hard stops or decelerates down to a stop, depending on the command. The device can also be commanded to stop, hard or soft, and then tri-state the outputs. Complex movements can be performed using a series of run commands, as shown in Fig. 3. Each time a new run command is received the device will accelerate, or decelerate, the motor to Run (SPD4, BW) the new commanded speed and continue to run at that speed until the next run command or a stop command is received. When a command is received to reverse the direction of movement, the motor is decelerated down to the Time minimum speed and then accelerated up to speed in the opposite direction.

VOLTAGE MODE MICROSTEPPING


Typically, stepper motor drives have been designed to operate in current mode with the current controller sensing and controlling the winding current. This allows designers to maintain the desired torque over a wide range of speed and power supply voltage fluctuations. This works very well for full step and half step drives and is pretty simple to implement. Most designers have avoided doing microstepping drives with voltage mode since the peak current could vary widely due to variations the power supply voltage and the increasing back EMF from the motor as the speed increases.

Fig. 3. Multiple run commands can implement complex movements using a series of run commands.

TABLE 1. MOVEMENT AND STOP COMMANDS


TYPE Move Move Move Move Move Stop Stop Stop Stop COMMAND Run (Direction, Speed) Move (Direction, N_Steps) GoTo (Position) GoTo (Direction, Position) GoUntil (Act, Direction, Speed) SoftStop Hard Stop SoftHiZ HardHiZ OPERATION Accelerates up and runs at speed until stopped. Move in N steps in the defined direction. Moves to the absolute position in most direct path Moves to the absolute position in the defined direction. Accelerate up and run until an external event occurs. Decelerate down to a stop. Stop without decelerating Decelerate down to a stop then turn the bridge off. Stop and turn bridge off

www.powerelectronics.com

August 2010 | Power Electronics Technology

25

STEPPERMOTORcontroller

Without Compensation KVal Speed

With BEMF Compensation KVal Speed

Compensation value FN_SLP_ACC FN_SLP_DEC

ST_SLP Applied Voltage Applied Voltage

INT_SPEED

Speed

Fig. 5. With BEMF compensation, peak current is constant over the entire operation speed range of the deview.
BEMF BEMF

BEMF COMPENSATION
If the same peak voltage is supplied to the motor over the entire speed range, the current would go down as the speed increases since the BEMF of the motor effectively reduces the voltage applied to the coil. The waveforms on the left of Fig. 4 show the operation of the motor without BEMF compensation. As the speed increased, the BEM increases linearly and, since the voltage across the coil is effectively the applied phase voltage minus the BEMF voltage, the current decreases. To compensate for the increase in BEMF, the device includes an additional factor to the KVAL that compensates for the BEMF. Essentially this is a compensation that is added to the initial KVAL setting to offset the BEMF. Since the BEMF is directly proportional to the speed, this compensation factor is given as a slope so that the real time compensation can be calculated from the slope and the current speed. The device has different values for the compensation. The first is the standard value that is applied to the motor starting at zero speed up until the speed reaches a threshold set by the intersect speed parameter, INT_SPEED. Above the intersect speed, the slope can be adjusted by two additional slope terms, one used during constant speed operation and acceleration, and one used during deceleration. When the BEMF compensation is properly set, the peak current will be essentially constant over the entire operation speed range. Fig. 6 shows the actual current waveform for a motor as it accelerates.

Phase Current

Phase Current

Fig. 4. Phase current without BEMF compensation.

However, both of these factors can be compensated for with a digital control. To implement the voltage mode drive, the output pulse width is controlled by a PWM counter/timer circuit that digitally sets the output duty cycle. The L6470 controls the phase current by applying a voltage to motor windings. The phase current amplitude is not directly controlled, but depends on phase voltage amplitude, load torque, motor electrical characteristics and rotation speed. The effective output voltage is proportional to the motor supply voltage multiplied by a coefficient (KVAL). KVAL ranges from 0 to 100% of the supply voltage. In microstepping, this peak value is then multiplied by the modulation index to generate a sine wave with the selected number of steps. The peak voltage value is given by the equation: VOUT = VS KVAL The value for KVAL can be calculated from the formula: KVAL = (Ipk k R)/Vs Where: Ipk k = Desired Peak Current Vs = Typical Power supply Voltage R = Motor winding resistance

POWER SUPPLY AND PHASE RESISTANCE COMPENSATION


Two other major factors that affect the phase current are the motor supply voltage and phase resistance. Since the device operates in voltage mode, controlling the output duty cycle, variations in either will directly affect the

The device includes registers that allow setting different KVAL settings for acceleration, deceleration, running at constant speed and holding position to easily allow different torque settings Fig. 6. With BEMF compensation, the actual current in each part of the motion profile. waveform variation for a motor as it accelerates.

26

Power Electronics Technology y | August 2010

www.powerelectronics.com

STEPPERMOTORcontroller

Compensation algorithm calculates correction coefcient L6470

VS + n(t)

ADC

COMP

PWM + H-Bridge

VOUT

Sinewave Amplitude 5-bit ADC measures actual motor supply voltage Compensation coefcient applies to sinewave amplitude

Fig. 7. The IC includes compensation for power supply variation, which might cause the motor to stall.

phase current. When operating on an unregulated power supply, there may be a significant amount of ripple on the supply voltage to the motor driver circuitry. As the supply voltage varies, the motor current will also vary. If the ripple on the supply voltage is significant, then there is a risk of stalling the

motor if the motor current falls too low. The device compensates for the power supply variation, as shown in Fig. 7. In this circuit, an internal A/D converter measures the power supply voltage, and then the algorithm in the digital core calculates an appropriate compensation factor that is applied to the PWM duty cycle to maintain a constant output voltage over the variations in supply voltage. Variations in the phase resistance as the motor heats also directly affect the phase current. The KTHERM setting is used to compensate for the variation in phase resistance due to the internal heating of the motor. Software in the driving microcontroller can monitor or estimate the motor temperature rise and set the KTHERM value to compensate for the increase in motor resistance due to the temperature increases. The L6470s features allow the designer to implement a voltage mode microstepping drive and compensate for the typical system variations that, in the past, have been overcome using current mode drives. Using the digital based voltage mode PWM, microstepping drives up to 128 microsteps per step can easily be implanted. The sine-wave profile is more accurate and allows higher position resolution than with current mode implementations.

24th International Trade Fair New Munich Trade Fair Centre 0912 November 2010

Register online and enjoy the benets: www.electronica.de/en/tickets

erolpxe
the possibilities of tomorrow.
Automotive e-Mobility Displays / e-Signage Embedded systems / software Medical / MEMS Photovoltaics Time for electronics. Time for the future. Key topics, trends and technologies. The latest components, systems and applications. Visit electronica 2010, the international trade fair that will show you today what is important tomorrow and generate momentum for real growth. Parallel event: hybridica. Trade fair for hybrid-component production. www.hybridica.de

electronica 2010
components | systems | applications
www.electronica.de/en

get the whole picture

www.powerelectronics.com

August 2010 | Power Electronics Technology

27

You might also like