1590 BDC

Cheap and Easy Control of
Brushed DC and AC Induction
Motors
© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

1

Objectives




Understand brushed DC motors
Learn simple control techniques
Understand Pulse Width Modulation
Explain the benefits of variable speed
control
Explain AC Induction Motor operation
Learn variable speed control technique
for ACIM

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

2

Cheap and Easy Control
of Brushed DC Motors

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

3

1590 BDC Slide 4 . All Rights Reserved.BDC Agenda  BDC Basics    Control Types    DC Motor Construction Motor Types PIC® MCU Peripherals Drive Types Demo using PIC16F1947 © 2011 Microchip Technology Incorporated.

BDC Basics © 2011 Microchip Technology Incorporated. 1590 BDC Slide 5 . All Rights Reserved.

All Rights Reserved. 1590 BDC Slide 6 .BDC Motor  Rotary Parts     Motor Shaft Commutator Windings Stationary Parts   Stator Brushes © 2011 Microchip Technology Incorporated.

All Rights Reserved. 1590 BDC Slide 7 .BDC Rotor    The rotor shaft mounts to the case with either bearings or bushings The rotor is supplied current through a commutator Multiple windings in laminated steel Shaft Commutator Windings © 2011 Microchip Technology Incorporated.

All Rights Reserved. Electromagnetic windings 1590 BDC Slide 8 .BDC Stator    Mounts to the inside of the case Surrounds the Rotor / Armature Generates a stationary magnetic field Permanent magnets © 2011 Microchip Technology Incorporated.

1590 BDC Slide 9 . All Rights Reserved.BDC Motor Types      The type of stator defines the motor Permanent Magnet Shunt – wound Series – wound Compound – wound  Shunt + Series © 2011 Microchip Technology Incorporated.

limited due to constant stator field    Good low end ( low speed ) torque Limited high end ( high speed ) torque Responds very quickly to voltage changes (good speed control) Brushes DC Voltage Supply N Rotor S Permanent Magnetic Poles  Drawback. All Rights Reserved.Permanent Magnet     Most common Used in fractional horsepower applications More cost effective than wound stators Torque. 1590 BDC Slide 10 . Magnets lose their magnetic properties over time © 2011 Microchip Technology Incorporated.

Shunt Wound      Decreasing torque at high speed At low speed. higher more consistent torque Excellent speed control Typically used in Industrial and automotive applications No loss of magnetism over time as with PMDC motors ITot DC Voltage Supply ITot = IShunt + IMotor IShunt Shunt Field IShunt ↓ IMotor IMotor ↑ Rotor Brushes Heavy Load   More expensive than PMDC motors Motor Runaway. if the shunt current goes to zero © 2011 Microchip Technology Incorporated. 1590 BDC Slide 11 . All Rights Reserved.

examples: cranes and winches I = ISeries + IMotor Series Field DC Voltage Supply I Rotor Brushes Heavy Load     Poor high speed torque ( high end ) More expensive than PMDC Poor speed control due to the series stator field Motor Runaway. speed increases sharply Ideally suited for heavy loads. All Rights Reserved. as load is removed.Series Wound  Great slow speed torque ( low end )   But. 1590 BDC Slide 12 . if the series field is shorted © 2011 Microchip Technology Incorporated.

SWDC motors Great for Industrial and automotive applications. All Rights Reserved. and SWDC © 2011 Microchip Technology Incorporated. Example: generators Motor Runaway. SHWDC. SHWDC motors Great speed control.Compound Wound      Has the performance properties of both SHWDC and SWDC motors High torque at low speed w/ heavy loads. less likely b/c shunt current must go to zero and series field must short ITot DC Voltage Supply ITot = I1 + I2 Series Field I2 I2 = ISeries + IMotor Shunt Field Rotor Brushes IShunt = I1  Heavy Load More expensive then PMDC. 1590 BDC Slide 13 .

Brushes and Commutation Commutator Brushes © 2011 Microchip Technology Incorporated. 1590 BDC Slide 14 . All Rights Reserved.

