Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry...
Transcript of Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry...
![Page 1: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/1.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
ElectronicsPulse Width Modulation Sensors
Terry Sturtevant
Wilfrid Laurier University
February 1, 2018
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 2: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/2.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Pulse Width Modulation Sensors
Analog information can be communicated over digital signalsThis can be done by varying the width or spacing of digitalpulsesThis is called Pulse Width Modulation, PWMThis document gives a few examples.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 3: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/3.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Pulse Width Modulation Sensors
Analog information can be communicated over digital signals
This can be done by varying the width or spacing of digitalpulsesThis is called Pulse Width Modulation, PWMThis document gives a few examples.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 4: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/4.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Pulse Width Modulation Sensors
Analog information can be communicated over digital signalsThis can be done by varying the width or spacing of digitalpulses
This is called Pulse Width Modulation, PWMThis document gives a few examples.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 5: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/5.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Pulse Width Modulation Sensors
Analog information can be communicated over digital signalsThis can be done by varying the width or spacing of digitalpulsesThis is called Pulse Width Modulation, PWM
This document gives a few examples.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 6: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/6.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Pulse Width Modulation Sensors
Analog information can be communicated over digital signalsThis can be done by varying the width or spacing of digitalpulsesThis is called Pulse Width Modulation, PWMThis document gives a few examples.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 7: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/7.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoders
Absolute position sensingdoesn’t use PWMIncremental rotary encodinguses PWM
As long as you know the initial position, you can update if you cansense changes.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 8: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/8.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoders
Absolute position sensing
doesn’t use PWMIncremental rotary encodinguses PWM
As long as you know the initial position, you can update if you cansense changes.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 9: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/9.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoders
Absolute position sensingdoesn’t use PWM
Incremental rotary encodinguses PWM
As long as you know the initial position, you can update if you cansense changes.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 10: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/10.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoders
Absolute position sensingdoesn’t use PWMIncremental rotary encoding
uses PWM
As long as you know the initial position, you can update if you cansense changes.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 11: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/11.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoders
Absolute position sensingdoesn’t use PWMIncremental rotary encodinguses PWM
As long as you know the initial position, you can update if you cansense changes.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 12: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/12.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoders
Absolute position sensingdoesn’t use PWMIncremental rotary encodinguses PWM
As long as you know the initial position, you can update if you cansense changes.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 13: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/13.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder wheelTwo sensors will allow determination of rotation speed andangle
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 14: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/14.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder wheel
Two sensors will allow determination of rotation speed andangle
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 15: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/15.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder wheelTwo sensors will allow determination of rotation speed andangle
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 16: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/16.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 17: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/17.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 18: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/18.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 19: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/19.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 20: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/20.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Counter-clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 21: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/21.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Counter-clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 22: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/22.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Counter-clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 23: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/23.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
AB
Counter-clockwise
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 24: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/24.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing11
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 25: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/25.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing01
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 26: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/26.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing01
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 27: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/27.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing01
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 28: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/28.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing00
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 29: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/29.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing00
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 30: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/30.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing10
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 31: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/31.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing10
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 32: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/32.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing10
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 33: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/33.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Shaft encoder timing11
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 34: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/34.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Speed of rotation from frequency of either channel
Angle of rotation from combination
Here’s an example from an actual motor.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 35: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/35.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Speed of rotation from frequency of either channelAngle of rotation from combination
Here’s an example from an actual motor.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 36: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/36.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Speed of rotation from frequency of either channelAngle of rotation from combination
Here’s an example from an actual motor.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 37: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/37.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 38: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/38.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
00
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 39: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/39.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
10
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 40: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/40.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
11
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 41: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/41.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
01
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 42: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/42.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 43: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/43.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
00
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 44: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/44.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
01
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 45: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/45.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
11
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 46: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/46.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
10
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 47: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/47.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
One direction
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 48: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/48.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Other direction
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 49: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/49.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Period is 5 divisions
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 50: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/50.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
�� ��Period is 5 divisionsTime scale is 500µS per division
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 51: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/51.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Period is 5 divisions → 2500µS = 2.5mSTime scale is 500µS per division
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 52: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/52.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Period is 5 divisions → 2500µS = 2.5mS30 slots per revolution × 2.5mS
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 53: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/53.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Period is 2.5mS30 slots per revolution × 2.5mS → 75ms per revolution
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 54: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/54.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Period is 2.5mS × 30 → 75ms per revolution75/1000 seconds per revolution → 13.33 rev./second
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 55: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/55.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Period is 2.5mS × 30 → 75ms per revolution75/1000 seconds per revolution → 13.33 rev./second× 60 → 800 RPM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 56: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/56.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Ultrasonic sensors
Transmitter sends out pulseReceiver registers echo
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 57: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/57.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Ultrasonic sensors
Transmitter sends out pulse
Receiver registers echo
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 58: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/58.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Ultrasonic sensors
Transmitter sends out pulseReceiver registers echo
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 59: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/59.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
transmit
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 60: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/60.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
transmit
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 61: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/61.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
transmit
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 62: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/62.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
transmit
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 63: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/63.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
transmitreceive
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 64: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/64.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
�
transmitreceive
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 65: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/65.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
�
transmitreceive
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 66: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/66.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
-
�
transmitreceive
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 67: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/67.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Time from beginning of transmit to beginning of receiveallows distance to be calculated
since 2d = vtwhere v is the speed of sound
Why is it 2d?
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 68: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/68.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Time from beginning of transmit to beginning of receiveallows distance to be calculatedsince 2d = vtwhere v is the speed of sound
Why is it 2d?
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 69: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/69.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
Time from beginning of transmit to beginning of receiveallows distance to be calculatedsince 2d = vtwhere v is the speed of sound
Why is it 2d?
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 70: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/70.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
V to F and F to V converters
V to F converters take in an analog voltage and produce astring of digital pulses where the frequency is proportional tothe input analog voltageF to V converters take in a string of digital pulses andproduce an analog voltage where the analog voltage isproportional to the input frequency
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 71: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/71.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
V to F and F to V converters
V to F converters take in an analog voltage and produce astring of digital pulses where the frequency is proportional tothe input analog voltage
F to V converters take in a string of digital pulses andproduce an analog voltage where the analog voltage isproportional to the input frequency
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 72: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/72.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Shaft encodersUltrasonic sensorsV to F and F to V converters
V to F and F to V converters
V to F converters take in an analog voltage and produce astring of digital pulses where the frequency is proportional tothe input analog voltageF to V converters take in a string of digital pulses andproduce an analog voltage where the analog voltage isproportional to the input frequency
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 73: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/73.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM Control
p = GPIO.PWM(channel, frequency)open channel at given frequencyp.start(dc)start at given duty cycle (percent)p.ChangeFrequency(freq)change frequencyp.ChangeDutyCycle(dc)change duty cycle (percent)p.stop()stop PWM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 74: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/74.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM Control
p = GPIO.PWM(channel, frequency)open channel at given frequency
p.start(dc)start at given duty cycle (percent)p.ChangeFrequency(freq)change frequencyp.ChangeDutyCycle(dc)change duty cycle (percent)p.stop()stop PWM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 75: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/75.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM Control
p = GPIO.PWM(channel, frequency)open channel at given frequencyp.start(dc)start at given duty cycle (percent)
p.ChangeFrequency(freq)change frequencyp.ChangeDutyCycle(dc)change duty cycle (percent)p.stop()stop PWM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 76: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/76.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM Control
p = GPIO.PWM(channel, frequency)open channel at given frequencyp.start(dc)start at given duty cycle (percent)p.ChangeFrequency(freq)change frequency
p.ChangeDutyCycle(dc)change duty cycle (percent)p.stop()stop PWM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 77: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/77.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM Control
p = GPIO.PWM(channel, frequency)open channel at given frequencyp.start(dc)start at given duty cycle (percent)p.ChangeFrequency(freq)change frequencyp.ChangeDutyCycle(dc)change duty cycle (percent)
p.stop()stop PWM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 78: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/78.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM Control
p = GPIO.PWM(channel, frequency)open channel at given frequencyp.start(dc)start at given duty cycle (percent)p.ChangeFrequency(freq)change frequencyp.ChangeDutyCycle(dc)change duty cycle (percent)p.stop()stop PWM
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 79: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/79.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM sample code
impor t t imeimpor t RPi . GPIO as GPIOGPIO . setmode (GPIO .BOARD)GPIO . s e tup (12 , GPIO .OUT)p = GPIO .PWM(12 , 50) # chan=12 f r e q =50Hzp . s t a r t (0 )t r y :
w h i l e 1 :f o r dc i n range (0 , 101 , 5 ) :
p . ChangeDutyCycle ( dc )t ime . s l e e p ( 0 . 1 )
excep t K e y b o a r d I n t e r r u p t :pa s s
p . s top ( )GPIO . c l eanup ( )
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 80: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/80.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Python PWM sample codeimpor t t imeimpor t RPi . GPIO as GPIOGPIO . setmode (GPIO .BOARD)GPIO . s e tup (12 , GPIO .OUT)p = GPIO .PWM(12 , 50) # chan=12 f r e q =50Hzp . s t a r t (0 )t r y :
w h i l e 1 :f o r dc i n range (0 , 101 , 5 ) :
p . ChangeDutyCycle ( dc )t ime . s l e e p ( 0 . 1 )
excep t K e y b o a r d I n t e r r u p t :pa s s
p . s top ( )GPIO . c l eanup ( )
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 81: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/81.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 82: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/82.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.
Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 83: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/83.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.
(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 84: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/84.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)
PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 85: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/85.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.
i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 86: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/86.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.
PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 87: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/87.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.
i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 88: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/88.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors
![Page 89: Electronics- Pulse Width Modulation Sensorsdenethor.wlu.ca/pc320/lectures/pwmbeam.pdf · Terry Sturtevant Electronics Pulse Width Modulation Sensors. Pulse Width Modulation Sensors](https://reader030.fdocuments.net/reader030/viewer/2022040107/5e9ec870e4a0ed45216107b5/html5/thumbnails/89.jpg)
Pulse Width Modulation SensorsRaspberry Pi Python PWM Control
Raspberry Pi PWM pins
The Raspberry Pi has 2 built-in PWM channels.Each channel has 2 associated pins.(So only one pin can be used at a time.)PWM0 uses (BOARD) 12 and 32.i.e. (BCM) GPIO18 and (BCM) GPIO12.PWM1 uses (BOARD) 33 and 35.i.e. (BCM) GPIO13 and (BCM) GPIO19.
Note: These pins are shared with the audio subsystem.
Terry Sturtevant Electronics Pulse Width Modulation Sensors