Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pulse Width Modulation and Motor Control Mark Barnhill Roy Dong Andrew Kleeves Micajah Worden Dave Seaton Facilitator: Professor Strangas.

Similar presentations


Presentation on theme: "Pulse Width Modulation and Motor Control Mark Barnhill Roy Dong Andrew Kleeves Micajah Worden Dave Seaton Facilitator: Professor Strangas."— Presentation transcript:

1 Pulse Width Modulation and Motor Control Mark Barnhill Roy Dong Andrew Kleeves Micajah Worden Dave Seaton Facilitator: Professor Strangas

2 Agenda Pulse Width Modulation Brushed DC Motor How to Code PWM DACs and PWM Amplification Back EMF Ramp Control PID Controller Motor Characterization PID Simulation

3 Speed Control Duty Cycle Advantages Disadvantages Pulse Width Modulation

4 Field Magnets Stator DC Power Supply Armature or Rotor Axle Commutator Brushes Brushed DC Motor

5 Example here will cover MSP430 – Concepts can be easily extended How to Code PWM

6 One pin has multiple functions – Set PxSEL accordingly – P2DIR |= BIT2;// set P2.2 as output – P2SEL |= BIT2;// use pin as TA1.1 – Why |= operator? Reading the Datasheet

7 Counter counts up each clock cycle What do the different modes mean? – CCR0 = ; – Why minus 1? Setting Timer Values

8 We are using Timer A We must set TACTL – TACTL = TASSEL_2 + MC_1;// SMCLK, up to CCR0 – Which clock do you want to use? Looking into ‘MSP430G2231.h‘

9 We are using Timer A1.1 CCTL1 = OUTMOD_7;// reset at CCR1 ;// set at CCR0 OUTMOD_1 sets at CCRx OUTMOD_2 toggles at CCRx, resets at CCR0 PWM Output Modes

10 We are using Timer A1.1 – Recall: – TACTL = TASSEL_2 + MC_1;// SMCLK, up to CCR0 – CCR0 = ; – CCTL1 = OUTMOD_7;// reset at CCR1 – ;// set at CCR0 – Now: – CCR1 = 200-1;// 20% duty cycle – What will this do? Setting the Duty Cycle

11 DACs are used to convert a digital signal to analog – Why does a PWM signal become a steady DC value? Microprocessors can’t provide enough current to drive a motor DACs and PWM Amplification

12 Back Electromotive Force (EMF) A motor converts electrical energy to mechanical energy This conversion can go both ways If a motor is spinning it will generate electrical energy – Called back emf

13 Example of Back EMF

14 Example of BEMF with a Load

15 Functional Block Diagram of PWM DC Motor Control

16 Is an integrator Adjusts the set point up to the desired value. Ramp Control

17 e(t)= Setpoint - measured Kp, Ki and Kd must be tuned according to desired output characteristics PID Control

18 DC Motor Model

19 R wdg = Ω Voltage (Volts)Current (Amps)Resistance (Ohms) 0.30 V0.23 A1.304 Ω 0.50 V0.39 A1.282 Ω 0.70 V0.56 A1.250 Ω 1.00 V0.79 A1.266 Ω 1.20 V0.88 A1.364 Ω Motor Characterization

20 K = V/rad Motor Characterization Cont.

21 J=0.002; b= ; K= ; R=1.2932; L=0.05; step(K,[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]); RiseTime: SettlingTime: SteadyState: Overshoot: Open Loop Simulation

22 J=0.002; b= ; K= ; R=1.2932; L=0.05; Kp=20; Ki=30; Kd=29; num_PID=[Kd, Kp, Ki]; den_LOOP=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; num_B=conv(K,num_PID); den_B=conv(den_LOOP,[1 0]); [num_SYS,den_SYS]=cloop(num_B,den_B); step(num_SYS,den_SYS) RiseTime: SettlingTime: SteadyState: Overshoot: 0 Kp: 20 Ki: 30 Kd: 29 PID/Closed Loop Simulation


Download ppt "Pulse Width Modulation and Motor Control Mark Barnhill Roy Dong Andrew Kleeves Micajah Worden Dave Seaton Facilitator: Professor Strangas."

Similar presentations


Ads by Google