Brushes and Commutation Stator Magnets Rotor Windings Brushes Commutator Terminals © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 15 .

Control Types © 2011 Microchip Technology Incorporated. 1590 BDC Slide 16 . All Rights Reserved.

1590 BDC Slide 17 .Control Types  Chopper    Half Bridge    Low Side Drive High Side Drive Low Side Drive High Side Drive Full Bridge (H-Bridge)  Bi-directional © 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC Slide 18 . All Rights Reserved.Low Side Drive  Simple On/Off One I/O port to control No high side driver Inexpensive  One direction   D1 Motor  Micro R1 Controlled SW1 R2 © 2011 Microchip Technology Incorporated.

D1 1590 BDC Slide 19 .High Side Drive High Side Drive   One direction  R2 Micro One I/O port to control High side driver needed Simple On/Off Safety   R1 SW1 Controlled Motor © 2011 Microchip Technology Incorporated. All Rights Reserved.

All Rights Reserved.Half Bridge VBUS Low Side Drive Motor D1 SW2 OFF Micro Controlled ON Micro SW1 Controlled Forward © 2011 Microchip Technology Incorporated. 1590 BDC Slide 20 .

All Rights Reserved.Half Bridge VBUS Low Side Drive Motor D1 Micro SW2 ON Controlled OFF SW1 Micro Controlled Brake © 2011 Microchip Technology Incorporated. 1590 BDC Slide 21 .

1590 BDC Slide 22 . All Rights Reserved.Half Bridge VBUS Low Side Drive Motor D1 Micro SW2 ON Controlled ON SW1 Micro Controlled Warning © 2011 Microchip Technology Incorporated.

All Rights Reserved. 1590 BDC Slide 23 .Half Bridge VBUS High Side Drive Micro SW1 ON Controlled Micro OFF Controlled SW2 D1 Motor Forward © 2011 Microchip Technology Incorporated.

Half Bridge VBUS High Side Drive Micro SW1 OFF Controlled Micro ON SW2 Controlled D1 Motor Brake © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 24 .

Half Bridge VBUS High Side Drive Micro SW1 Controlled ON Micro Controlled ON SW2 D1 Motor Warning © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 25 .

Half Bridge  Advantages    Ability to brake the motor Safety (High Side Drive) Disadvantages  Only one direction  More parts. 2 outputs to control  Shoot-Through (both FETS ON) © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 26 .

1590 BDC Slide 27 . All Rights Reserved.Full Bridge VBUS D1 Micro Controlled Micro Controlled D2 ON SW3 OFF OFF ON SW1 SW2 Motor SW4 D3 D4 Micro Controlled Micro Controlled Forward © 2011 Microchip Technology Incorporated.

1590 BDC Slide 28 .Full Bridge VBUS D1 Micro Controlled Micro Controlled SW1 OFF ON SW2 D2 Motor D3 D4 Micro SW3 ON Controlled OFF Micro SW4 Controlled Reverse © 2011 Microchip Technology Incorporated. All Rights Reserved.

Full Bridge VBUS D1 D2 Micro Controlled Micro Controlled SW1 OFF ON SW2 SW3 OFF Motor ON SW4 D3 D4 Micro Controlled Micro Controlled Brake © 2011 Microchip Technology Incorporated. 1590 BDC Slide 29 . All Rights Reserved.

Full Bridge VBUS D1 Micro Controlled Micro Controlled SW1 ON ON SW2 D2 SW3 ON Motor ON SW4 D3 D4 Micro Controlled Micro Controlled Warning © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 30 .

All Rights Reserved.Full Bridge  Advantages     Bi-Directional control Braking Safety (High Side Drive) Disadvantages  Most complicated  4 outputs to control  Shoot-Through (both FETS ON) © 2011 Microchip Technology Incorporated. 1590 BDC Slide 31 .

