SlideShare a Scribd company logo
Application Report
SLVA488A–October 2011–Revised January 2014
Intelligent Stepper Motor Driver with DRV8811/18/24/25
Jose Quiñones...................................................................................................... Analog Motor Drives
ABSTRACT
This document is provided as a supplement to the DRV8811/18/21/24/25 data sheets. It details a
technique to improve real time control of an internal indexer bipolar stepper motor driver such as the
DRV8811, DRV8818, DRV8821, DRV8824 or DRV8825 while obtaining programmable acceleration and
deceleration profiles, speed control and position control by the utilization of a conventional MSP430
microcontroller and any of the aforementioned power stages.
Contents
1 Introduction and Problem Statement ..................................................................................... 2
2 Stepper Motor Control High Level Functions ............................................................................ 3
2.1 STEP Actuation: Acceleration, Speed Control and Deceleration Profiles .................................. 3
2.2 Accelerating the Motor ............................................................................................ 4
2.3 Stepper Speed ..................................................................................................... 8
2.4 Decelerating the Motor ........................................................................................... 10
2.5 Speed Change .................................................................................................... 10
2.6 Position Control: Number Of Steps ............................................................................ 11
2.7 Homing the Stepper .............................................................................................. 12
3 I2
C Protocol and Communications Engine ............................................................................. 13
3.1 GPIO CONFIG .................................................................................................... 14
3.2 STEPPER CONFIG .............................................................................................. 14
3.3 GPIO OUT ......................................................................................................... 15
3.4 Current Duty Cycle ............................................................................................... 15
3.5 START STEPPER ................................................................................................ 15
4 Application Schematic .................................................................................................... 20
1SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
Digital Signal
Processor or
Microcontroller
Dual H Bridge Power Stage
ENABLE_A
PHASE_A
VREF_A
ENABLE_B
PHASE_B
VREF_B
GPIO
GPIO
DAC
GPIO
GPIO
DAC
L
O
G
I
C
G
L
O
G
I
C
G
OUTA
OUTA
OUTB
OUTB
STEP
DIR
ENABLE
DRV8811
DRV8818
DRV8821
DRV8824
DRV8825
OUTA
OUTB
(A) (B)
USMx
STEP
DIR
ENABLE
USMx
Introduction and Problem Statement www.ti.com
1 Introduction and Problem Statement
Driving a stepper motor can be a daunting task. Whereas, providing a voltage at the terminals of a DC
motor causes immediate rotation, on a stepper motor, careful magnetic field commutation must be applied
in order to obtain the same behavior. In the not so distant past, said electromagnetic commutation was
achieved by coding powerful microprocessors to coordinate the phase and current information
administered into the power stage.
With the advent of high integration on monolithic integrated circuits, it became simpler to take into
hardware all the blocks once generated through code. A stand alone IC could now control even the most
intricate subjects such as phase commutation and microstepping without the need of precious
microcontroller resources.
Figure 1. Stepper Control Logic and Power Stage
Figure 1 shows the level of integration which can be obtained when the code inside of a microcontroller,
and in charge of causing stepper commutation, is concatenated along with the power stage into a single
chip solution. Notice that in both scenarios a series of simple control signals exist. A STEP pulse is used
to generate steps or microsteps; a DIR signal defines the direction of rotation; the ENABLE line
determines whether the power stage is enabled or not; and the User Mode bits are used to select a
degree of microstepping.
Controlling a stepper, however, can still benefit from the usage of a microcontroller. Tasks such as speed
and position control, acceleration and deceleration, homing, etc. still require accuracy and precision which
a microcontroller can easily supply. The question we must ask is: Will the application processing unit be
asked to compute all the parameters related to stepper motion, or will a smaller and more cost economical
microcontroller be used to tackle the tasks at hand?
Using a smaller microcontroller to perform the aforementioned tasks is advantageous if numerous
steppers are to be controlled. In this fashion, the application processor can utilize its real time resources to
properly coordinate application intensive aspects, while the small microcontrollers deal with the intricacies
of controlling the stepper motors.
This application note details an implementation using an MSP430F2132 microcontroller and a
DRV8824/25 device which has an internal indexer bipolar stepper microstepping power stage. Combined,
they form a module capable of receiving commands from a master controller through an I2
C bus, and
which will then undertake all the actions to control the stepper motor both in speed and position. In order
to best utilize the available resources, a series of GPIO terminals were added, which will provide extra
functionality to the main processor. Figure 2 shows a block diagram of the proposed implementation.
2 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
MSP430F2132
DRV8811
DRV8818
DRV8821
DRV8824
DRV8828
STEP
DIR
nENABLE
DA
CL
HOME
GPIO
ADDR0
ADDR1
I2C
nSLEEP
OUTA
OUTB
VREF
www.ti.com Stepper Motor Control High Level Functions
Figure 2. Intelligent Stepper Controller Block Diagram
2 Stepper Motor Control High Level Functions
2.1 STEP Actuation: Acceleration, Speed Control and Deceleration Profiles
Stepper motors offer a means to achieve speed control without the usage of closed loop mechanisms
such as shaft encoders or resolvers. On a microstepping internal indexer driver, this open loop control is
obtained by modulating the frequency at the STEP input. Each pulse at the STEP input, becomes a
mechanical step motion at the stepper motor. Hence, it is safe to say that since we know what frequency
we are applying at the STEP input, we then know the actual step rate the stepper motor is moving at. This
will hold true as long as the right parametric values, such as current, voltage and torque, are maintained
within reasonable levels throughout the application’s operation.
Unfortunately, we cannot just apply any frequency or step rate to any given stepper motor. Due to the
mechanisms behind the revolving magnetic field at the stator and the permanent magnet at the rotor, a
stepper motor can only start moving if the requested speed is smaller than a parameter given by the
motor’s manufacturer and referred to as the starting frequency (denominated FS). For example, if the FS
for a particular stepper motor is 300 steps per second (SPS), it will most likely not be possible to start the
motor at a frequency of 400 SPS.
3SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
Time (s)
MotorSpeed(SPS)
Desired Speed (SPS)
Starting Speed (SPS)
Stopping Speed (SPS)Acceleration Rate (SPSPS)
Deceleration Rate (SPSPS)
Stepper Motor Control High Level Functions www.ti.com
Since the application may require speed rates larger than the FS, it is then very important to subject the
motor commutation through an acceleration profile which starts at a speed rate lower than its maximum
FS and increases speed accordingly until reaching the desired speed.
Figure 3. Typical Stepper Acceleration and Deceleration Profile
Figure 3 shows a typical acceleration and deceleration profile where:
Starting Speed is a STEP frequency lower than the motor’s rated FS at which the motor will start moving.
Measured in steps per second (SPS), where STEPS refers to full steps.
Acceleration Rate is a factor of how much the STEP frequency will be increased on a per second basis.
Measured in steps per second per second (SPSPS).
Desired Speed is the STEP frequency the application requires the motor to move at. It marks the STEP
frequency at which the acceleration profile concludes. Measured in steps per second.
Deceleration Speed is a factor of how much the STEP frequency will be decreased on a per second
basis. Measured in steps per second per second (SPSPS).
Stopping Speed is the STEP frequency at which the deceleration profile and the motor will be stopped. In
this application note, stopping speed is taken to be the same as the starting speed. Measured in steps per
second.
2.2 Accelerating the Motor
The start stepper command starts by issuing steps at a starting frequency denoted by the StartingSpeed
variable. A timer must be used to generate STEP pulses at such frequency. On this application note,
Timer A0.2 was used to set the STEP signal and Timer A0.0 was used to clear the same signal. The
pulse width is 32 clock pulses wide which translates to 2 µs. Since the DRV8825 requires STEP pulses at
least 1-µs wide, this implementation results in a legal pulse generation.
4 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
void AccelTimeCompute(unsigned int AccelDecelRate)
{
if (AccelDecelRate <= 4000)
{
AccelerationTime = 4000/AccelDecelRate;
AccelerationIncrease = 1;
}
else
{
AccelerationTime = 1;
AccelerationIncrease = AccelDecelRate/4000;
}
tmpAccelerationTime = AccelerationTime;
}
Step Frequency’s Period
Pulse Width
Must be larger than 1 us
TA0CCR2Sets
TA0CCR0Clears
TA0CCR2Sets
TA0CCR0Clears
www.ti.com Stepper Motor Control High Level Functions
Figure 4. Timer A0 Used to Generate STEP Pulses
The interrupt subroutine for Timer A0.2 is in charge of programming the Timer A0.0 hardware reset, as
well as programming itself in order to schedule the next step generation.
A second timer function is needed to generate the acceleration portion of the speed control profile. The
microcontroller selected for this application only had two available timers so as will be explained shortly, a
trade off had to be made.
Timer A1.1 was used along with timer A1.0 to generate the PWM output which would be used to generate
an analog to digital converter, by adding an RC filter, to drive the DRV8825’s VREF analog input pin. With
this technique, it is then possible to control stepper current in real time.
Although all timer resources seem to be depleted, there is still an aspect of timer A1 we can utilize. If we
code the PWM generator to count from decimal 0 to decimal 249, we will have 250 time units. At 16 MHz,
each timer unit is equal to 62.5 ns with 250 of them accounting for 15.625 µs. By further dividing this result
by 8, we can get a fairly useful time base of 125 µs, or 4000 timer ticks per second.
What this means is we can increase the stepper speed rate up to 4000 times per second. A simple
mathematical equation can then be used to compute both the acceleration time interval and the
acceleration increment parameter. The code snippet below shows the equations used to compute both
aspects of the acceleration parameter:
Figure 5. Function Computing Time Interval and Acceleration Increase Parameters for Acceleration or
Deceleration Rate
5SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
Init H Bridges and Variables
Timer A0.1 = Start Speed
Start Stepper?
YES
NO
Accel Time
Complete?
YES
Timer A0.1
Count Accel Time Interval
NO
Compute Acceleration Rate
and Acceleration Time
Start Acceleration Engine
Stepper Speed+= Accel
Rate
START
Stepper Speed >=
Desired Speed?
NO
Stepper Speed= Desired Speed
Disable Acceleration Engine
END
Stepper Motor Control High Level Functions www.ti.com
Figure 6 shows the flowchart of the state machine in charge of coordinating the acceleration. As can be
seen, the command to start the motor will configure all the parameters required for motion, including the
call to the AccelTimeCompute function.
Figure 6. Stepper Speed Acceleration Flowchart
The actual speed modification takes place inside the AccelDecel function which gets called from within the
main execution which is in turn enabled within the timer A1.0 interrupt service routine (ISR). It is important
for the AccelDecel function not to be called from within inside the ISR as this impacts real time operation.
Instead, inside the ISR the microcontroller sleep mode is disabled, which allows execution to resume from
the main loop.
6 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
#pragma vector=TIMER1_A0_VECTOR
__interrupt void Timer1_A0(void)
{
TimerA0Count += 1;
if (TimerA0Count == ATBCount)
{
TimerA0Count = 0;
if (tmpAccelerationTime == 0)
{
tmpAccelerationTime = AccelerationTime;
_BIC_SR_IRQ(CPUOFF); // Clear LPM0 - jumps to AccelDecel();
}
tmpAccelerationTime -= 1;
}
}
int main()
{
//ALL INITIALIZATION OCCURS HERE
__bis_SR_register(GIE); // Enable all Interrupts
while (1)
{
_BIS_SR(CPUOFF); // Enter LPM0
AccelDecel();
}
}
www.ti.com Stepper Motor Control High Level Functions
Figure 7. Main Function Calls the AccelDecel Code Whenever Code Inside of an ISR Removes the Micro
from Sleep Mode
Figure 8. Timer A1.0 ISR Disables Sleep Mode Once an Acceleration Tick is to be Executed
7SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
void AccelDecel(void)
{
switch (AccelerationState)
{
case (NOACC):
break;
case (ACCEL):
ActualStepperSpeed += AccelerationIncrease;
if (ActualStepperSpeed >= DesiredStepperSpeed)
{
ActualStepperSpeed = DesiredStepperSpeed;
AccelerationState = NOACC;
TA1CCTL0 &= ~CCIE; //DISABLE 250 us coordinator interrupt on TA1.0
}
SpeedCompute(ActualStepperSpeed);
break;
case (DECEL):
ActualStepperSpeed -= AccelerationIncrease;
if (ActualStepperSpeed <= DesiredStepperSpeed)
{
ActualStepperSpeed = DesiredStepperSpeed;
AccelerationState = NOACC;
TA1CCTL0 &= ~CCIE; //DISABLE 250 us coordinator interrupt on TA1.0
}
SpeedCompute(ActualStepperSpeed);
break;
case (STOP):
ActualStepperSpeed -= AccelerationIncrease;
if (ActualStepperSpeed <= StartStepperSpeed)
{
ActualStepperSpeed = StartStepperSpeed;
AccelerationState = NOACC;
TA1CCTL0 &= ~CCIE; //DISABLE 250 us coordinator interrupt on TA1.0
ExecutedSteps = NumberOfSteps - 1;
}
SpeedCompute(ActualStepperSpeed);
break;
}
}
Stepper Motor Control High Level Functions www.ti.com
Figure 9. AccelDecel Function is State Machine Code in Charge of Modifying Stepper Speed According to
Programmed Acceleration or Deceleration Profile
2.3 Stepper Speed
Stepper speed is carefully controlled by using Timer A1.0 and A1.2 as detailed previously. How the timer
is being clocked is important to understand, as the 16- bit timer by itself is not capable of reproducing all
the possible speeds applications around this topology may try to run at. For example, while the Timer A1
is being clocked at 16 MHz, fast stepping rates are easily obtained, while slow speeds cannot be
generated.
8 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
bool SpeedCompute(unsigned int MotorSpeedInHz)
{
if (MotorSpeedInHz < 31 )
{
return false;
}
else if (MotorSpeedInHz < 61 )
{
ClockConfigure(8);
StepperSpeedTMR = 2000000 / MotorSpeedInHz;
return true;
}
else if (MotorSpeedInHz < 123)
{
ClockConfigure(4);
StepperSpeedTMR = 4000000 / MotorSpeedInHz;
return true;
}
else if (MotorSpeedInHz < 245)
{
ClockConfigure(2);
StepperSpeedTMR = 8000000 / MotorSpeedInHz;
return true;
}
else
{
ClockConfigure(1);
StepperSpeedTMR = 16000000 / MotorSpeedInHz;
return true;
}
}
www.ti.com Stepper Motor Control High Level Functions
As a result, it is imperative to modulate the clock speed by subdividing it. Luckily Timer A has a series of
dividing factors which allow the timer clocking speed to be subdivided from 16 MHz down to as slow as 2
MHz.
The equation to compute how many clock cycles are needed to reproduce a particular stepping rate is:
# Clock Cycles = TIMER CLOCK FREQUENCY / STEP_RATE in Hz (1)
A quick analysis on the results provided by the previous equation showed the stepping rate segregations
on a per clock cycle count basis. If for a given timer clock frequency the resulting number of clock cycles
was larger than 65535 then a further subdivision factor would be needed to reduce the clock count from
saturating the timer register.
The function SpeedCompute is in charge of transforming a stepping rate in Hz into clock count.
Depending on the speed, the timing source for Timer A1 is sub divided to slow down its incremental rate.
If the requested stepping rate is less than 31, the function returns false in which case no rate is generated.
Although it may be desirable to obtain stepping rates lower than 31 full steps, this can still be achieved by
utilizing a faster speed and configuring the DRV8824/25 device to operate in 32 degrees of microstepping.
For example, if the programmed DesiredSpeed is 32 SPS, and the DRV8824/25 is configured to operate
in 32 degrees of microstepping, the stepper will move 1 full step per second.
Figure 10. SpeedCompute Transform the Stepping Rate in Hz into a Clock Count Timer A1.1 - Can Use to
Generate Accurate Timing Information
9SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
void ClockConfigure(char Divider)
{
int tempTA0CTL;
tempTA0CTL = TA0CTL;
switch (Divider)
{
case 1:
tempTA0CTL &= ~( BIT7 + BIT6);
break;
case 2:
tempTA0CTL &= ~( BIT7 + BIT6);
tempTA0CTL |= TA0_ID_DIV2;
break;
case 4:
tempTA0CTL &= ~( BIT7 + BIT6);
tempTA0CTL |= TA0_ID_DIV4;
break;
case 8:
tempTA0CTL &= ~( BIT7 + BIT6);
tempTA0CTL |= TA0_ID_DIV8;
break;
}
TA0CTL = tempTA0CTL;
}
Stepper Motor Control High Level Functions www.ti.com
Figure 11. Function ClockConfigure is Called Within the SpeedCompute Function to Modify the Divider
Affecting Timer A1 Clock Speed
The functions SpeedCompute and ClockConfigure are called to set the StartSpeed, to set the new stepper
speed on a per acceleration click occurrence and then when the DesiredSpeed is met. Once the
programmed DesiredSpeed target is reached the stepper motor maintains said speed until a deceleration
profile is commanded.
2.4 Decelerating the Motor
The concept of a deceleration profile the motor is virtually identical to the acceleration profile
implementation except that instead of increasing stepper speed, speed is decreased.
There are two instances in which a deceleration profile may be employed: during SpeedUpdate or during
StepperStop commands. In this implementation, the stepper deceleration profile is finished either when
the start speed is reached or when the programmed number of steps is executed.
Also, it was chosen for the deceleration rate to hold a different memory location such that a non symmetric
acceleration/deceleration profile, such as the one portrayed in Figure 3, could be employed.
The SpeedCompute and ClockConfigure are used in the same fashion as they were used during the
acceleration portion of the motion control profile. However, the state machine, or the AccelDecel function,
is configured to execute the DECEL portion of code.
2.5 Speed Change
During run time, it is possible to change the speed and incur in further acceleration or deceleration as
deemed by the application. When the command SpeedUpdate is issued, the firmware checks to see
whether the new DesiredSpeed is larger or smaller than the ActualStepperSpeed. The result of this
operation configures the Acceleration Deceleration engine accordingly.
10 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
www.ti.com Stepper Motor Control High Level Functions
2.6 Position Control: Number Of Steps
The closed loop capabilities of a stepper are not limited to accurately controlling the speed. Since in
essence the controller is counting the very same steps which are being generated, knowledge of step
position is continuously being updated. Every time a step is executed, the variable StepPosition is updated
according to step rotation direction. For example, if the motor is rotating clockwise (DIR = HI), the
StepPosition variable is incremented, whereas if the motor is rotating counterclockwise (DIR = LO), then
the StepPosition variable is decremented.
NOTE: The notions of motor rotation as clockwise or counterclockwise are directly dependent to
how the motor was wired and the motor itself.
The variable StepPosition can be read in real time to obtain information as to where the motor is at any
given point in time.
On this application note, however, the controller is always operating in Position Control mode. The
variable NumberOfSteps is programmed to hold the entire number of steps which will be executed. Since
this is a 32-bit variable, the total number of steps could be a significantly large number, in which case the
motor would in essence be operating in free running mode. However, if the NumberOfSteps count is
small, then the motor will stop once the total NumbeOfSteps have been executed.
The previous mechanism is achieved by counting how many steps have been executed and comparing
this number to the NumberOfSteps command. This is taken care of on the Timer A0.2 ISR as shown in
Figure 12.
Notice this ISR is in charge of a few tasks we have described earlier and which are of crucial importance
to generating accurate stepping information. These tasks are:
1. Generation of the STEP pulse by configuring when the STEP clear takes place. Timer A0.0 is in
charge of returning the STEP signal to LO.
2. Configuring the TIMERA0.2 to generate the next step according to the current step rate, or
StepperSpeedTMR, which is the timer equivalent of the current rate in Hz.
3. Determining whether the current generated step is the last step to execute. This happens when
ExecutedSteps is equal to NumberOfSteps.
4. If the current generated step is equal to StepsToStop value, then the engine is commanded to start a
deceleration profile.
5. Update StepPosition according to motor direction.
11SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
#pragma vector=TIMER0_A1_VECTOR
__interrupt void Timer0_A1(void)
{
switch (TA0IV)
{
case TA0CCR1_CCIFG_SET:
break;
case TA0CCR2_CCIFG_SET:
TA0CCR0 = TA0CCR2 + StepPulseWidth; //2 us at 16 MHz
TA0CCR2 += StepperSpeedTMR;
ExecutedSteps += 1;
if (ExecutedSteps == NumberOfSteps)
{
TA0CCTL2 &= ~(CCIE + BIT5 + BIT6 + BIT7); //Disable Pulse Generation
}
else if (ExecutedSteps == StepsToStop)
{
AccelTimeCompute(DecelerationRate);
AccelerationState = STOP;
TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0
}
if (P3IN && DIR)
{
StepPosition += 1;
}
else
{
StepPosition -=1;
}
ReadTable[0] = (StepPosition & 0xFF00) >> 8;
ReadTable[1] = StepPosition & 0xFF;
break;
case TA0IFG_SET:
break;
}
}
Stepper Motor Control High Level Functions www.ti.com
Figure 12. Timer A0.2 ISR
2.7 Homing the Stepper
The concept of preserving stepper position is in essence flawed if we do not know the system’s start
position. This is true for any motor system in which the closed loop feedback is relative, versus absolute.
As a result, it is important we start counting our steps from a known position. Said position is often
referred to as HOME.
The application note incorporates a HOME sensor input which is flexible enough to accommodate both
sensor polarities (e.g. asserted HI or asserted LO). A typical HOME sensor implementation is to have an
optical sensor and a flag at the stepper motor shaft. When the flag meets the optical sensor slit, then the
stepper motor stops and this position is from now on referred to as HOME. Internally, the controller clears
the StepPosition variable.
12 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
#pragma vector=PORT1_VECTOR
__interrupt void PORT1_Change(void)
{
if (P1IFG && HOMEIN)
{
P1IE = 0;
P1IFG = 0;
TA0CCTL2 &= ~(CCIE + BIT5 + BIT6 + BIT7);
StepPosition = 0;
}
}
www.ti.com I2
C Protocol and Communications Engine
Since the motor can be started at any given position, the HOME sensor could be found to be at either
state. Hence, initially, the state is to be considered unknown. The typical homing implementation calls for
a transition from HI to LO or a transition from LO to HI as chosen by the application.
In order to easily capture the chosen transition, the HOME sensor was allocated to a GPIO pin with a Pin
On Change Interrupt. Since the pin can be configured to raise the ISR flag either with a rising or a falling
edge, we can capture on either edge. Whereas the typical polling function would require some sort of a
state machine to filter out the wrong transition, this hardware interrupt works exceptionally well, rendering
the amount of code to be considerably tiny.Figure 13 shows the ISR for the PORT1 Pin On Change
Interrupt vector. The reader will notice this code is in charge of clearing the StepPosition variable, as well
as stopping the motor.
Figure 13. Port 1 Pin On Change Interrupt Service Routine
3 I2
C Protocol and Communications Engine
In order to program the device parameters and the stepper motion engine profiles, an I2
C protocol was
chosen. The way it was designed, up to four controllers can be cascaded with only two communication
lines and two address selector lines.
The I2
C protocol is the typical three byte packet where the first byte is the slave address, the second byte
is the register address and the third byte is the data. There are 21 possible address register which can be
accessed.
13SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
N/A
Bit 7 Bit 0
ENABLE MODE2 MODE1 MODE0 N/A N/A DIR
GPIO DIR 7
Bit 7 Bit 0
GPIO DIR 6 GPIO DIR 5 GPIO DIR 4 GPIO DIR 3 GPIO DIR 2 GPIO DIR 1 GPIO DIR 0
Number Of Steps
Number Of Steps
Number Of Steps1
Number Of Steps0
StepsToStop
StepsToStop
StepsToStop1
StepsToStop0
StartSpeed1
StartSpeed0
Accel1
Accel0
DesiredSpeed1
DesiredSpeed0
Decel1
Decel0
GPIO CONFIG
Stepper Config
GPIO OUT
Current Duty Cycle
Start Stepper
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0x08
0x09
0x0A
0x0B
0x0C
0x0D
0x0E
0x0F
0x10
0x11
0x12
0x13
0x14
Index PARAMETER TABLE
I2
C Protocol and Communications Engine www.ti.com
Figure 14. Parameters Table
The variables residing on addresses 0x00 to 0x0F have been discussed on previous sections. The other
addresses are a combination of parameters as well as actions.
3.1 GPIO CONFIG
Defines the GPIO direction, for the 8 GPIO pins 0 to 7, where a configuration of 0 denotes an input and a
configuration of 1 denotes an output.
3.2 STEPPER CONFIG
Configures control signals for the stepper power stage. These register bits are directly mapped to the
Power Stage hardware pins, so changing the state of any of these bits immediately changes the
respective pin at the power stage input.
14 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
START ACCEL
START STEPPER
STOP STEPPER
CHANGE SPEED
HOME HI
HOME LO
0x00
0x01
0x02
0x03
0x04
0x05
OPCODE START STEPPER
GPIO 7
Bit 7 Bit 0
GPIO 6 GPIO 5 GPIO 4 GPIO 3 GPIO 2 GPIO 1 GPIO 0
www.ti.com I2
C Protocol and Communications Engine
3.3 GPIO OUT
Those GPIO bits which were configured as outputs are configured when writing to this address. Note that
writing to this address is equivalent to writing to the MSP430 PxOUT register so only bits which are
configured to be outputs on their respective PxDIR register, will react accordingly. Those pins which are
configured as inputs will still behave as inputs.
3.4 Current Duty Cycle
A register accepting a number from 0 to 249 which then becomes PWM output duty cycle. The current
code does not check whether the written is equal or less than 249. Any number larger than 249 will yield a
100% duty cycle PWM.
3.5 START STEPPER
This address is more a command than an actual register. A switch case statement decodes the data byte
and an action is executed. Possible actions are:
Where:
START ACCEL starts the stepper motor through at the StartSpeed and ramps up until reaching
DesiredSpeed. If no other command is received, motor stops once the NumberOfSteps have been
executed.
START STEPPER starts the stepper at the StartSpeed. No acceleration occurs. If no other command
is received, motor stops once the NumberOfSteps have been executed.
STOP STEPPER stops the stepper while ramping down through the deceleration profile. Motor stops
as soon as the StartSpeed is reached or the NumberOfSteps have been executed.
CHANGE SPEED accelerates or decelerates the stepper depending on whether the actual speed is
larger or lesser than the new DesiredSpeed. For this command to work, a new DesiredSpeed must be
written while the motor is running.
HOME HI starts the motor at the StartSpeed and runs until a transition to HI is observed on the HOME
sensor input, or when the NumberOfSteps have been executed.
HOME LO starts the motor at the StartSpeed and runs until a transition to LO is observed on the
HOME sensor input, or when the NumberOfSteps have been executed.
The Start Stepper command will configure the stepping engine parameters such as NumberOfSteps,
StepsToStop, StartStepperSpeed, DesiredStepperSpeed, AccelerationRate and DecelerationRate. It will
then decode the action parameter and start the stepper motor according to the received command. The
I2
C communications are handled by the USCI RX and TX vector interrupts.
15SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
#pragma vector=USCIAB0TX_VECTOR //UCA_TRANSMIT on UART/SPI;
UCB_RECEIVE, UCB_TRANSMIT on I2C
__interrupt void USCI_AB0_Transmit(void)
{
if (UCB0CTL1 & UCTR)
{
UCB0CTL1 &= ~UCTR;
IFG2 &= ~UCB0TXIFG;
}
else
{
SerialBuffer[SerialPointer] = UCB0RXBUF;
SerialPointer += 1;
if (SerialPointer == SERIAL_BUFFER_LENGTH)
{
SerialPointer = 0;
ParametersTable[ADDRESS] = PARAMETER;
switch(ADDRESS)
{
case GPIO_CONFIG:
char tempOut;
P1DIR = PARAMETER & 0xC0; //Use 2 MSB's to configure the
GPIO Direction on pins P1.7 and P1.6
P2DIR = PARAMETER & 0x3F; //Use 6 LSB's to configure the
GPIO direction on pins P2.0 to P2.5
case STEPPER_CONFIG_ADDR:
tempOut = P3OUT;
tempOut &= ~(nENABLE + MODE0 + MODE1 + MODE2 + DIR);
tempOut |= PARAMETER;
P3OUT = tempOut; break;
case GPIO_OUT_ADDR:
P2OUT = PARAMETER;
tempOut = P1OUT;
tempOut &= ~(BIT7 + BIT6);
tempOut |= (PARAMETER & 0xC0);
P1OUT = tempOut;
break;
case CURRENT_DC_ADDR:
TA1CCR1 = PARAMETER;
break;
I2
C Protocol and Communications Engine www.ti.com
16 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
case START_STEPPER_ADDR:
NumberOfSteps = (ParametersTable[NUMBER_OF_STEPS3_ADDR] << 8) +
(ParametersTable[NUMBER_OF_STEPS2_ADDR]);
NumberOfSteps *= 65536;
NumberOfSteps += (ParametersTable[NUMBER_OF_STEPS1_ADDR] << 8) +
ParametersTable[NUMBER_OF_STEPS0_ADDR];
ExecutedSteps = 0;
StepsToStop = (ParametersTable[STEPS_TO_STOP3_ADDR] << 8) +
(ParametersTable[STEPS_TO_STOP2_ADDR]);
StepsToStop *= 65536;
StepsToStop += (ParametersTable[STEPS_TO_STOP1_ADDR] << 8) +
ParametersTable[STEPS_TO_STOP0_ADDR];
StartStepperSpeed = (ParametersTable[START_SPEED1_ADDR] << 8) +
ParametersTable[START_SPEED0_ADDR];
DesiredStepperSpeed = (ParametersTable[DESIRED_SPEED1_ADDR] << 8) +
ParametersTable[DESIRED_SPEED0_ADDR];
AccelerationRate = (ParametersTable[ACCEL1_ADDR] << 8) +
ParametersTable[ACCEL0_ADDR];
DecelerationRate = (ParametersTable[DECEL1_ADDR] << 8) +
ParametersTable[DECEL0_ADDR];
www.ti.com I2
C Protocol and Communications Engine
17SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
switch (PARAMETER)
{
case START_ACCEL: // Start stepper motor at Start speed and until
reaching desired speed
AccelerationState = ACCEL;
ActualStepperSpeed = StartStepperSpeed;
AccelTimeCompute(AccelerationRate);
TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0
//WDTCTL = 0x5A00 + WDTTMSEL + WDTSSEL + BIT1 + BIT0;
break;
case START_STEPPER: // Start stepper motor at start speed. Run at this
rate.
AccelerationState = NOACC;
ActualStepperSpeed = StartStepperSpeed;
break;
case STOP_STEPPER: // Stop motor from current speed, through a
deceleration profile and until reaching Start Speed. Then stop and disable stepping
engine
AccelTimeCompute(DecelerationRate);
AccelerationState = STOP;
TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0
break;
case CHANGE_SPEED: // Modify current speed up or down to Desired
Speed.
if (DesiredStepperSpeed >= ActualStepperSpeed)
{
AccelTimeCompute(AccelerationRate);
AccelerationState = ACCEL;
TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0
}
else
{
AccelTimeCompute(DecelerationRate);
AccelerationState = DECEL;
TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0
//WDTCTL = 0x5A00 + WDTTMSEL + WDTSSEL + BIT1 + BIT0;
}
break;
I2
C Protocol and Communications Engine www.ti.com
18 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
case HOME_HI: // Move Stepper at Start Speed until the Home
Sensor becomes HI. Go through LO if already at HI
AccelerationState = NOACC;
ActualStepperSpeed = StartStepperSpeed;
P1IFG &= ~HOMEIN;
P1IES |= HOMEIN;
P1IE |= HOMEIN;
break;
case HOME_LO: // Move Stepper at Start Speed until the Home
Sensor becomes LO. Go through HI if already at LO
AccelerationState = NOACC;
ActualStepperSpeed = StartStepperSpeed;
P1IFG &= ~HOMEIN;
P1IES &= ~HOMEIN;
P1IE |= HOMEIN;
break;
}
if (SpeedCompute(ActualStepperSpeed))
{
P3OUT &= ~(nENABLE);
P1OUT |= NSLEEP;
TA0CCR2 += StepperSpeedTMR;
TA0CCR0 = TACCR2 + StepPulseWidth; //2 us at 16 MHz
TA0CCTL2 &= ~CCIFG;
TA0CCTL2 |= (CCIE + TA0_OUTMOD2_CONF);
}
break;
}
}
}
}
www.ti.com I2
C Protocol and Communications Engine
19SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
Application Schematic www.ti.com
4 Application Schematic
The following page contains the MSP430 and DRV8811/18/24/25 combo board schematic.
20 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
1
1
2
2
3
3
4
4
5
5
6
6
D D
C C
B B
A A
1 2
3 4
5 6
7 8
9 10
11 12
13 14
J1
JTAG
GND
V3p3
SBWTCK
V3p3
GND
0.1uF
C1
nSLEEP
STEP
1
TP1
VM
VM
1
TP2
GND
GND
1
TP3
V3P3
0.1uFC5
1
2
3
4
J5
Stepper
AOUT1
AOUT2
C3 0.01uF CP1
CP2
0.1uFC6
VCP
0.1uFC4
VM
AOUT1
AOUT2
ISENA
DECAY
nFAULT
nSLEEP
V3P3OUT
BOUT1
BOUT2
ISENB DIR
nENABLE
STEP
MD0
MD1
MD2
.47uFC7
1
2
J2
VM
1
2
3
4
J4
Stepper
AOUT1
AOUT2
3.3KR7
.2R6
.2R5
100uF
C2
3.3K
R1
D1
VM
VM
BOUT1
BOUT2
BOUT1
BOUT2
GND
0
OUT
1
FB
2
NC
3
GND
4
EN
5
NC
6
NC
7
IN
8
U3
TPS79801
10uF
C9
VM
61.9K
R11
39K
R12
V3p3
TST/SBW
1
DVCC
2
P2.5
3
DVSS
4
P2.7/XOUT
5
P2.6/XIN
6
RST
7
P2.0
8
P2.1
9
P2.2
10
P3.0
11
P3.1
12
P3.2
13
P3.3
14
P3.4/TX
15
P3.5/RX
16
P3.6/TA1.0
17
P3.7/TA1.1
18
P2.3
19
P2.4
20
P1.0/TACLK
21
P1.1/TA0.0
22
P1.2/TA0.1
23
P1.3/TA0.2
24
P1.4/TCK
25
P1.5/TMS
26
P1.6TCLK
27
P1.7/TDI
28
U1
MSP430F2132
CP1
1
CP2
2
VCP
3
VMA
4
AOUT1
5
ISENA
6
AOUT2
7
BOUT2
8
ISENB
9
BOUT1
10
VMB
11
VREF
12
VREF
13
GND
14
V3P3OUT
15
nRESET
16
nSLEEP
17
nFAULT
18
DECAY
19
DIR
20
nENABLE
21
STEP
22
NC
23
MODE0
24
MODE1
25
MODE2
26
nHOME
27
GND
28
GND
0
U2
DRV8825
MD0 MD1
MD2
GPIO0
GPIO1
GPIO2 GPIO3
GPIO4
GPIO5
DIR
SDA
SCL
VREF_PWM
nENABLE
HOME
SBW_TDOI
SBWTCK
SBW_TDOI
GPIO7
GPIO6
330
R2
V3p3
V3p3
1
2
J6
I2C
SDA
SCL
1
2
3
4
5
6
7
8
9
10
J9
GPIO
V3p3
GPIO0
GPIO1
GPIO2
GPIO3
GPIO4
GPIO5
GPIO6
GPIO7
VREF_PWM
0.01uF
C8
5.1KR8
3.3KR3
1
2
3
J3
HOME
V3p3
HOME
ADR0
ADR1
12
Y1
1
2
JMP1
ADR0
ADR0 ADR1
3.3K
R9
V3p3
1
2
JMP2
ADR0
3.3K
R10
V3p3
3.3KR4
nFAULT
TL1
DRV8825Combo
3.3K
R13
www.ti.com Application Schematic
21SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25
Submit Documentation Feedback
Copyright © 2011–2014, Texas Instruments Incorporated
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other
changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest
issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of sale
supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary
to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily
performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information
published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or
endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration
and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered
documentation. Information of third parties may be subject to additional restrictions.
Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service
voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.
TI is not responsible or liable for any such statements.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which
anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause
harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use
of any TI components in safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed a special agreement specifically governing such use.
Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components
which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and
regulatory requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.
Products Applications
Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive
Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications
Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers
DLP® Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps
DSP dsp.ti.com Energy and Lighting www.ti.com/energy
Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial
Interface interface.ti.com Medical www.ti.com/medical
Logic logic.ti.com Security www.ti.com/security
Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense
Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video
RFID www.ti-rfid.com
OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com
Wireless Connectivity www.ti.com/wirelessconnectivity
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2014, Texas Instruments Incorporated

