SlideShare a Scribd company logo
1 of 2
Download to read offline
Charles Moyes (cwm55) and Mengxiang Jiang (mj294)
                                                                                             ECE 4760
                                                                                       Assignment #4


Problem 1
The diode placed across the motor shorts out spikes when the motor is turned off.
   The inductor opposes a change in current because of Lenz’s Law:
                                                       di
                                                  v=L
                                                       dt
   During the rising edge of the PWM cycle, the change in current is positive, and so the inductor opposes
the current in the opposite/negative direction.
   During the falling edge of the PWM cycle, the change in current is negative, and so the inductor opposes
the current in the opposite/positive direction.
   During the “on” and “off” portions of the PWM cycle, there is no change in current so there is no
inductive opposition to the current.
   When the motor is turned off by the falling edge of the PWM cycle, the inductor opposes the current
change with current in the opposite (positive) direction. This current will be forward-biased against the
diode, and so the current spike will be shorted out.


Problem 2
The 10K potentiometer sets the comparator threshold, the 1M resistor sets the hysteresis and may need to
be adjusted.
   Hysteresis makes the rising/falling edges of the waveform less sensitive to noise. The circuit acts like a
Schmitt trigger, preventing the comparator from rapidly switching on and off. The output of the LM358
opamp is fed back into its positive input, causing rapid changes in voltage to be smoothed, because the
comparator’s input is now a combination of the input state and the output state. As a result, there are now
two separate thresholds for the positive output state and the negative output state respectively.


Problem 3
TRT Task 1 interacts with the PC keyboard to take user input and set up PID parameters. It reads in
strings from the UART using fscanf(), parses them into command/value pairs, and updates the appropriate
PID state variables {Kp , Ki , Kd } accordingly.
    TRT Task 2 runs the PID control loop about 50 times/sec using speed measurements from an ISR. The
following calculation is computed in the loop to update the PWM rate:
                                                                t
                                                                                    d
                            u(t) = M V (t) = Kp e(t) + Ki           e(τ ) dτ + Kd      e(t)
                                                            0                       dt
    where M V is the manipulated variable (the PWM rate), t is the present time, and e = SP − P V (SP is
the set point (desired rotation rate), and P V is the current rotation rate as measured by Timer 2). The
state variables are set by Task 1 as discussed earlier.
    TRT Task 3 runs the LCD and updates it about 5/second. Task 3 displays the rotation rate on the
LCD using the string formatting sprintf() function and the LCD library functions.
    An external interrupt ISR uses Timer 2 to measure the rotation time.




                                                     1