All Rights Reserved.Topology Review  Chopper   Simple. two output control  Adds the Braking features  Full Bridge  Most complicated  Adds the features of Braking and Reverse © 2011 Microchip Technology Incorporated. one output control Fewest features  Half Bridge  A little more complex. 1590 BDC Slide 32 .

1590 BDC Slide 33 .Speed Control © 2011 Microchip Technology Incorporated. All Rights Reserved.

All Rights Reserved.Firmware Control VBUS D1 Motor  Simple On/Off  Firmware intensive  Lots of attention to control Micro R1 Controlled SW1 R2 © 2011 Microchip Technology Incorporated. 1590 BDC Slide 34 .

All Rights Reserved.Volt = VoltageSupply Duty Cycle = VDD Pulse Width Period © 2011 Microchip Technology Incorporated.PWM Control (Pulse Width Modulation) We control the speed by varying the voltage across the motor Voltage Across MotorAvg. (Pulse Width / Period) 1590 BDC Slide 35 .

PWM Control Voltage Source MOUTON MOTOR COMPANY PWM Equates to © 2011 Microchip Technology Incorporated. 1590 BDC Slide 36 . All Rights Reserved.

All Rights Reserved.PWM Control  Brushed DC Motor acts like an Inductor  Current doesn’t change instantaneously  As inductance increases. 1590 BDC Slide 37 . the slower the current changes  V(t) = L di/dt  Voltage across motor is directly proportional to RPM  100% RPM = 100% Duty cycle © 2011 Microchip Technology Incorporated.

PWM Control Voltage Across Motor Actual Current Average Current Time Accelerate Decelerate © 2011 Microchip Technology Incorporated. All Rights Reserved. Voltage Actual Current Average Current 1590 BDC Slide 38 .

CCP Capture/Compare/PWM © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 39 .

PWM Control Signal Period Pulse Width TMR2 = PR2 TMR2 = 0 TMR2 = CCPR1L:CCP1CON(<5:4>) Equations Period PWM(seconds) = (PR2 + 1) 4 Tosc TMR2 Prescaler Duty Cycle PWM(ratio) = (CCPR1L:CCP1CON<5:4>) / 4 ( PR2 + 1 ) © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 40 .

1590 BDC Slide 41 . All Rights Reserved.ECCP (Enhanced Capture/Compare/PWM) © 2011 Microchip Technology Incorporated.

PWM Control  Half-Bridge PWM  Generates a PWM signal on two outputs Microcontroller P1A Modulated P1B Modulated © 2011 Microchip Technology Incorporated. 1590 BDC Slide 42 . All Rights Reserved.

PWM Control Examples: VDD ON © 2011 Microchip Technology Incorporated. 1590 BDC Slide 43 . All Rights Reserved.

Forward Mode  All four pins are used as outputs Microcontroller High P1A Active P1B Inactive Low P1C Inactive Low P1D Modulated © 2011 Microchip Technology Incorporated.PWM Control  Full-Bridge PWM. 1590 BDC Slide 44 . All Rights Reserved.

1590 BDC Slide 45 .PWM Control Example: Microcontroller ON ON © 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC Slide 46 .PWM Control  Full-Bridge PWM. All Rights Reserved. Reverse Mode  All four pins are used as outputs Microcontroller Low P1A Inactive P1B Modulated High P1C Active Low P1D Inactive © 2011 Microchip Technology Incorporated.

PWM Control Example: Microcontroller ON ON © 2011 Microchip Technology Incorporated. 1590 BDC Slide 47 . All Rights Reserved.

Board © 2011 Microchip Technology Incorporated. 1590 BDC BDC Add-on Slide 48 .BDC Demos F1 LV Eval. All Rights Reserved.

All Rights Reserved. 1590 BDC Slide 49 .BDC DEMOS © 2011 Microchip Technology Incorporated.

Further Reading        AN847 – RC Model Aircraft Motor Control AN893 – Low-Cost Bidirectional Brushed DC Motor Control Using the PIC16F684 AN894 – Motor Control Sensor Feedback Circuits AN898 – Determining MOSFET Driver Needs for Motor Drive Applications AN905 – Brushed DC Motor Fundamentals DS41233 – DC Motor Control Tips ‘n Tricks DS41214 – CCP and ECCP Tips ‘n Tricks © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 50 .