More Related Content

What's hot

Matlab simulation on chopper based speed control of dc motor: A Review
Matlab simulation on chopper based speed control of dc motor: A ReviewMatlab simulation on chopper based speed control of dc motor: A Review
Matlab simulation on chopper based speed control of dc motor: A Review
IRJET Journal
 
cers_jack_nur_2016
cers_jack_nur_2016cers_jack_nur_2016
cers_jack_nur_2016
Jack Yuan
 
Bi directional speed control of dc motor and stepper
Bi directional speed control of dc motor and stepperBi directional speed control of dc motor and stepper
Bi directional speed control of dc motor and stepper
eSAT Publishing House
 
Analysis and control of four quadrant operation of three phase brushless dc (...
Analysis and control of four quadrant operation of three phase brushless dc (...Analysis and control of four quadrant operation of three phase brushless dc (...
Analysis and control of four quadrant operation of three phase brushless dc (...
eSAT Publishing House
 
Nabil slide fyp1 new
Nabil slide fyp1 newNabil slide fyp1 new
Nabil slide fyp1 new
nabelnajib
 
Servo Drive for Top Performance | ElmoMC
Servo Drive for Top Performance | ElmoMC Servo Drive for Top Performance | ElmoMC
Servo Drive for Top Performance | ElmoMC
Elmo Motion Control
 
Simulation of Automatic speed control DC Drive
Simulation of Automatic speed control DC DriveSimulation of Automatic speed control DC Drive
Simulation of Automatic speed control DC Drive
Indian Institute of Technology Delhi
 
Wireless Speed Control of an Induction Motor Using Pwm Technique with Gsm
Wireless Speed Control of an Induction Motor Using Pwm Technique with GsmWireless Speed Control of an Induction Motor Using Pwm Technique with Gsm
Wireless Speed Control of an Induction Motor Using Pwm Technique with Gsm
IOSR Journals
 
Abb technical guide book en rev_g
Abb technical guide book en rev_gAbb technical guide book en rev_g
Abb technical guide book en rev_g
Cesar Enrique Gutierrez Candia
 
Speed Control of DC Motor using Microcontroller
Speed Control of DC Motor using MicrocontrollerSpeed Control of DC Motor using Microcontroller
Speed Control of DC Motor using Microcontroller
Sudip Mondal
 
IRJET- Design of Diagnosis Device for Electronic Throttle Body
IRJET-  	  Design of Diagnosis Device for Electronic Throttle BodyIRJET-  	  Design of Diagnosis Device for Electronic Throttle Body
IRJET- Design of Diagnosis Device for Electronic Throttle Body
IRJET Journal
 
Speed control of sensorless BLDC motor with two side chopping PWM
Speed control of sensorless BLDC motor with two side chopping PWMSpeed control of sensorless BLDC motor with two side chopping PWM
Speed control of sensorless BLDC motor with two side chopping PWM
IOSR Journals
 
FPGA Based Speed Control of BLDC Motor
FPGA Based Speed Control of BLDC MotorFPGA Based Speed Control of BLDC Motor
FPGA Based Speed Control of BLDC Motor
Rajesh Pindoriya
 
Tachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor controlTachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor control
Sushil Mishra
 
Abb technical guide no.09 revb
Abb technical guide no.09 revbAbb technical guide no.09 revb
Abb technical guide no.09 revb
Cesar Enrique Gutierrez Candia
 
Abb technical guide no.08 revb
Abb technical guide no.08 revbAbb technical guide no.08 revb
Abb technical guide no.08 revb
Cesar Enrique Gutierrez Candia
 
Abb technical guide no.04 revc
Abb technical guide no.04 revcAbb technical guide no.04 revc
Abb technical guide no.04 revc
Cesar Enrique Gutierrez Candia
 
Arm cortex ( lpc 2148 ) based motor speed control
Arm cortex ( lpc 2148 ) based motor speed control Arm cortex ( lpc 2148 ) based motor speed control
Arm cortex ( lpc 2148 ) based motor speed control
Uday Wankar
 
Gesture Controlled Chair
Gesture Controlled ChairGesture Controlled Chair
Gesture Controlled Chair
theijes
 
IRJET- Monitoring of Distribution Transformer and its Theft Protection by...
IRJET-  	  Monitoring of Distribution Transformer and its Theft Protection by...IRJET-  	  Monitoring of Distribution Transformer and its Theft Protection by...
IRJET- Monitoring of Distribution Transformer and its Theft Protection by...
IRJET Journal
 

What's hot (20)

Matlab simulation on chopper based speed control of dc motor: A Review
Matlab simulation on chopper based speed control of dc motor: A ReviewMatlab simulation on chopper based speed control of dc motor: A Review
Matlab simulation on chopper based speed control of dc motor: A Review
 
cers_jack_nur_2016
cers_jack_nur_2016cers_jack_nur_2016
cers_jack_nur_2016
 
Bi directional speed control of dc motor and stepper
Bi directional speed control of dc motor and stepperBi directional speed control of dc motor and stepper
Bi directional speed control of dc motor and stepper
 
Analysis and control of four quadrant operation of three phase brushless dc (...
Analysis and control of four quadrant operation of three phase brushless dc (...Analysis and control of four quadrant operation of three phase brushless dc (...
Analysis and control of four quadrant operation of three phase brushless dc (...
 
Nabil slide fyp1 new
Nabil slide fyp1 newNabil slide fyp1 new
Nabil slide fyp1 new
 
Servo Drive for Top Performance | ElmoMC
Servo Drive for Top Performance | ElmoMC Servo Drive for Top Performance | ElmoMC
Servo Drive for Top Performance | ElmoMC
 
Simulation of Automatic speed control DC Drive
Simulation of Automatic speed control DC DriveSimulation of Automatic speed control DC Drive
Simulation of Automatic speed control DC Drive
 
Wireless Speed Control of an Induction Motor Using Pwm Technique with Gsm
Wireless Speed Control of an Induction Motor Using Pwm Technique with GsmWireless Speed Control of an Induction Motor Using Pwm Technique with Gsm
Wireless Speed Control of an Induction Motor Using Pwm Technique with Gsm
 
Abb technical guide book en rev_g
Abb technical guide book en rev_gAbb technical guide book en rev_g
Abb technical guide book en rev_g
 
Speed Control of DC Motor using Microcontroller
Speed Control of DC Motor using MicrocontrollerSpeed Control of DC Motor using Microcontroller
Speed Control of DC Motor using Microcontroller
 
IRJET- Design of Diagnosis Device for Electronic Throttle Body
IRJET-  	  Design of Diagnosis Device for Electronic Throttle BodyIRJET-  	  Design of Diagnosis Device for Electronic Throttle Body
IRJET- Design of Diagnosis Device for Electronic Throttle Body
 
Speed control of sensorless BLDC motor with two side chopping PWM
Speed control of sensorless BLDC motor with two side chopping PWMSpeed control of sensorless BLDC motor with two side chopping PWM
Speed control of sensorless BLDC motor with two side chopping PWM
 
FPGA Based Speed Control of BLDC Motor
FPGA Based Speed Control of BLDC MotorFPGA Based Speed Control of BLDC Motor
FPGA Based Speed Control of BLDC Motor
 
Tachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor controlTachometer using AT89S52 microcontroller with motor control
Tachometer using AT89S52 microcontroller with motor control
 
Abb technical guide no.09 revb
Abb technical guide no.09 revbAbb technical guide no.09 revb
Abb technical guide no.09 revb
 
Abb technical guide no.08 revb
Abb technical guide no.08 revbAbb technical guide no.08 revb
Abb technical guide no.08 revb
 
Abb technical guide no.04 revc
Abb technical guide no.04 revcAbb technical guide no.04 revc
Abb technical guide no.04 revc
 
Arm cortex ( lpc 2148 ) based motor speed control
Arm cortex ( lpc 2148 ) based motor speed control Arm cortex ( lpc 2148 ) based motor speed control
Arm cortex ( lpc 2148 ) based motor speed control
 
Gesture Controlled Chair
Gesture Controlled ChairGesture Controlled Chair
Gesture Controlled Chair
 
IRJET- Monitoring of Distribution Transformer and its Theft Protection by...
IRJET-  	  Monitoring of Distribution Transformer and its Theft Protection by...IRJET-  	  Monitoring of Distribution Transformer and its Theft Protection by...
IRJET- Monitoring of Distribution Transformer and its Theft Protection by...
 

Similar to Stepper y drv8811

Speed Control of Induction Motor Using PLC and SCADA System
Speed Control of Induction Motor Using PLC and SCADA SystemSpeed Control of Induction Motor Using PLC and SCADA System
Speed Control of Induction Motor Using PLC and SCADA System
IJERA Editor
 
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
Dr.M.Karthika parthasarathy
 
Design and Implementation of Speed Control of Induction Motor using Arduino B...
Design and Implementation of Speed Control of Induction Motor using Arduino B...Design and Implementation of Speed Control of Induction Motor using Arduino B...
Design and Implementation of Speed Control of Induction Motor using Arduino B...
ijtsrd
 
IRJET- Direct Torque Control of Induction Motor
IRJET-  	  Direct Torque Control of Induction MotorIRJET-  	  Direct Torque Control of Induction Motor
IRJET- Direct Torque Control of Induction Motor
IRJET Journal
 
IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...
IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...
IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...
IRJET Journal
 
IRJET - IoT based Speed Control of DC Motor using PWM Technique
IRJET -  	  IoT based Speed Control of DC Motor using PWM TechniqueIRJET -  	  IoT based Speed Control of DC Motor using PWM Technique
IRJET - IoT based Speed Control of DC Motor using PWM Technique
IRJET Journal
 
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERFOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
Journal For Research
 
IRJET - Vector Control of Permenant Magnet Synchronous Motor
IRJET -  	  Vector Control of Permenant Magnet Synchronous MotorIRJET -  	  Vector Control of Permenant Magnet Synchronous Motor
IRJET - Vector Control of Permenant Magnet Synchronous Motor
IRJET Journal
 
PLC Applications for speed control of induction motor through VFD
PLC Applications for speed control of induction motor through VFDPLC Applications for speed control of induction motor through VFD
PLC Applications for speed control of induction motor through VFD
IRJET Journal
 
Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...
Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...
Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...
IJPEDS-IAES
 
Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...
Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...
Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...
IRJET Journal
 
Design and development of matlab gui based fuzzy logic controllers for ac motor
Design and development of matlab gui based fuzzy logic controllers for ac motorDesign and development of matlab gui based fuzzy logic controllers for ac motor
Design and development of matlab gui based fuzzy logic controllers for ac motor
IAEME Publication
 
A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...
A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...
A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...
IAES-IJPEDS
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 Report
PARNIKA GUPTA
 
Arm cortex (lpc 2148) based motor speed
Arm cortex (lpc 2148) based motor speedArm cortex (lpc 2148) based motor speed
Arm cortex (lpc 2148) based motor speed
Uday Wankar
 
IRJET- Review: Different Techniques of Speed Control of DC Motor
IRJET-  	  Review: Different Techniques of Speed Control of DC MotorIRJET-  	  Review: Different Techniques of Speed Control of DC Motor
IRJET- Review: Different Techniques of Speed Control of DC Motor
IRJET Journal
 
Improving Accuracy With Servomotors And High Speed Network
Improving Accuracy With Servomotors And High Speed NetworkImproving Accuracy With Servomotors And High Speed Network
Improving Accuracy With Servomotors And High Speed Network
Yuki Honda
 
Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335
Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335
Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335
IJPEDS-IAES
 
An 706
An 706An 706
An 706
bratawijaya
 
IRJET- AC Motor Fault Analyser by Characteristic Analysis
IRJET-  	  AC Motor Fault Analyser by Characteristic AnalysisIRJET-  	  AC Motor Fault Analyser by Characteristic Analysis
IRJET- AC Motor Fault Analyser by Characteristic Analysis
IRJET Journal
 

Similar to Stepper y drv8811 (20)

Speed Control of Induction Motor Using PLC and SCADA System
Speed Control of Induction Motor Using PLC and SCADA SystemSpeed Control of Induction Motor Using PLC and SCADA System
Speed Control of Induction Motor Using PLC and SCADA System
 
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
 
Design and Implementation of Speed Control of Induction Motor using Arduino B...
Design and Implementation of Speed Control of Induction Motor using Arduino B...Design and Implementation of Speed Control of Induction Motor using Arduino B...
Design and Implementation of Speed Control of Induction Motor using Arduino B...
 
IRJET- Direct Torque Control of Induction Motor
IRJET-  	  Direct Torque Control of Induction MotorIRJET-  	  Direct Torque Control of Induction Motor
IRJET- Direct Torque Control of Induction Motor
 
IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...
IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...
IRJET-Comparison between Scalar & Vector Control Technique for Induction Moto...
 
IRJET - IoT based Speed Control of DC Motor using PWM Technique
IRJET -  	  IoT based Speed Control of DC Motor using PWM TechniqueIRJET -  	  IoT based Speed Control of DC Motor using PWM Technique
IRJET - IoT based Speed Control of DC Motor using PWM Technique
 
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLERFOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
FOUR QUADRANT SPEED CONTROL OF DC MOTOR USING AT89S52 MICROCONTROLLER
 
IRJET - Vector Control of Permenant Magnet Synchronous Motor
IRJET -  	  Vector Control of Permenant Magnet Synchronous MotorIRJET -  	  Vector Control of Permenant Magnet Synchronous Motor
IRJET - Vector Control of Permenant Magnet Synchronous Motor
 
PLC Applications for speed control of induction motor through VFD
PLC Applications for speed control of induction motor through VFDPLC Applications for speed control of induction motor through VFD
PLC Applications for speed control of induction motor through VFD
 
Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...
Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...
Low Speed Estimation in Sensorless Direct Torque Controlled Induction Motor D...
 
Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...
Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...
Speed Sensor less DTC of VSI fed Induction Motor with Simple Flux Regulation ...
 
Design and development of matlab gui based fuzzy logic controllers for ac motor
Design and development of matlab gui based fuzzy logic controllers for ac motorDesign and development of matlab gui based fuzzy logic controllers for ac motor
Design and development of matlab gui based fuzzy logic controllers for ac motor
 
A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...
A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...
A Novel Rotor Resistance Estimation Technique for Vector Controlled Induction...
 
IISC CPDM Task 1 Report
IISC CPDM Task 1 ReportIISC CPDM Task 1 Report
IISC CPDM Task 1 Report
 
Arm cortex (lpc 2148) based motor speed
Arm cortex (lpc 2148) based motor speedArm cortex (lpc 2148) based motor speed
Arm cortex (lpc 2148) based motor speed
 
IRJET- Review: Different Techniques of Speed Control of DC Motor
IRJET-  	  Review: Different Techniques of Speed Control of DC MotorIRJET-  	  Review: Different Techniques of Speed Control of DC Motor
IRJET- Review: Different Techniques of Speed Control of DC Motor
 
Improving Accuracy With Servomotors And High Speed Network
Improving Accuracy With Servomotors And High Speed NetworkImproving Accuracy With Servomotors And High Speed Network
Improving Accuracy With Servomotors And High Speed Network
 
Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335
Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335
Implementation of PI Controller for 4Ф SRM Drive Using TMS320F28335
 
An 706
An 706An 706
An 706
 
IRJET- AC Motor Fault Analyser by Characteristic Analysis
IRJET-  	  AC Motor Fault Analyser by Characteristic AnalysisIRJET-  	  AC Motor Fault Analyser by Characteristic Analysis
IRJET- AC Motor Fault Analyser by Characteristic Analysis
 

Recently uploaded

一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
nudduv
 
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
xuqdabu
 
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
snfdnzl7
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
u0g33km
 
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
ei8c4cba
 
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
1jtj7yul
 
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...
Peter Gallagher
 
一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理
一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理
一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理
xuqdabu
 
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
byfazef
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
peuce
 
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
yizxn4sx
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
xuqdabu
 
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
aozcue
 
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
zpc0z12
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
lorraineandreiamcidl
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
terpt4iu
 
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
6oo02s6l
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
8db3cz8x
 
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
terpt4iu
 
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
nudduv
 

Recently uploaded (20)

一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
 
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
一比一原版(UQ文凭证书)昆士兰大学毕业证如何办理
 
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
按照学校原版(USD文凭证书)圣地亚哥大学毕业证快速办理
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
 
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
 
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
 
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR - Slides Onl...
 
一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理
一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理
一比一原版(TheAuckland毕业证书)新西兰奥克兰大学毕业证如何办理
 
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
一比一原版(Greenwich文凭证书)格林威治大学毕业证如何办理
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证如何办理
 
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
 
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
一比一原版(UCSB毕业证)圣塔芭芭拉社区大学毕业证如何办理
 
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
按照学校原版(UST文凭证书)圣托马斯大学毕业证快速办理
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
 
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
 
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
按照学校原版(Adelaide文凭证书)阿德莱德大学毕业证快速办理
 
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
 

Stepper y drv8811

  • 1. Application Report SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Jose Quiñones...................................................................................................... Analog Motor Drives ABSTRACT This document is provided as a supplement to the DRV8811/18/21/24/25 data sheets. It details a technique to improve real time control of an internal indexer bipolar stepper motor driver such as the DRV8811, DRV8818, DRV8821, DRV8824 or DRV8825 while obtaining programmable acceleration and deceleration profiles, speed control and position control by the utilization of a conventional MSP430 microcontroller and any of the aforementioned power stages. Contents 1 Introduction and Problem Statement ..................................................................................... 2 2 Stepper Motor Control High Level Functions ............................................................................ 3 2.1 STEP Actuation: Acceleration, Speed Control and Deceleration Profiles .................................. 3 2.2 Accelerating the Motor ............................................................................................ 4 2.3 Stepper Speed ..................................................................................................... 8 2.4 Decelerating the Motor ........................................................................................... 10 2.5 Speed Change .................................................................................................... 10 2.6 Position Control: Number Of Steps ............................................................................ 11 2.7 Homing the Stepper .............................................................................................. 12 3 I2 C Protocol and Communications Engine ............................................................................. 13 3.1 GPIO CONFIG .................................................................................................... 14 3.2 STEPPER CONFIG .............................................................................................. 14 3.3 GPIO OUT ......................................................................................................... 15 3.4 Current Duty Cycle ............................................................................................... 15 3.5 START STEPPER ................................................................................................ 15 4 Application Schematic .................................................................................................... 20 1SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 2. Digital Signal Processor or Microcontroller Dual H Bridge Power Stage ENABLE_A PHASE_A VREF_A ENABLE_B PHASE_B VREF_B GPIO GPIO DAC GPIO GPIO DAC L O G I C G L O G I C G OUTA OUTA OUTB OUTB STEP DIR ENABLE DRV8811 DRV8818 DRV8821 DRV8824 DRV8825 OUTA OUTB (A) (B) USMx STEP DIR ENABLE USMx Introduction and Problem Statement www.ti.com 1 Introduction and Problem Statement Driving a stepper motor can be a daunting task. Whereas, providing a voltage at the terminals of a DC motor causes immediate rotation, on a stepper motor, careful magnetic field commutation must be applied in order to obtain the same behavior. In the not so distant past, said electromagnetic commutation was achieved by coding powerful microprocessors to coordinate the phase and current information administered into the power stage. With the advent of high integration on monolithic integrated circuits, it became simpler to take into hardware all the blocks once generated through code. A stand alone IC could now control even the most intricate subjects such as phase commutation and microstepping without the need of precious microcontroller resources. Figure 1. Stepper Control Logic and Power Stage Figure 1 shows the level of integration which can be obtained when the code inside of a microcontroller, and in charge of causing stepper commutation, is concatenated along with the power stage into a single chip solution. Notice that in both scenarios a series of simple control signals exist. A STEP pulse is used to generate steps or microsteps; a DIR signal defines the direction of rotation; the ENABLE line determines whether the power stage is enabled or not; and the User Mode bits are used to select a degree of microstepping. Controlling a stepper, however, can still benefit from the usage of a microcontroller. Tasks such as speed and position control, acceleration and deceleration, homing, etc. still require accuracy and precision which a microcontroller can easily supply. The question we must ask is: Will the application processing unit be asked to compute all the parameters related to stepper motion, or will a smaller and more cost economical microcontroller be used to tackle the tasks at hand? Using a smaller microcontroller to perform the aforementioned tasks is advantageous if numerous steppers are to be controlled. In this fashion, the application processor can utilize its real time resources to properly coordinate application intensive aspects, while the small microcontrollers deal with the intricacies of controlling the stepper motors. This application note details an implementation using an MSP430F2132 microcontroller and a DRV8824/25 device which has an internal indexer bipolar stepper microstepping power stage. Combined, they form a module capable of receiving commands from a master controller through an I2 C bus, and which will then undertake all the actions to control the stepper motor both in speed and position. In order to best utilize the available resources, a series of GPIO terminals were added, which will provide extra functionality to the main processor. Figure 2 shows a block diagram of the proposed implementation. 2 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 3. MSP430F2132 DRV8811 DRV8818 DRV8821 DRV8824 DRV8828 STEP DIR nENABLE DA CL HOME GPIO ADDR0 ADDR1 I2C nSLEEP OUTA OUTB VREF www.ti.com Stepper Motor Control High Level Functions Figure 2. Intelligent Stepper Controller Block Diagram 2 Stepper Motor Control High Level Functions 2.1 STEP Actuation: Acceleration, Speed Control and Deceleration Profiles Stepper motors offer a means to achieve speed control without the usage of closed loop mechanisms such as shaft encoders or resolvers. On a microstepping internal indexer driver, this open loop control is obtained by modulating the frequency at the STEP input. Each pulse at the STEP input, becomes a mechanical step motion at the stepper motor. Hence, it is safe to say that since we know what frequency we are applying at the STEP input, we then know the actual step rate the stepper motor is moving at. This will hold true as long as the right parametric values, such as current, voltage and torque, are maintained within reasonable levels throughout the application’s operation. Unfortunately, we cannot just apply any frequency or step rate to any given stepper motor. Due to the mechanisms behind the revolving magnetic field at the stator and the permanent magnet at the rotor, a stepper motor can only start moving if the requested speed is smaller than a parameter given by the motor’s manufacturer and referred to as the starting frequency (denominated FS). For example, if the FS for a particular stepper motor is 300 steps per second (SPS), it will most likely not be possible to start the motor at a frequency of 400 SPS. 3SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 4. Time (s) MotorSpeed(SPS) Desired Speed (SPS) Starting Speed (SPS) Stopping Speed (SPS)Acceleration Rate (SPSPS) Deceleration Rate (SPSPS) Stepper Motor Control High Level Functions www.ti.com Since the application may require speed rates larger than the FS, it is then very important to subject the motor commutation through an acceleration profile which starts at a speed rate lower than its maximum FS and increases speed accordingly until reaching the desired speed. Figure 3. Typical Stepper Acceleration and Deceleration Profile Figure 3 shows a typical acceleration and deceleration profile where: Starting Speed is a STEP frequency lower than the motor’s rated FS at which the motor will start moving. Measured in steps per second (SPS), where STEPS refers to full steps. Acceleration Rate is a factor of how much the STEP frequency will be increased on a per second basis. Measured in steps per second per second (SPSPS). Desired Speed is the STEP frequency the application requires the motor to move at. It marks the STEP frequency at which the acceleration profile concludes. Measured in steps per second. Deceleration Speed is a factor of how much the STEP frequency will be decreased on a per second basis. Measured in steps per second per second (SPSPS). Stopping Speed is the STEP frequency at which the deceleration profile and the motor will be stopped. In this application note, stopping speed is taken to be the same as the starting speed. Measured in steps per second. 2.2 Accelerating the Motor The start stepper command starts by issuing steps at a starting frequency denoted by the StartingSpeed variable. A timer must be used to generate STEP pulses at such frequency. On this application note, Timer A0.2 was used to set the STEP signal and Timer A0.0 was used to clear the same signal. The pulse width is 32 clock pulses wide which translates to 2 µs. Since the DRV8825 requires STEP pulses at least 1-µs wide, this implementation results in a legal pulse generation. 4 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 5. void AccelTimeCompute(unsigned int AccelDecelRate) { if (AccelDecelRate <= 4000) { AccelerationTime = 4000/AccelDecelRate; AccelerationIncrease = 1; } else { AccelerationTime = 1; AccelerationIncrease = AccelDecelRate/4000; } tmpAccelerationTime = AccelerationTime; } Step Frequency’s Period Pulse Width Must be larger than 1 us TA0CCR2Sets TA0CCR0Clears TA0CCR2Sets TA0CCR0Clears www.ti.com Stepper Motor Control High Level Functions Figure 4. Timer A0 Used to Generate STEP Pulses The interrupt subroutine for Timer A0.2 is in charge of programming the Timer A0.0 hardware reset, as well as programming itself in order to schedule the next step generation. A second timer function is needed to generate the acceleration portion of the speed control profile. The microcontroller selected for this application only had two available timers so as will be explained shortly, a trade off had to be made. Timer A1.1 was used along with timer A1.0 to generate the PWM output which would be used to generate an analog to digital converter, by adding an RC filter, to drive the DRV8825’s VREF analog input pin. With this technique, it is then possible to control stepper current in real time. Although all timer resources seem to be depleted, there is still an aspect of timer A1 we can utilize. If we code the PWM generator to count from decimal 0 to decimal 249, we will have 250 time units. At 16 MHz, each timer unit is equal to 62.5 ns with 250 of them accounting for 15.625 µs. By further dividing this result by 8, we can get a fairly useful time base of 125 µs, or 4000 timer ticks per second. What this means is we can increase the stepper speed rate up to 4000 times per second. A simple mathematical equation can then be used to compute both the acceleration time interval and the acceleration increment parameter. The code snippet below shows the equations used to compute both aspects of the acceleration parameter: Figure 5. Function Computing Time Interval and Acceleration Increase Parameters for Acceleration or Deceleration Rate 5SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 6. Init H Bridges and Variables Timer A0.1 = Start Speed Start Stepper? YES NO Accel Time Complete? YES Timer A0.1 Count Accel Time Interval NO Compute Acceleration Rate and Acceleration Time Start Acceleration Engine Stepper Speed+= Accel Rate START Stepper Speed >= Desired Speed? NO Stepper Speed= Desired Speed Disable Acceleration Engine END Stepper Motor Control High Level Functions www.ti.com Figure 6 shows the flowchart of the state machine in charge of coordinating the acceleration. As can be seen, the command to start the motor will configure all the parameters required for motion, including the call to the AccelTimeCompute function. Figure 6. Stepper Speed Acceleration Flowchart The actual speed modification takes place inside the AccelDecel function which gets called from within the main execution which is in turn enabled within the timer A1.0 interrupt service routine (ISR). It is important for the AccelDecel function not to be called from within inside the ISR as this impacts real time operation. Instead, inside the ISR the microcontroller sleep mode is disabled, which allows execution to resume from the main loop. 6 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 7. #pragma vector=TIMER1_A0_VECTOR __interrupt void Timer1_A0(void) { TimerA0Count += 1; if (TimerA0Count == ATBCount) { TimerA0Count = 0; if (tmpAccelerationTime == 0) { tmpAccelerationTime = AccelerationTime; _BIC_SR_IRQ(CPUOFF); // Clear LPM0 - jumps to AccelDecel(); } tmpAccelerationTime -= 1; } } int main() { //ALL INITIALIZATION OCCURS HERE __bis_SR_register(GIE); // Enable all Interrupts while (1) { _BIS_SR(CPUOFF); // Enter LPM0 AccelDecel(); } } www.ti.com Stepper Motor Control High Level Functions Figure 7. Main Function Calls the AccelDecel Code Whenever Code Inside of an ISR Removes the Micro from Sleep Mode Figure 8. Timer A1.0 ISR Disables Sleep Mode Once an Acceleration Tick is to be Executed 7SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 8. void AccelDecel(void) { switch (AccelerationState) { case (NOACC): break; case (ACCEL): ActualStepperSpeed += AccelerationIncrease; if (ActualStepperSpeed >= DesiredStepperSpeed) { ActualStepperSpeed = DesiredStepperSpeed; AccelerationState = NOACC; TA1CCTL0 &= ~CCIE; //DISABLE 250 us coordinator interrupt on TA1.0 } SpeedCompute(ActualStepperSpeed); break; case (DECEL): ActualStepperSpeed -= AccelerationIncrease; if (ActualStepperSpeed <= DesiredStepperSpeed) { ActualStepperSpeed = DesiredStepperSpeed; AccelerationState = NOACC; TA1CCTL0 &= ~CCIE; //DISABLE 250 us coordinator interrupt on TA1.0 } SpeedCompute(ActualStepperSpeed); break; case (STOP): ActualStepperSpeed -= AccelerationIncrease; if (ActualStepperSpeed <= StartStepperSpeed) { ActualStepperSpeed = StartStepperSpeed; AccelerationState = NOACC; TA1CCTL0 &= ~CCIE; //DISABLE 250 us coordinator interrupt on TA1.0 ExecutedSteps = NumberOfSteps - 1; } SpeedCompute(ActualStepperSpeed); break; } } Stepper Motor Control High Level Functions www.ti.com Figure 9. AccelDecel Function is State Machine Code in Charge of Modifying Stepper Speed According to Programmed Acceleration or Deceleration Profile 2.3 Stepper Speed Stepper speed is carefully controlled by using Timer A1.0 and A1.2 as detailed previously. How the timer is being clocked is important to understand, as the 16- bit timer by itself is not capable of reproducing all the possible speeds applications around this topology may try to run at. For example, while the Timer A1 is being clocked at 16 MHz, fast stepping rates are easily obtained, while slow speeds cannot be generated. 8 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 9. bool SpeedCompute(unsigned int MotorSpeedInHz) { if (MotorSpeedInHz < 31 ) { return false; } else if (MotorSpeedInHz < 61 ) { ClockConfigure(8); StepperSpeedTMR = 2000000 / MotorSpeedInHz; return true; } else if (MotorSpeedInHz < 123) { ClockConfigure(4); StepperSpeedTMR = 4000000 / MotorSpeedInHz; return true; } else if (MotorSpeedInHz < 245) { ClockConfigure(2); StepperSpeedTMR = 8000000 / MotorSpeedInHz; return true; } else { ClockConfigure(1); StepperSpeedTMR = 16000000 / MotorSpeedInHz; return true; } } www.ti.com Stepper Motor Control High Level Functions As a result, it is imperative to modulate the clock speed by subdividing it. Luckily Timer A has a series of dividing factors which allow the timer clocking speed to be subdivided from 16 MHz down to as slow as 2 MHz. The equation to compute how many clock cycles are needed to reproduce a particular stepping rate is: # Clock Cycles = TIMER CLOCK FREQUENCY / STEP_RATE in Hz (1) A quick analysis on the results provided by the previous equation showed the stepping rate segregations on a per clock cycle count basis. If for a given timer clock frequency the resulting number of clock cycles was larger than 65535 then a further subdivision factor would be needed to reduce the clock count from saturating the timer register. The function SpeedCompute is in charge of transforming a stepping rate in Hz into clock count. Depending on the speed, the timing source for Timer A1 is sub divided to slow down its incremental rate. If the requested stepping rate is less than 31, the function returns false in which case no rate is generated. Although it may be desirable to obtain stepping rates lower than 31 full steps, this can still be achieved by utilizing a faster speed and configuring the DRV8824/25 device to operate in 32 degrees of microstepping. For example, if the programmed DesiredSpeed is 32 SPS, and the DRV8824/25 is configured to operate in 32 degrees of microstepping, the stepper will move 1 full step per second. Figure 10. SpeedCompute Transform the Stepping Rate in Hz into a Clock Count Timer A1.1 - Can Use to Generate Accurate Timing Information 9SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 10. void ClockConfigure(char Divider) { int tempTA0CTL; tempTA0CTL = TA0CTL; switch (Divider) { case 1: tempTA0CTL &= ~( BIT7 + BIT6); break; case 2: tempTA0CTL &= ~( BIT7 + BIT6); tempTA0CTL |= TA0_ID_DIV2; break; case 4: tempTA0CTL &= ~( BIT7 + BIT6); tempTA0CTL |= TA0_ID_DIV4; break; case 8: tempTA0CTL &= ~( BIT7 + BIT6); tempTA0CTL |= TA0_ID_DIV8; break; } TA0CTL = tempTA0CTL; } Stepper Motor Control High Level Functions www.ti.com Figure 11. Function ClockConfigure is Called Within the SpeedCompute Function to Modify the Divider Affecting Timer A1 Clock Speed The functions SpeedCompute and ClockConfigure are called to set the StartSpeed, to set the new stepper speed on a per acceleration click occurrence and then when the DesiredSpeed is met. Once the programmed DesiredSpeed target is reached the stepper motor maintains said speed until a deceleration profile is commanded. 2.4 Decelerating the Motor The concept of a deceleration profile the motor is virtually identical to the acceleration profile implementation except that instead of increasing stepper speed, speed is decreased. There are two instances in which a deceleration profile may be employed: during SpeedUpdate or during StepperStop commands. In this implementation, the stepper deceleration profile is finished either when the start speed is reached or when the programmed number of steps is executed. Also, it was chosen for the deceleration rate to hold a different memory location such that a non symmetric acceleration/deceleration profile, such as the one portrayed in Figure 3, could be employed. The SpeedCompute and ClockConfigure are used in the same fashion as they were used during the acceleration portion of the motion control profile. However, the state machine, or the AccelDecel function, is configured to execute the DECEL portion of code. 2.5 Speed Change During run time, it is possible to change the speed and incur in further acceleration or deceleration as deemed by the application. When the command SpeedUpdate is issued, the firmware checks to see whether the new DesiredSpeed is larger or smaller than the ActualStepperSpeed. The result of this operation configures the Acceleration Deceleration engine accordingly. 10 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 11. www.ti.com Stepper Motor Control High Level Functions 2.6 Position Control: Number Of Steps The closed loop capabilities of a stepper are not limited to accurately controlling the speed. Since in essence the controller is counting the very same steps which are being generated, knowledge of step position is continuously being updated. Every time a step is executed, the variable StepPosition is updated according to step rotation direction. For example, if the motor is rotating clockwise (DIR = HI), the StepPosition variable is incremented, whereas if the motor is rotating counterclockwise (DIR = LO), then the StepPosition variable is decremented. NOTE: The notions of motor rotation as clockwise or counterclockwise are directly dependent to how the motor was wired and the motor itself. The variable StepPosition can be read in real time to obtain information as to where the motor is at any given point in time. On this application note, however, the controller is always operating in Position Control mode. The variable NumberOfSteps is programmed to hold the entire number of steps which will be executed. Since this is a 32-bit variable, the total number of steps could be a significantly large number, in which case the motor would in essence be operating in free running mode. However, if the NumberOfSteps count is small, then the motor will stop once the total NumbeOfSteps have been executed. The previous mechanism is achieved by counting how many steps have been executed and comparing this number to the NumberOfSteps command. This is taken care of on the Timer A0.2 ISR as shown in Figure 12. Notice this ISR is in charge of a few tasks we have described earlier and which are of crucial importance to generating accurate stepping information. These tasks are: 1. Generation of the STEP pulse by configuring when the STEP clear takes place. Timer A0.0 is in charge of returning the STEP signal to LO. 2. Configuring the TIMERA0.2 to generate the next step according to the current step rate, or StepperSpeedTMR, which is the timer equivalent of the current rate in Hz. 3. Determining whether the current generated step is the last step to execute. This happens when ExecutedSteps is equal to NumberOfSteps. 4. If the current generated step is equal to StepsToStop value, then the engine is commanded to start a deceleration profile. 5. Update StepPosition according to motor direction. 11SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 12. #pragma vector=TIMER0_A1_VECTOR __interrupt void Timer0_A1(void) { switch (TA0IV) { case TA0CCR1_CCIFG_SET: break; case TA0CCR2_CCIFG_SET: TA0CCR0 = TA0CCR2 + StepPulseWidth; //2 us at 16 MHz TA0CCR2 += StepperSpeedTMR; ExecutedSteps += 1; if (ExecutedSteps == NumberOfSteps) { TA0CCTL2 &= ~(CCIE + BIT5 + BIT6 + BIT7); //Disable Pulse Generation } else if (ExecutedSteps == StepsToStop) { AccelTimeCompute(DecelerationRate); AccelerationState = STOP; TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0 } if (P3IN && DIR) { StepPosition += 1; } else { StepPosition -=1; } ReadTable[0] = (StepPosition & 0xFF00) >> 8; ReadTable[1] = StepPosition & 0xFF; break; case TA0IFG_SET: break; } } Stepper Motor Control High Level Functions www.ti.com Figure 12. Timer A0.2 ISR 2.7 Homing the Stepper The concept of preserving stepper position is in essence flawed if we do not know the system’s start position. This is true for any motor system in which the closed loop feedback is relative, versus absolute. As a result, it is important we start counting our steps from a known position. Said position is often referred to as HOME. The application note incorporates a HOME sensor input which is flexible enough to accommodate both sensor polarities (e.g. asserted HI or asserted LO). A typical HOME sensor implementation is to have an optical sensor and a flag at the stepper motor shaft. When the flag meets the optical sensor slit, then the stepper motor stops and this position is from now on referred to as HOME. Internally, the controller clears the StepPosition variable. 12 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 13. #pragma vector=PORT1_VECTOR __interrupt void PORT1_Change(void) { if (P1IFG && HOMEIN) { P1IE = 0; P1IFG = 0; TA0CCTL2 &= ~(CCIE + BIT5 + BIT6 + BIT7); StepPosition = 0; } } www.ti.com I2 C Protocol and Communications Engine Since the motor can be started at any given position, the HOME sensor could be found to be at either state. Hence, initially, the state is to be considered unknown. The typical homing implementation calls for a transition from HI to LO or a transition from LO to HI as chosen by the application. In order to easily capture the chosen transition, the HOME sensor was allocated to a GPIO pin with a Pin On Change Interrupt. Since the pin can be configured to raise the ISR flag either with a rising or a falling edge, we can capture on either edge. Whereas the typical polling function would require some sort of a state machine to filter out the wrong transition, this hardware interrupt works exceptionally well, rendering the amount of code to be considerably tiny.Figure 13 shows the ISR for the PORT1 Pin On Change Interrupt vector. The reader will notice this code is in charge of clearing the StepPosition variable, as well as stopping the motor. Figure 13. Port 1 Pin On Change Interrupt Service Routine 3 I2 C Protocol and Communications Engine In order to program the device parameters and the stepper motion engine profiles, an I2 C protocol was chosen. The way it was designed, up to four controllers can be cascaded with only two communication lines and two address selector lines. The I2 C protocol is the typical three byte packet where the first byte is the slave address, the second byte is the register address and the third byte is the data. There are 21 possible address register which can be accessed. 13SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 14. N/A Bit 7 Bit 0 ENABLE MODE2 MODE1 MODE0 N/A N/A DIR GPIO DIR 7 Bit 7 Bit 0 GPIO DIR 6 GPIO DIR 5 GPIO DIR 4 GPIO DIR 3 GPIO DIR 2 GPIO DIR 1 GPIO DIR 0 Number Of Steps Number Of Steps Number Of Steps1 Number Of Steps0 StepsToStop StepsToStop StepsToStop1 StepsToStop0 StartSpeed1 StartSpeed0 Accel1 Accel0 DesiredSpeed1 DesiredSpeed0 Decel1 Decel0 GPIO CONFIG Stepper Config GPIO OUT Current Duty Cycle Start Stepper 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 Index PARAMETER TABLE I2 C Protocol and Communications Engine www.ti.com Figure 14. Parameters Table The variables residing on addresses 0x00 to 0x0F have been discussed on previous sections. The other addresses are a combination of parameters as well as actions. 3.1 GPIO CONFIG Defines the GPIO direction, for the 8 GPIO pins 0 to 7, where a configuration of 0 denotes an input and a configuration of 1 denotes an output. 3.2 STEPPER CONFIG Configures control signals for the stepper power stage. These register bits are directly mapped to the Power Stage hardware pins, so changing the state of any of these bits immediately changes the respective pin at the power stage input. 14 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 15. START ACCEL START STEPPER STOP STEPPER CHANGE SPEED HOME HI HOME LO 0x00 0x01 0x02 0x03 0x04 0x05 OPCODE START STEPPER GPIO 7 Bit 7 Bit 0 GPIO 6 GPIO 5 GPIO 4 GPIO 3 GPIO 2 GPIO 1 GPIO 0 www.ti.com I2 C Protocol and Communications Engine 3.3 GPIO OUT Those GPIO bits which were configured as outputs are configured when writing to this address. Note that writing to this address is equivalent to writing to the MSP430 PxOUT register so only bits which are configured to be outputs on their respective PxDIR register, will react accordingly. Those pins which are configured as inputs will still behave as inputs. 3.4 Current Duty Cycle A register accepting a number from 0 to 249 which then becomes PWM output duty cycle. The current code does not check whether the written is equal or less than 249. Any number larger than 249 will yield a 100% duty cycle PWM. 3.5 START STEPPER This address is more a command than an actual register. A switch case statement decodes the data byte and an action is executed. Possible actions are: Where: START ACCEL starts the stepper motor through at the StartSpeed and ramps up until reaching DesiredSpeed. If no other command is received, motor stops once the NumberOfSteps have been executed. START STEPPER starts the stepper at the StartSpeed. No acceleration occurs. If no other command is received, motor stops once the NumberOfSteps have been executed. STOP STEPPER stops the stepper while ramping down through the deceleration profile. Motor stops as soon as the StartSpeed is reached or the NumberOfSteps have been executed. CHANGE SPEED accelerates or decelerates the stepper depending on whether the actual speed is larger or lesser than the new DesiredSpeed. For this command to work, a new DesiredSpeed must be written while the motor is running. HOME HI starts the motor at the StartSpeed and runs until a transition to HI is observed on the HOME sensor input, or when the NumberOfSteps have been executed. HOME LO starts the motor at the StartSpeed and runs until a transition to LO is observed on the HOME sensor input, or when the NumberOfSteps have been executed. The Start Stepper command will configure the stepping engine parameters such as NumberOfSteps, StepsToStop, StartStepperSpeed, DesiredStepperSpeed, AccelerationRate and DecelerationRate. It will then decode the action parameter and start the stepper motor according to the received command. The I2 C communications are handled by the USCI RX and TX vector interrupts. 15SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 16. #pragma vector=USCIAB0TX_VECTOR //UCA_TRANSMIT on UART/SPI; UCB_RECEIVE, UCB_TRANSMIT on I2C __interrupt void USCI_AB0_Transmit(void) { if (UCB0CTL1 & UCTR) { UCB0CTL1 &= ~UCTR; IFG2 &= ~UCB0TXIFG; } else { SerialBuffer[SerialPointer] = UCB0RXBUF; SerialPointer += 1; if (SerialPointer == SERIAL_BUFFER_LENGTH) { SerialPointer = 0; ParametersTable[ADDRESS] = PARAMETER; switch(ADDRESS) { case GPIO_CONFIG: char tempOut; P1DIR = PARAMETER & 0xC0; //Use 2 MSB's to configure the GPIO Direction on pins P1.7 and P1.6 P2DIR = PARAMETER & 0x3F; //Use 6 LSB's to configure the GPIO direction on pins P2.0 to P2.5 case STEPPER_CONFIG_ADDR: tempOut = P3OUT; tempOut &= ~(nENABLE + MODE0 + MODE1 + MODE2 + DIR); tempOut |= PARAMETER; P3OUT = tempOut; break; case GPIO_OUT_ADDR: P2OUT = PARAMETER; tempOut = P1OUT; tempOut &= ~(BIT7 + BIT6); tempOut |= (PARAMETER & 0xC0); P1OUT = tempOut; break; case CURRENT_DC_ADDR: TA1CCR1 = PARAMETER; break; I2 C Protocol and Communications Engine www.ti.com 16 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 17. case START_STEPPER_ADDR: NumberOfSteps = (ParametersTable[NUMBER_OF_STEPS3_ADDR] << 8) + (ParametersTable[NUMBER_OF_STEPS2_ADDR]); NumberOfSteps *= 65536; NumberOfSteps += (ParametersTable[NUMBER_OF_STEPS1_ADDR] << 8) + ParametersTable[NUMBER_OF_STEPS0_ADDR]; ExecutedSteps = 0; StepsToStop = (ParametersTable[STEPS_TO_STOP3_ADDR] << 8) + (ParametersTable[STEPS_TO_STOP2_ADDR]); StepsToStop *= 65536; StepsToStop += (ParametersTable[STEPS_TO_STOP1_ADDR] << 8) + ParametersTable[STEPS_TO_STOP0_ADDR]; StartStepperSpeed = (ParametersTable[START_SPEED1_ADDR] << 8) + ParametersTable[START_SPEED0_ADDR]; DesiredStepperSpeed = (ParametersTable[DESIRED_SPEED1_ADDR] << 8) + ParametersTable[DESIRED_SPEED0_ADDR]; AccelerationRate = (ParametersTable[ACCEL1_ADDR] << 8) + ParametersTable[ACCEL0_ADDR]; DecelerationRate = (ParametersTable[DECEL1_ADDR] << 8) + ParametersTable[DECEL0_ADDR]; www.ti.com I2 C Protocol and Communications Engine 17SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 18. switch (PARAMETER) { case START_ACCEL: // Start stepper motor at Start speed and until reaching desired speed AccelerationState = ACCEL; ActualStepperSpeed = StartStepperSpeed; AccelTimeCompute(AccelerationRate); TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0 //WDTCTL = 0x5A00 + WDTTMSEL + WDTSSEL + BIT1 + BIT0; break; case START_STEPPER: // Start stepper motor at start speed. Run at this rate. AccelerationState = NOACC; ActualStepperSpeed = StartStepperSpeed; break; case STOP_STEPPER: // Stop motor from current speed, through a deceleration profile and until reaching Start Speed. Then stop and disable stepping engine AccelTimeCompute(DecelerationRate); AccelerationState = STOP; TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0 break; case CHANGE_SPEED: // Modify current speed up or down to Desired Speed. if (DesiredStepperSpeed >= ActualStepperSpeed) { AccelTimeCompute(AccelerationRate); AccelerationState = ACCEL; TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0 } else { AccelTimeCompute(DecelerationRate); AccelerationState = DECEL; TA1CCTL0 |= CCIE; //ENABLE 250 us coordinator interrupt on TA1.0 //WDTCTL = 0x5A00 + WDTTMSEL + WDTSSEL + BIT1 + BIT0; } break; I2 C Protocol and Communications Engine www.ti.com 18 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 19. case HOME_HI: // Move Stepper at Start Speed until the Home Sensor becomes HI. Go through LO if already at HI AccelerationState = NOACC; ActualStepperSpeed = StartStepperSpeed; P1IFG &= ~HOMEIN; P1IES |= HOMEIN; P1IE |= HOMEIN; break; case HOME_LO: // Move Stepper at Start Speed until the Home Sensor becomes LO. Go through HI if already at LO AccelerationState = NOACC; ActualStepperSpeed = StartStepperSpeed; P1IFG &= ~HOMEIN; P1IES &= ~HOMEIN; P1IE |= HOMEIN; break; } if (SpeedCompute(ActualStepperSpeed)) { P3OUT &= ~(nENABLE); P1OUT |= NSLEEP; TA0CCR2 += StepperSpeedTMR; TA0CCR0 = TACCR2 + StepPulseWidth; //2 us at 16 MHz TA0CCTL2 &= ~CCIFG; TA0CCTL2 |= (CCIE + TA0_OUTMOD2_CONF); } break; } } } } www.ti.com I2 C Protocol and Communications Engine 19SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 20. Application Schematic www.ti.com 4 Application Schematic The following page contains the MSP430 and DRV8811/18/24/25 combo board schematic. 20 Intelligent Stepper Motor Driver with DRV8811/18/24/25 SLVA488A–October 2011–Revised January 2014 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 21. 1 1 2 2 3 3 4 4 5 5 6 6 D D C C B B A A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 J1 JTAG GND V3p3 SBWTCK V3p3 GND 0.1uF C1 nSLEEP STEP 1 TP1 VM VM 1 TP2 GND GND 1 TP3 V3P3 0.1uFC5 1 2 3 4 J5 Stepper AOUT1 AOUT2 C3 0.01uF CP1 CP2 0.1uFC6 VCP 0.1uFC4 VM AOUT1 AOUT2 ISENA DECAY nFAULT nSLEEP V3P3OUT BOUT1 BOUT2 ISENB DIR nENABLE STEP MD0 MD1 MD2 .47uFC7 1 2 J2 VM 1 2 3 4 J4 Stepper AOUT1 AOUT2 3.3KR7 .2R6 .2R5 100uF C2 3.3K R1 D1 VM VM BOUT1 BOUT2 BOUT1 BOUT2 GND 0 OUT 1 FB 2 NC 3 GND 4 EN 5 NC 6 NC 7 IN 8 U3 TPS79801 10uF C9 VM 61.9K R11 39K R12 V3p3 TST/SBW 1 DVCC 2 P2.5 3 DVSS 4 P2.7/XOUT 5 P2.6/XIN 6 RST 7 P2.0 8 P2.1 9 P2.2 10 P3.0 11 P3.1 12 P3.2 13 P3.3 14 P3.4/TX 15 P3.5/RX 16 P3.6/TA1.0 17 P3.7/TA1.1 18 P2.3 19 P2.4 20 P1.0/TACLK 21 P1.1/TA0.0 22 P1.2/TA0.1 23 P1.3/TA0.2 24 P1.4/TCK 25 P1.5/TMS 26 P1.6TCLK 27 P1.7/TDI 28 U1 MSP430F2132 CP1 1 CP2 2 VCP 3 VMA 4 AOUT1 5 ISENA 6 AOUT2 7 BOUT2 8 ISENB 9 BOUT1 10 VMB 11 VREF 12 VREF 13 GND 14 V3P3OUT 15 nRESET 16 nSLEEP 17 nFAULT 18 DECAY 19 DIR 20 nENABLE 21 STEP 22 NC 23 MODE0 24 MODE1 25 MODE2 26 nHOME 27 GND 28 GND 0 U2 DRV8825 MD0 MD1 MD2 GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 DIR SDA SCL VREF_PWM nENABLE HOME SBW_TDOI SBWTCK SBW_TDOI GPIO7 GPIO6 330 R2 V3p3 V3p3 1 2 J6 I2C SDA SCL 1 2 3 4 5 6 7 8 9 10 J9 GPIO V3p3 GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 VREF_PWM 0.01uF C8 5.1KR8 3.3KR3 1 2 3 J3 HOME V3p3 HOME ADR0 ADR1 12 Y1 1 2 JMP1 ADR0 ADR0 ADR1 3.3K R9 V3p3 1 2 JMP2 ADR0 3.3K R10 V3p3 3.3KR4 nFAULT TL1 DRV8825Combo 3.3K R13 www.ti.com Application Schematic 21SLVA488A–October 2011–Revised January 2014 Intelligent Stepper Motor Driver with DRV8811/18/24/25 Submit Documentation Feedback Copyright © 2011–2014, Texas Instruments Incorporated
  • 22. IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily performed. TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions. Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in safety-critical applications. In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and requirements. Nonetheless, such components are subject to these terms. No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties have executed a special agreement specifically governing such use. Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and regulatory requirements in connection with such use. TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of non-designated products, TI will not be responsible for any failure to meet ISO/TS16949. Products Applications Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers DLP® Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps DSP dsp.ti.com Energy and Lighting www.ti.com/energy Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial Interface interface.ti.com Medical www.ti.com/medical Logic logic.ti.com Security www.ti.com/security Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video RFID www.ti-rfid.com OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com Wireless Connectivity www.ti.com/wirelessconnectivity Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright © 2014, Texas Instruments Incorporated