Problem 4
Shared variables between each task include the PID parameters (which may be changed by the keyboard
task Task 1, along with the rotation rate, which is gathered from the Timer 2 ISR and read by the LCD
task Task 3 and the PID controller task Task 2. The PID parameters include the proportional gain Kp ,
the integral gain Ki , and the derivative gain Kd .


Problem 5
The period for a motor rotation at 1000 RPM is:
                                            60
                                                ≈ 0.06 seconds
                                           1000
   Therefore, we need the timer to not overflow within 0.06 seconds. Running at full rate, Timer 2 has an
overflow period of:

                                          216
                                                 = 0.004 seconds
                                       16000000
   Solving for the minimum clock divider needed to maintain this rate gives:

                                      216 · x
                                              = 0.06 seconds ⇒ x 14.65
                                    16000000
   This tells us that a clock divider of 32 should suffice for Timer 2 to measure rotations at this rate.




                                                    2

More Related Content

Viewers also liked

Saving Energy
Saving EnergySaving Energy
Saving Energymrconroy
 
Muhammad fajri X MM 1
Muhammad fajri  X MM 1Muhammad fajri  X MM 1
Muhammad fajri X MM 1Fajry Cool
 
OPINT at a glance
OPINT at a glanceOPINT at a glance
OPINT at a glanceAlon Cohen
 
An Always On Future Driving Display Proliferation - Brian Gally
An Always On Future Driving Display Proliferation - Brian GallyAn Always On Future Driving Display Proliferation - Brian Gally
An Always On Future Driving Display Proliferation - Brian GallyMirasol Displays
 
Social Media Professional: i nuovi professionisti dei web 2.0
Social Media Professional: i nuovi professionisti dei web 2.0Social Media Professional: i nuovi professionisti dei web 2.0
Social Media Professional: i nuovi professionisti dei web 2.0Davide Bennato
 
Analysis of Similar Texts
Analysis of Similar TextsAnalysis of Similar Texts
Analysis of Similar TextsJoe Toyer
 
Cello saas scalability architecture
Cello saas scalability architectureCello saas scalability architecture
Cello saas scalability architectureTechcello
 
Pilat Media will unveil new products at NAB 2011
Pilat Media will unveil new products at NAB 2011Pilat Media will unveil new products at NAB 2011
Pilat Media will unveil new products at NAB 2011Sprinklr
 
Robert Ralph Bubp
Robert Ralph BubpRobert Ralph Bubp
Robert Ralph BubpJohn Rust
 
التصنيف
التصنيفالتصنيف
التصنيفNaif2060
 
Best management colleges in delhi
Best management colleges in delhiBest management colleges in delhi
Best management colleges in delhiEra Business School
 
Thoai Hoa đot Song Co
Thoai Hoa đot Song CoThoai Hoa đot Song Co
Thoai Hoa đot Song Coleif372
 
Tates Creek Christian Church Weekly Herald May 7, 2014
Tates Creek Christian Church Weekly Herald May 7, 2014Tates Creek Christian Church Weekly Herald May 7, 2014
Tates Creek Christian Church Weekly Herald May 7, 2014David Eversole
 

Viewers also liked (20)

Saving Energy
Saving EnergySaving Energy
Saving Energy
 
Mexico
MexicoMexico
Mexico
 
Pechakucha
PechakuchaPechakucha
Pechakucha
 
Muhammad fajri X MM 1
Muhammad fajri  X MM 1Muhammad fajri  X MM 1
Muhammad fajri X MM 1
 
OPINT at a glance
OPINT at a glanceOPINT at a glance
OPINT at a glance
 
An Always On Future Driving Display Proliferation - Brian Gally
An Always On Future Driving Display Proliferation - Brian GallyAn Always On Future Driving Display Proliferation - Brian Gally
An Always On Future Driving Display Proliferation - Brian Gally
 
76032 Danylou
76032 Danylou76032 Danylou
76032 Danylou
 
Home for sale at Shadowlake July 1 2011
Home for sale at Shadowlake July 1 2011Home for sale at Shadowlake July 1 2011
Home for sale at Shadowlake July 1 2011
 
Quantum RBAC
Quantum RBACQuantum RBAC
Quantum RBAC
 
Social Media Professional: i nuovi professionisti dei web 2.0
Social Media Professional: i nuovi professionisti dei web 2.0Social Media Professional: i nuovi professionisti dei web 2.0
Social Media Professional: i nuovi professionisti dei web 2.0
 
L14 hengs
L14 hengsL14 hengs
L14 hengs
 
Analysis of Similar Texts
Analysis of Similar TextsAnalysis of Similar Texts
Analysis of Similar Texts
 
Cello saas scalability architecture
Cello saas scalability architectureCello saas scalability architecture
Cello saas scalability architecture
 
Pilat Media will unveil new products at NAB 2011
Pilat Media will unveil new products at NAB 2011Pilat Media will unveil new products at NAB 2011
Pilat Media will unveil new products at NAB 2011
 
Template #1 Goal Statement-May 2014-Final
Template #1 Goal Statement-May 2014-FinalTemplate #1 Goal Statement-May 2014-Final
Template #1 Goal Statement-May 2014-Final
 
Robert Ralph Bubp
Robert Ralph BubpRobert Ralph Bubp
Robert Ralph Bubp
 
التصنيف
التصنيفالتصنيف
التصنيف
 
Best management colleges in delhi
Best management colleges in delhiBest management colleges in delhi
Best management colleges in delhi
 
Thoai Hoa đot Song Co
Thoai Hoa đot Song CoThoai Hoa đot Song Co
Thoai Hoa đot Song Co
 
Tates Creek Christian Church Weekly Herald May 7, 2014
Tates Creek Christian Church Weekly Herald May 7, 2014Tates Creek Christian Church Weekly Herald May 7, 2014
Tates Creek Christian Church Weekly Herald May 7, 2014
 

Similar to Ece4760 hw4

Current commutated chopper
Current commutated chopperCurrent commutated chopper
Current commutated chopperJyoti Singh
 
electrical-engineering_engineering_power-electronics_dc-choppers_notes.pdf
electrical-engineering_engineering_power-electronics_dc-choppers_notes.pdfelectrical-engineering_engineering_power-electronics_dc-choppers_notes.pdf
electrical-engineering_engineering_power-electronics_dc-choppers_notes.pdfLucasMogaka
 
Chapter 20
Chapter 20Chapter 20
Chapter 20Tha Mike
 
Exp 2 (1)2. To plot Swing Curve for one Machine System
Exp 2 (1)2.	To plot Swing Curve for one Machine SystemExp 2 (1)2.	To plot Swing Curve for one Machine System
Exp 2 (1)2. To plot Swing Curve for one Machine SystemShweta Yadav
 
Pbl report kkkl 2174 electric analogue
Pbl report kkkl 2174 electric analoguePbl report kkkl 2174 electric analogue
Pbl report kkkl 2174 electric analogueHakim Futra
 
Chapter 3 Controlled Rectifier.pdf
Chapter 3 Controlled Rectifier.pdfChapter 3 Controlled Rectifier.pdf
Chapter 3 Controlled Rectifier.pdfLiewChiaPing
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programmingMohamed Ali
 
Transformer overcurrent
Transformer overcurrentTransformer overcurrent
Transformer overcurrentmichaeljmack
 
Design and implementation of cyclo converter for high frequency applications
Design and implementation of cyclo converter for high frequency applicationsDesign and implementation of cyclo converter for high frequency applications
Design and implementation of cyclo converter for high frequency applicationscuashok07
 
DC_DC_Buck_PPT.ppt
DC_DC_Buck_PPT.pptDC_DC_Buck_PPT.ppt
DC_DC_Buck_PPT.pptShivamMane14
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684quadrocopter
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684quadrocopter
 
Prince jai nproject report
Prince jai nproject reportPrince jai nproject report
Prince jai nproject reportPrince Dungarpur
 
LED電源回路アプリケーションガイド 金沢プレゼン資料
LED電源回路アプリケーションガイド 金沢プレゼン資料LED電源回路アプリケーションガイド 金沢プレゼン資料
LED電源回路アプリケーションガイド 金沢プレゼン資料Tsuyoshi Horigome
 
Design & Implementation of Zero Voltage Switching Buck Converter
Design & Implementation of Zero Voltage Switching Buck ConverterDesign & Implementation of Zero Voltage Switching Buck Converter
Design & Implementation of Zero Voltage Switching Buck ConverterIJERA Editor
 
Power electronics question bank
Power electronics question bankPower electronics question bank
Power electronics question bankmcpriya04
 

Similar to Ece4760 hw4 (20)

Microcontroller part 3
Microcontroller part 3Microcontroller part 3
Microcontroller part 3
 
Currentcommutatedchopper
CurrentcommutatedchopperCurrentcommutatedchopper
Currentcommutatedchopper
 
Current commutated chopper
Current commutated chopperCurrent commutated chopper
Current commutated chopper
 
electrical-engineering_engineering_power-electronics_dc-choppers_notes.pdf
electrical-engineering_engineering_power-electronics_dc-choppers_notes.pdfelectrical-engineering_engineering_power-electronics_dc-choppers_notes.pdf
electrical-engineering_engineering_power-electronics_dc-choppers_notes.pdf
 
Chapter 20
Chapter 20Chapter 20
Chapter 20
 
Exp 2 (1)2. To plot Swing Curve for one Machine System
Exp 2 (1)2.	To plot Swing Curve for one Machine SystemExp 2 (1)2.	To plot Swing Curve for one Machine System
Exp 2 (1)2. To plot Swing Curve for one Machine System
 
Pbl report kkkl 2174 electric analogue
Pbl report kkkl 2174 electric analoguePbl report kkkl 2174 electric analogue
Pbl report kkkl 2174 electric analogue
 
Chapter 3 Controlled Rectifier.pdf
Chapter 3 Controlled Rectifier.pdfChapter 3 Controlled Rectifier.pdf
Chapter 3 Controlled Rectifier.pdf
 
AVR_Course_Day7 timers counters and interrupt programming
AVR_Course_Day7 timers counters and  interrupt programmingAVR_Course_Day7 timers counters and  interrupt programming
AVR_Course_Day7 timers counters and interrupt programming
 
Transformer overcurrent
Transformer overcurrentTransformer overcurrent
Transformer overcurrent
 
Circuits
CircuitsCircuits
Circuits
 
Design and implementation of cyclo converter for high frequency applications
Design and implementation of cyclo converter for high frequency applicationsDesign and implementation of cyclo converter for high frequency applications
Design and implementation of cyclo converter for high frequency applications
 
DC_DC_Buck_PPT.ppt
DC_DC_Buck_PPT.pptDC_DC_Buck_PPT.ppt
DC_DC_Buck_PPT.ppt
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684
 
Prince jai nproject report
Prince jai nproject reportPrince jai nproject report
Prince jai nproject report
 
Pe dual converter ppt
Pe dual converter pptPe dual converter ppt
Pe dual converter ppt
 
LED電源回路アプリケーションガイド 金沢プレゼン資料
LED電源回路アプリケーションガイド 金沢プレゼン資料LED電源回路アプリケーションガイド 金沢プレゼン資料
LED電源回路アプリケーションガイド 金沢プレゼン資料
 
Design & Implementation of Zero Voltage Switching Buck Converter
Design & Implementation of Zero Voltage Switching Buck ConverterDesign & Implementation of Zero Voltage Switching Buck Converter
Design & Implementation of Zero Voltage Switching Buck Converter
 
Power electronics question bank
Power electronics question bankPower electronics question bank
Power electronics question bank
 

More from Chuck Moyes

Gameplay specificationfinal
Gameplay specificationfinalGameplay specificationfinal
Gameplay specificationfinalChuck Moyes
 
Final presentation
Final presentationFinal presentation
Final presentationChuck Moyes
 
Concept documentfinal
Concept documentfinalConcept documentfinal
Concept documentfinalChuck Moyes
 
Beta releasereport
Beta releasereportBeta releasereport
Beta releasereportChuck Moyes
 
Beta presentation
Beta presentationBeta presentation
Beta presentationChuck Moyes
 
Alpha releasepresentation
Alpha releasepresentationAlpha releasepresentation
Alpha releasepresentationChuck Moyes
 
Manual small (1)
Manual small (1)Manual small (1)
Manual small (1)Chuck Moyes
 
CS 2110 Programming Competition Entry Readme
CS 2110 Programming Competition Entry ReadmeCS 2110 Programming Competition Entry Readme
CS 2110 Programming Competition Entry ReadmeChuck Moyes
 
Ece4760 progress report2
Ece4760 progress report2Ece4760 progress report2
Ece4760 progress report2Chuck Moyes
 
Ece4760 progess report1
Ece4760 progess report1Ece4760 progess report1
Ece4760 progess report1Chuck Moyes
 
Ece3140 lab5 writeup
Ece3140 lab5 writeupEce3140 lab5 writeup
Ece3140 lab5 writeupChuck Moyes
 
Ece lab5 proposal
Ece lab5 proposalEce lab5 proposal
Ece lab5 proposalChuck Moyes
 
Cs 4621 presentation slides
Cs 4621 presentation slidesCs 4621 presentation slides
Cs 4621 presentation slidesChuck Moyes
 
Presentation slides
Presentation slidesPresentation slides
Presentation slidesChuck Moyes
 
Car sim rendering
Car sim renderingCar sim rendering
Car sim renderingChuck Moyes
 

More from Chuck Moyes (20)

Gameplay specificationfinal
Gameplay specificationfinalGameplay specificationfinal
Gameplay specificationfinal
 
Final presentation
Final presentationFinal presentation
Final presentation
 
Concept documentfinal
Concept documentfinalConcept documentfinal
Concept documentfinal
 
Beta releasereport
Beta releasereportBeta releasereport
Beta releasereport
 
Beta presentation
Beta presentationBeta presentation
Beta presentation
 
Alpha releasepresentation
Alpha releasepresentationAlpha releasepresentation
Alpha releasepresentation
 
Manual small (1)
Manual small (1)Manual small (1)
Manual small (1)
 
CS 2110 Programming Competition Entry Readme
CS 2110 Programming Competition Entry ReadmeCS 2110 Programming Competition Entry Readme
CS 2110 Programming Competition Entry Readme
 
Ece4760 progress report2
Ece4760 progress report2Ece4760 progress report2
Ece4760 progress report2
 
Ece4760 hw5
Ece4760 hw5Ece4760 hw5
Ece4760 hw5
 
Ece4760 progess report1
Ece4760 progess report1Ece4760 progess report1
Ece4760 progess report1
 
Ece3140 lab5 writeup
Ece3140 lab5 writeupEce3140 lab5 writeup
Ece3140 lab5 writeup
 
Ece lab5 proposal
Ece lab5 proposalEce lab5 proposal
Ece lab5 proposal
 
Fb graph
Fb graphFb graph
Fb graph
 
Cs 4621 presentation slides
Cs 4621 presentation slidesCs 4621 presentation slides
Cs 4621 presentation slides
 
Ai plan
Ai planAi plan
Ai plan
 
Final report
Final reportFinal report
Final report
 
Presentation slides
Presentation slidesPresentation slides
Presentation slides
 
Car sim rendering
Car sim renderingCar sim rendering
Car sim rendering
 
Cs665 writeup
Cs665 writeupCs665 writeup
Cs665 writeup
 

Ece4760 hw4

  • 1. Charles Moyes (cwm55) and Mengxiang Jiang (mj294) ECE 4760 Assignment #4 Problem 1 The diode placed across the motor shorts out spikes when the motor is turned off. The inductor opposes a change in current because of Lenz’s Law: di v=L dt During the rising edge of the PWM cycle, the change in current is positive, and so the inductor opposes the current in the opposite/negative direction. During the falling edge of the PWM cycle, the change in current is negative, and so the inductor opposes the current in the opposite/positive direction. During the “on” and “off” portions of the PWM cycle, there is no change in current so there is no inductive opposition to the current. When the motor is turned off by the falling edge of the PWM cycle, the inductor opposes the current change with current in the opposite (positive) direction. This current will be forward-biased against the diode, and so the current spike will be shorted out. Problem 2 The 10K potentiometer sets the comparator threshold, the 1M resistor sets the hysteresis and may need to be adjusted. Hysteresis makes the rising/falling edges of the waveform less sensitive to noise. The circuit acts like a Schmitt trigger, preventing the comparator from rapidly switching on and off. The output of the LM358 opamp is fed back into its positive input, causing rapid changes in voltage to be smoothed, because the comparator’s input is now a combination of the input state and the output state. As a result, there are now two separate thresholds for the positive output state and the negative output state respectively. Problem 3 TRT Task 1 interacts with the PC keyboard to take user input and set up PID parameters. It reads in strings from the UART using fscanf(), parses them into command/value pairs, and updates the appropriate PID state variables {Kp , Ki , Kd } accordingly. TRT Task 2 runs the PID control loop about 50 times/sec using speed measurements from an ISR. The following calculation is computed in the loop to update the PWM rate: t d u(t) = M V (t) = Kp e(t) + Ki e(τ ) dτ + Kd e(t) 0 dt where M V is the manipulated variable (the PWM rate), t is the present time, and e = SP − P V (SP is the set point (desired rotation rate), and P V is the current rotation rate as measured by Timer 2). The state variables are set by Task 1 as discussed earlier. TRT Task 3 runs the LCD and updates it about 5/second. Task 3 displays the rotation rate on the LCD using the string formatting sprintf() function and the LCD library functions. An external interrupt ISR uses Timer 2 to measure the rotation time. 1
  • 2. Problem 4 Shared variables between each task include the PID parameters (which may be changed by the keyboard task Task 1, along with the rotation rate, which is gathered from the Timer 2 ISR and read by the LCD task Task 3 and the PID controller task Task 2. The PID parameters include the proportional gain Kp , the integral gain Ki , and the derivative gain Kd . Problem 5 The period for a motor rotation at 1000 RPM is: 60 ≈ 0.06 seconds 1000 Therefore, we need the timer to not overflow within 0.06 seconds. Running at full rate, Timer 2 has an overflow period of: 216 = 0.004 seconds 16000000 Solving for the minimum clock divider needed to maintain this rate gives: 216 · x = 0.06 seconds ⇒ x 14.65 16000000 This tells us that a clock divider of 32 should suffice for Timer 2 to measure rotations at this rate. 2