All Rights Reserved. 1590 BDC Slide 51 .Cheap and Easy Variable Speed ACIM Control © 2011 Microchip Technology Incorporated.

1590 BDC Slide 52 .ACIM Agenda     Benefits of variable speed ACIM control 3-ph ACIM Basics  Motor construction  How does an ACIM produce torque? Variable Speed Control  Hardware Requirements  V/Hz Control Method  Software for V/Hz Control Demo using PIC16LF1947 © 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC Slide 53 . All Rights Reserved.Variable Speed Benefits    AC induction motors designed to operate from line power Operate motor at reduced load when possible  Example – fans. pumps Replace inefficient mechanical drive-train with variable speed  Typical chain/sprocket drive – 90%  Typical pulley drive – 93%  Typical worm gear drive – 69% © 2011 Microchip Technology Incorporated.

All Rights Reserved.ACIM Basics © 2011 Microchip Technology Incorporated. 1590 BDC Slide 54 .

All Rights Reserved. 1590 BDC Slide 55 .ACIM Stator Terminal box Motor casing Stator coils Stator slots © 2011 Microchip Technology Incorporated.

AC Stator Stator supplied with 3-phase AC voltage source for fixed speed operation Va © 2011 Microchip Technology Incorporated. 3 Phase ACIM Vb 1590 BDC Vc Slide 56 . All Rights Reserved.

ACIM Stator  Rotating flux   Generated by alignment of 3 phase windings on Stator Synchronous speed of field depends on number of poles   2 pole@ 60 Hz. 1590 BDC Slide 57 . 1800 rpm © 2011 Microchip Technology Incorporated. 3600 rpm 4 pole(shown) @ 60 Hz. All Rights Reserved.

ACIM Rotor Bearings Driving end Shorting rings © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Internal fan Slide 58 .

the motor must have slip to operate © 2011 Microchip Technology Incorporated.ACIM Rotor    Rotor currents generated by stator field Energized rotor generates a secondary field. All Rights Reserved. 1590 BDC Slide 59 . allowing motor to produce torque Field speed must be different from rotor speed.

ACIM Equations Flux Im Torque Is Im ns Ir Ir © 2011 Microchip Technology Incorporated. S 120 f p ns 0 S 1 nr ns 1590 BDC Slide 60 . All Rights Reserved.

5 1590 BDC -1. All Rights Reserved. 0 -0.ACIM Torque vs.0 0. Slip Torque Stall Torque Starting Torque Operating Point Motor Braking Synchronous Speed Rotor Speed Generator SLIP 1.5 © 2011 Microchip Technology Incorporated.0 Slide 61 .5 1.

1590 BDC Slide 62 .Variable Speed Control © 2011 Microchip Technology Incorporated. All Rights Reserved.

ACIM Torque vs. Slip
Variable Frequency
15 Hz

30 Hz

45 Hz

60 Hz

Torque

Variable Speed Operating Region

Rotor Speed

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

63

V/Hz Profile
240

Volts RMS

200

160

High Amplitude
Limit

Boost
Region

120
Constant V/F
Region

80

40
Low Frequency
Cutoff
20

40

60

Frequency (Hz)
© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

64

V/Hz Control

PID
r

+-

Limits

VF curve

e

P
W
M

Motor

f

Feedback
device

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

65

1590 BDC Slide 66 . All Rights Reserved.ACIM Hardware © 2011 Microchip Technology Incorporated.

All Rights Reserved. 1590 BDC Slide 67 .Resources For 3-Phase ACIM  Need 1 Timer and 3 ECCPS  PIC16F193X  PIC16F194X  PIC18F2XK22  PIC18F4XK22 ECCP1 Timer2 ECCP2 Timer4 ECCP3 CCP4 Timer6 CCP5 © 2011 Microchip Technology Incorporated.

