A stepper motor is a brushless DC electric motor that divides every revolution into a number of equal steps. The motor's position can be then commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed.
A typical stepper motor can be used in three modes: full step, half-stepping, and microstepping. The microstep mode allows rotating the rotor on a smaller angle than full step mode, and makes rotation smoother. The SLG47105 IC supports all of these modes.
Stepper motors can be divided into two classes according to the type of winding - bipolar and unipolar steppers.
Unipolar stepper motors have one winding with the center tap per phase. Each section of windings is switched on for each direction of magnetic field. Because in this arrangement a magnetic pole can be reversed without switching the direction of current, the commutation circuit can be made very simple for each winding. Usually, given a phase, the center tap of each winding is made common, giving three leads per phase and six leads for a typical two-phase motor. These two-phase commons are often connected internally, so the motor has only five external leads.
Bipolar stepper motors have a single winding per phase. To reverse a magnetic pole, the current in a winding needs to be reversed. Therefore, the control circuit must be more complicated. There are two leads per phase, and none is common.
Below we described steps needed to understand how the solution has been programmed to design the stepper motor driver. However, if you just want to get the result of programming, download GreenPAK Designer Software to view the already completed GreenPAK Design File. Plug the GreenPAK Development Kit to your computer and hit the program to design the solution.
1. Construction and Operation PrincipleIn this project an example of SLG47105 usage is shown for the bipolar stepper motor. Since current flows across entire coil, bipolar motors have greater torque than in the unipolar motor case. In brief, the SLG47105 is used as a driver for the stepper motor. The MCU controls the driver. In this design example, the driver has two modes: full step and 1/16 step.
The internal design structure can be divided into several parts:
- Step/Microstep block that controls step and microstep modes. In step mode, one pulse on ‘Step’ input corresponds to one step for the stepper motor. In microstep mode 16 pulses on ‘Step’ input correspond to one step for the stepper motor, so one step in this mode is divided to 16 microsteps that increases rotation accuracy;
- Within the SLG47105, a ‘Blanking time’ block determines the PWM frequency and minimum time for HIGH level of PWM.
- Current CMPs, DAC_PWMs, RegFile, and PWM choppers control the current in two windings with the help of external resistors and set the sine current waveform. RegFile holds 16 DAC_PWM period values that correspond to ¼ of sine wave. DAC_PWM block selects the value from RegFile and sets this value as Current CMP reference. When the current is greater than the required value, the PWM chopper will chop output voltage to decrease output current.
- PIN logic and HV GPOs toggle the current sine polarity and rotation direction (depending on ‘Rotary Direction’ input pin state).
The main block diagram is shown in Figure 2.
Typical application circuit requires only two external resistors for current sensing, see Figure 3.
The design has four inputs for motor control:
- PIN#2 Step/Microstep mode – to select the stepper motor operation mode. HIGH signal level = full step operation, LOW signal level = 1/16 step operation.
- PIN#14 Sleep – to disable the driver. HIGH signal level = sleep, LOW signal level = active mode.
- PIN#17 Rotation Direction – to change the direction of motor rotation. HIGH = forward, LOW = reverse.
- PIN#19 Step – motor rotates by one step or 1/16 step every rising edge using this input.
Design Parameters:
- Motor max current: 1 A/Phase
- Motor Voltage: 12 V
- PWM frequency: 125 kHz
Used motor: NEMA17 42HS40-1206.
DLY1 block is used for blanking time generation and determining PWM frequency.
Blanking time signal is generated by DLY1, as shown in Figure 6. The output frequency is 125 kHz (8us). Blanking time (minimum HIGH-level duration) is 0.8us (10% of PWM period).
PWM Chopper function is used to chop PWM Duty Cycle by Current Comparator signal. PWM chopper ignores Current CMP signal during blanking time. Any active signal from Current CMP after Blanking time causes PWM Duty Cycle chopping end the current Period.
In this use case the PWM period is equal to blanking time signal frequency, and PWM duty cycle depends on a signal from Current CMP, but not less than blanking time.
2.2. RegFile UsageThe driver has a 16-byte RegFile, which allows creating an arbitrary current waveform. The driver has 64 values of Vref in the range from 0.032 V to 2.016 V with 0.032 V step, which can be used to fill 16 points of RegFile. They are used for creating a 1/4 of sine, as shown on Figure 8. Another sine part is created by moving through RegFile up and down and by operating with H-Bridge logic, see Figure 9. It is possible to write a half period or full period of the signal, but in this case, the signal will not be so smooth.
Max Vref value for sine depends on the sense resistor value:
Vref_max = IMAX * GAINCCMP * Rsense = 1 A * 8 * 0.11 Ohm = 0.88 V
where:
IMAX – maximum current per motor phase.
GAINCCMP – gain of current CMP. Should be set in GreenPAK designer in CCMP block.
RSENSE – value of external resistor for current measuring.
Four signals are used to generate two shifted sine waves. Two signals (“reg_file_up/down” and inverted) are used to select the direction of moving through RegFile (Up or Down) for each sine wave and another two signals (DFF1 OUT and DFF2 OUT) are used to select the polarity of generated sine wave (positive or negative).
2.3. Changing Rotation DirectionThe direction of rotation depends on what sine wave lags.
ϕ(A) - ϕ(B) = 90 deg
corresponds to clockwise rotation.
ϕ(B) - ϕ(A) = 90 deg
corresponds to counterclockwise rotation.
When the ‘Rotary Direction’ input (GPIO4) level is changed, for example from LOW to HIGH, the sine current phase will be changed by 180 degrees (from -90 to 90 degrees), see Figure 10. If the signal is changed from HIGH to LOW level, the sine current phase on the windings will be changed to -90 degrees.
2.4. Current MeasurementThe signal from the current sense resistor in Figure 11 is connected through 8x gain to the positive input of Current CMP. RegFile Data from DAC_PWM is connected to MUX, which switches one of Vref values (one point of sine) to negative input of Current CMP. When the voltage drop on sense resistor after 8x gain is higher than current Vref value from RegFile, the PWM starts cutting, see Figure 13.
There are two modes used – full step and 1/16 step (microstep). This allows to switch between normal, and precise rotation modes that is useful for Camera Lens and others.
When driving a stepper motor with full step, the output of the stepper motor driver looks like a square signal and produces rough movements, see Figure 15.a. When driving a stepper motor with microstep, the output looks like a sine signal and moves more smoothly, see Figure 15.b.
Figure 15 shows timing diagrams for full step operation, and for 16 microsteps per step operation.
When step mode is selected, “keep” signal of DAC_PWM block is logic HIGH. This does not allow the switching between RegFile Values. LUT4_0 transfers signal from “step” input to DFF0, and each rising edge at “step” input changes the DFF0 out level. DFF0 output is connected to UP/DOWN signal. See Figure 16andFigure 17.
The UP/DOWN signal is not inverted for Winding A and is inverted for Winding B. Rising edge on DFF0 output toggles DFF1, which toggles PWM signal between HV OUTs. If DFF1 OUT is HIGH, then the PWM block output signal is connected to HV OUT1. If DFF1 OUT is LOW, then to HV OUT2. The current in the windings will have a square shape, see Figure 18. The Winding B functions just like Winding A with 90 degrees phase shift.
In full step mode current regulation isn’t used, and when current is higher than 1.2 A, OCP protection will turn off OUTs for a short time. This happens when motor rotation speed is too slow.
If microstep mode is active, the default RegFile address is the 15th Value for DAC_PWM0 and 0th Value for DAC_PWM1. After rising edge at “Step” input, DAC_PWM0 counts up and DAC_PWM1 counts down. CNT2 counts 15 values to reach the bottom position of RegFile for DAC_PWM0, and top position for DAC_PWM1.
DFF0 changes sine output polarity every rising edge at its CLK input.
RegFile adress changes for DAC_PWM0:
15th → 14th → 13th → 12th → 11th →…2th → 1th → 0th → 1th → 2th →…
RegFile adress changes for DAC_PWM1:
0th → 1th → 2th → 3th →…13th → 14th → 15th → 14th → 13th →…
The outputs switch like in full step mode, but 1/4 of a sine wave now has 16 values. The resulting current in windings have a sine wave shape, as shown on Figure 20.
Figure 20 shows a timing diagram for microstep mode.
Decay Mode of HV OUTs can be changed by “Decay” input of HV OUT CRTL0/HV OUT CRTL1 blocks. When this pin is connected to VDD = slow decay mode, when to GND = fast decay. “Decay” input is connected to “reg file up/down” signal. When current increases than is used slow decay, when decrease – fast decay.
The project described how to configure GreenPAK for a bipolar stepper motor controller. In this usage case, motor rotation is controlled using current control for each Coil. Motor torque depends on current going through the motor's coils, and it results in motor rotation with constant torque.
Many parameters are configured. For example, PWM frequency, min PWM duty cycle value, number of control pins, and motor current which can be adjusted for a particular motor with up to 1A current per phase. Also, there is a possibility to add logic to automatically rotate the stepper motor with one or more defined speeds, etc. By integrating the high voltage blocks into GreenPAK, one can see that the design and layout becomes very compact, convenient, reconfigurable, and low cost. Additionally, having extra circuitry still available within GreenPAK allows for additional customization or integrating other functions.
Comments