12
Pulse Width Modulation H-Bridge and Servo Drivers

Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

Pulse Width Modulation

H-Bridge and Servo Drivers

Page 2: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

H-Bridge Motor Drivers

Page 3: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

Transistor Switch

Page 4: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

Enable/Direction Control

Page 5: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

PWM for Speed Control

Page 6: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

Pop Quiz

On the previous slide, calculate the average voltage for each waveform. Take the ON condition to be +5 Volts and the OFF condition to be 0 Volts. VAVG is defined as:

VT

V t dtAVG

T

= ∫1

0

( )

Don’t do any c_____! Just add up the areas of rectangles until you have the total area over a complete period and then divide by the period.

Page 7: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

Pop Quiz #2

Now calculate the RMS voltage for each waveform. Take the ON condition to be +5 Volts and the OFF condition to be 0 Volts. VRMS is defined as:

VT

V t dtRMS

T

= ∫[ ( ) ]1 2

0

Don’t do any c_____! Just add up the areas of rectangles formed by V2 until you have the total area over a complete period, and then divide by the period. Then take the square root. Sketch VAVG and VRMS as functions of duty cycle.

Page 8: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM
Page 9: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

The Servo Motor

Page 10: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM
Page 11: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

SummaryH-Bridge Servo

• PWM sets duty cycle.• Power is proportional

to VRMS. VAVG is proportional to duty cycle. (close enough)

• Frequency is not important. Typically from 50 Hz to 1000 Hz.

• PWM sets pulse width.

• Pulse width gives the desired position of the servo motor.

• Repetition rate is not very important. Typically from 14 to 20 ms.

Page 12: Pulse Code Modulation - Austin Community College DistrictPulse Width Modulation H-Bridge and Servo Drivers. H-Bridge Motor Drivers. Transistor Switch. Enable/Direction Control. PWM

PWM Mini-Lab A typical pulse train for motor speed control has a frequency of 50 Hz and a 50% duty cycle. Let’s build our own version of this pulse train using sleep commands (actually use msleep(Long Integer) for minimal overhead) . . while (1) { fd(0); fd(3); msleep(10L); // first msleep ao(); msleep(10L); // second msleep } . . I Code your Handy Buggy to move ahead with a 50 Hz, 50% duty cycle pulse train. Time your Buggy over a short course (say 1 or 2 meters). Traverse the same course using: while (1) { motor (0,50); motor (3,50); } and compare the performances. II Complete the following table: frequency (Hz) duty cycle (%) first msleep (ms) second msleep (ms)

50 50 10 10 50 25 50 75 100 50 100 10 100 90 500 50

III. Test these “homemade” pulse trains, as time permits, and compare with “motor ()“ implementations. Do the “homemade” implementations appear jerkier? Does Buggy “drift right” or “drift left” to a greater degree?