1590 BDC Slide 68 .ACIM Inverter +V P1A ECCP1 P1B P2A P3A P2B 3 Phase ACIM P3B ECCP2 ECCP3 Timer2 © 2011 Microchip Technology Incorporated. All Rights Reserved.

All Rights Reserved. 1590 BDC Slide 69 .Dead Time   Use ECCPs in half bridge mode with dead time ECCP duty cycle will set average voltage applied to motor phase Dead Time P1A P1A P1B P1B © 2011 Microchip Technology Incorporated.

1590 BDC Slide 70 .Software Implementation © 2011 Microchip Technology Incorporated. All Rights Reserved.

All Rights Reserved.Sinusoidal PWM Modulation     PWM voltage applied to each motor phase Motor integrates PWM voltage and produces sinusoidal current with small ripple at carrier frequency Average phase current proportional to duty cycle Duty cycle for each phase is modulated over time to get desired frequency and phase © 2011 Microchip Technology Incorporated. Motor Phase Current VDC PWM Applied to Motor Phase 1590 BDC Slide 71 .

1590 BDC Phase angle 0x0000 0 deg 0x4000 90 deg 0x5555 120 deg 0x8000 180 deg 0xAAAA 240 deg 0xFFFF 359.Modulation Function    Lookup from wavetable of size 2N Wavetable contains one cycle of waveshape Use 16-bit variable to track phase © 2011 Microchip Technology Incorporated.99 deg Slide 72 . All Rights Reserved.

All Rights Reserved. 1590 BDC Slide 73 .Modulation Function    Phase variable will be used as index to LUT Periodically add a constant value to Phase variable to create the desired frequency Adjust adder value to change frequency © 2011 Microchip Technology Incorporated.

Modulation Function 15 Phase 0 Add at Timer interrupt DeltaPhase 6-bit lookup index © 2011 Microchip Technology Incorporated. All Rights Reserved. ‘DeltaPhase’ value is added to ‘Phase’ value at a fixed periodic rate to set the modulation frequency 64 Entry Sine Wave Table 1590 BDC Slide 74 .

44.7. -22.-82.-50.23.-46.85.-56.48.-24.-90. -90.71.-5.-88.-90.-65.82.89.31.71.-32.-67.60.54.-44.-78.20.-13}.-18.36.Sinusoidal PWM Modulation Motor Phase Current VDC const int Wave[] = {0.-78.42.77.-9.81.34. All Rights Reserved. DutyCycle Wave[index ] Amplitude HALF _ DUTY © 2011 Microchip Technology Incorporated.11. 1590 BDC Slide 75 .76.-13.-1.25.16. 66.-87.88.-27.54.88.84.-36.-56.-62.87.-38.3.-73.-86.-84.63.11.

All Rights Reserved.Phase Offsets      We need LUT values for 3 phases Add 0x5555 to Phase to get Phase 2 lookup value Add 0xAAAA to Phase to get Phase 3 lookup value Each lookup value is then scaled to set amplitude 8-bit match used for scaling to conserve 8-bit CPU resources © 2011 Microchip Technology Incorporated. 1590 BDC Slide 76 .

1590 BDC Slide 77 .Modulation Interrupt Rate and Modulation Frequency  Modulation Frequency  PWM Frequency = 20. All Rights Reserved.000 Hz  Postscaler = 10:1  2000 Hz interrupt rate f mod  2000 DeltaPhase 16 2 DeltaPhase 0. DeltaPhase = 1966 © 2011 Microchip Technology Incorporated.0305 For 60 Hz.

Wave Lookup Table    Motor ‘sees’ line-line voltage. NOT phase voltage Sinusoidal modulation does not make maximum use of inverter DC bus Because of 3-phase system. 1590 BDC Slide 78 . only get 86% of DC bus line-to-line © 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC Slide 79 .Sine Wavetable 1.50 Sine Va Sine Vb Line to Line 0.50 -1.00 0 60 120 180 240 300 -0.50 Modulation Index 1. All Rights Reserved.00 Angle (degrees) © 2011 Microchip Technology Incorporated.00 0.

50 -1.50 0.00 -1.00 0 60 120 180 240 300 Va Vb Line to Line -0.Sine + 3rd Harmonic 86% fundamental + 14% 3rd harmonic 1. 1590 BDC Slide 80 .50 © 2011 Microchip Technology Incorporated. All Rights Reserved.00 0.50 1.

V/Hz Profile    User speed input needs to be translated to a voltage and frequency For our demo. All Rights Reserved. DeltaPhase 0 ADCresult 2 DeltaPhase 2046 ADCresult ModVoltage 8 0 ModVoltage 127 1590 BDC Slide 81 . we will use a potentiometer Translate ADC result to simple linear profile © 2011 Microchip Technology Incorporated.

1590 BDC Slide 82 . All Rights Reserved.Modulation Function Benchmarks   PIC16F1XXX + HI-TECH C® Compiler  742 Cycles  19% CPU at 2000 Hz rate PIC18 + C18 Compiler  524 cycles  7% CPU at 2000 Hz rate © 2011 Microchip Technology Incorporated.

All Rights Reserved. and DSC solutions provide:  Algorithms for better dynamic response  Algorithms to eliminate sensors 8-bit fine for many applications © 2011 Microchip Technology Incorporated.Processor Choice   16-bit. 32 bit. 1590 BDC Slide 83 .

ACIM Demo © 2011 Microchip Technology Incorporated. All Rights Reserved. 1590 BDC Slide 84 .

All Rights Reserved. 1590 BDC Slide 85 .ACIM Summary    8-bit MCUs with the right stuff can readily support variable speed ACIM Some apps may require 16-bit performance Questions? © 2011 Microchip Technology Incorporated.

Appendix
ACIM Source Code and Device

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

86

PIC16 Devices for ACIM
Pins

LCD

10-bit
ADC

Timers
8b/16b

ECCP/
CCP

COMM’S

256

28

60

11

4/1

3/2

UART, I2C™, SPI

256

256

40/44

96

14

4/1

3/2

UART, I2C, SPI

8K

512

256

28

60

11

4/1

3/2

UART, I2C, SPI

Now

8K

512

256

40/44

96

14

4/1

3/2

UART, I2C, SPI

PIC16F1938

Now

16K

1K

256

28

60

11

4/1

3/2

UART, I2C, SPI

PIC16F1939

Now

16K

1K

256

40/44

96

14

4/1

3/2

UART, I2C, SPI

PIC16F1946

Now

8K

512

256

64

184

17

4/1

3/2

2xUART, 2xI2C,
2xSPI

PIC16F1947

Now

16K

1K

256

64

184

17

4/1

3/2

2xUART, 2xI2C,
2xSPI

FLASH RAM
DataEE
(Words) (Bytes) (Bytes)

Device

Available

PIC16F1933

Now

4K

256

PIC16F1934

Now

4K

PIC16F1936

Now

PIC16F1937

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

87

PIC18 Devices for ACIM

© 2011 Microchip Technology Incorporated. All Rights Reserved.

1590 BDC

Slide

88

WriteDutyCCP3(PWM.TMR2IF) { PIR1bits. // Write the new duty cycles to the PWM outputs WriteDutyCCP1(PWM.Phase2).Phase3).Phase. WriteDutyCCP2(PWM. // Add phase difference to adjust modulation angle Phase += Delta_Phase. // Perform sine + 3rd harmonic modulation Modulate(ModVoltage.Phase1).Interrupt Service Routine static void interrupt ISR(void) { if(PIR1bits.&PWM). All Rights Reserved. } } © 2011 Microchip Technology Incorporated. 1590 BDC Slide 89 .TMR2IF = 0.

// Calculate the duty cycle for Phase 1 phase_index. 1590 BDC Slide 90 .ui += ONE_TWENTY_DEG. // Introduce a 50% offset into the sine value. dutycycle->Phase2 = (temp << 2) + HALF_DUTY. temp = (temp * volts) >> 7.uc[1] >> 2]. temp = sinplus3rd[phase_index. except for the phase offset. unsigned int angle. temp = (temp * volts) >> 7. }phase_index. unsigned char uc[2]. temp = (temp * volts) >> 7. } © 2011 Microchip Technology Incorporated. // Calculate the duty cycle for Phase 3 // Everything is the same as phase 1.uc[1] >> 2]. // Calculate the duty cycle for Phase 2 // Everything is the same as phase 1. // Get the lookup value using upper 6 bits of phase index. tDuty *dutycycle) { union{ unsigned int ui.uc[1] >> 2]. temp = sinplus3rd[phase_index. dutycycle->Phase1 = (temp << 2) + HALF_DUTY. phase_index. int temp. phase_index.ui = angle. temp = sinplus3rd[phase_index. // Scale the sine table value by the volts parameter.Modulate () Function void Modulate(int volts. except for the phase offset.ui += ONE_TWENTY_DEG. if(volts > 127) volts = 127. dutycycle->Phase3 = (temp << 2) + HALF_DUTY. All Rights Reserved.

Torque ↑ © 2011 Microchip Technology Incorporated. IMotor ↑. IShunt ↓. stator/rotor field ↑. speed ↑. rotor field ↑. All Rights Reserved.Shunt Wound ITot DC Voltage Supply ITot = IShunt + IMotor IShunt Shunt Field IShunt ↓ IMotor IMotor ↑ Rotor Brushes Heavy Load   As VSupply ↑. 1590 BDC Slide 91 . stator field ↓. Torque ↓ As motor load ↑. speed ↓. ITot ↑.

Stator/Rotor field ↑. speed ↓. speed ↑. All Rights Reserved. I ↑. I ↑. Stator/Rotor field ↑. 1590 BDC Slide 92 . Torque ↓ As motor load ↑. Torque ↑ © 2011 Microchip Technology Incorporated.Series Wound I = ISeries + IMotor Series Field DC Voltage Supply I Rotor Brushes Heavy Load   As VSupply ↑.

IShunt ↓. 1590 BDC Slide 93 . I2 ↑. Series field/Rotor field ↑. All Rights Reserved.Compound Wound ITot = I1 + I2 Series Field ITot I2 = ISeries + IMotor I2 DC Voltage Supply Shunt Field Rotor IShunt = I1   Brushes Heavy Load As motor load ↑. speed ↓. thus torque ↑ © 2011 Microchip Technology Incorporated. shunt field ↓.

ECAN. HI-TECH C. Linear Active Thermistor. dsPICDEM. dsPICworks. PICDEM.S. dsSPEAK. and other countries. All Rights Reserved. dsPICDEM. SQTP is a service mark of Microchip Technology Incorporated in the U. Total Endurance. rfPIC and UNI/O are registered trademarks of Microchip Technology Incorporated in the U. Microchip Technology Incorporated. PICtail. SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U. PICmicro. PICC. FanSense. MPLINK. PICC-18. MPLAB Certified logo. PICDEM. rfLAB. HI-TIDE. PIC32 logo. All other trademarks mentioned herein are property of their respective companies.Trademarks       The Microchip name and logo.A. CodeGuard. PIC. mTouch.S. MXDEV. Application Maestro. Select Mode.net. Hampshire. ECONOMONITOR. © 2011. dsPIC. REAL ICE.S. chipKIT logo. © 2011 Microchip Technology Incorporated.net. MiWi.A. Mindi. 1590 BDC Slide 94 .A. and other countries.S. FilterLab. MPLAB. PICkit. KeeLoq. the Microchip logo.A. Omniscient Code Generation. KeeLoq logo. All Rights Reserved. UniWinDriver. Analog-for-the-Digital Age. MPLIB. MPASM. MXLAB. chipKIT. PICSTART. TSHARC. In-Circuit Serial Programming. ICSP. WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.