Presentation is loading. Please wait.

Presentation is loading. Please wait.

Motor Control of an Oscillating Pendulum Nick Myers and Chirag Patel March 9, 2004 Advised by: Dr. James Irwin and Mr. Jose Sanchez Bradley University.

Similar presentations


Presentation on theme: "Motor Control of an Oscillating Pendulum Nick Myers and Chirag Patel March 9, 2004 Advised by: Dr. James Irwin and Mr. Jose Sanchez Bradley University."— Presentation transcript:

1

2 Motor Control of an Oscillating Pendulum Nick Myers and Chirag Patel March 9, 2004 Advised by: Dr. James Irwin and Mr. Jose Sanchez Bradley University Department of Electrical Engineering and Technology

3 Presentation Overview Project Objectives System Block Diagrams Step by Step Project Goals Work Completed - Hardware (Nick) Work Completed - Software (Nick) Work Completed - Hardware (Chirag) Work Completed - Software (Chirag) Initial PWM Design Plan Summary of Progress Possible Additions Questions

4 Objectives To initialize the oscillation of a weighted pendulum using microprocessor controlled motor bursts. To oscillate the pendulum to a predefined angle and, using optical sensor outputs, maintain the angle of oscillation.

5 System Level Block Diagram

6 Subsystem Level Block Diagram

7 Step by Step Project Goals n H-bridge hardware n EMAC to H-bridge interface hardware n H-bridge switching software n Initial motor pulsing software n Incrementing motor pulsing software n Optical sensor hardware n Optical sensor interrupt software n Oscillation stabilization software n User interface software n Pendulum construction and wiring

8 H-bridge Hardware Truth table for forward and backward states

9 H-bridge Hardware n The H-bridge uses (2) N-Channel ZVN4206 Transistors and (2) P-Channel ZVP2106 Transistors n The H-bridge operates on a supply voltage of +15V DC n The inputs of the active transistors are pulled to Vcc n The voltage across the motor is approximately 12V

10 EMAC to H-bridge Hardware Interface All of the outputs from the EMAC microprocessor board come from Port 1 Port 1 supplies 80uA of current Additional hardware must be added for EMAC to be able to turn the H-bridge on/off

11 EMAC to H-bridge Hardware Interface From EMAC To H-bridge

12 H-bridge Microprocessor Code n The H-bridge will switch motor burst direction every time the pendulum passes equilibrium n Once the direction is switched, a burst will immediately be sent n The H-bridge code will be called by the equilibrium sensor interrupt n The H-bridge code will switch motor polarity by switching on/off two pins on Port 1

13 H-bridge Microprocessor Code Flowchart

14 Initial Motor Pulsing Software n The equilibrium sensor will always be blocked initially n Interrupt driven pulsing cannot be used to begin pendulum oscillation n A constant pulse must be provided until the pendulum clears the equilibrium sensor

15 Initial Motor Pulsing Software 31H=1 ? Turn on P1.4 and P1.5 and set 31H=1 Turn off P1.4 and set 31H=0 Turn off P1.5 and set 31H=1 Delay Flowchart YesNo

16 Incrementing Motor Pulsing Software n Once the Pendulum has successfully cleared the equilibrium sensor, the length of the torque bursts can be increased n The bursts will only be sent when the equilibrium sensor is crossed n These bursts will continue to increase in length until the angle sensor is crossed

17 Incrementing Motor Pulsing Software Flowchart

18 Oscillation Stabilization Software n When the pendulum reaches its desired angle of oscillation, it should remain constant at that desired angle n Once the pendulum passes the angle sensor, the interrupt handler will check how many times the sensor is crossed n If the pendulum is overshooting the sensor, the delay will be shortened

19 Oscillation Stabilization Software Flowchart

20 User Interface Software n On startup, the LCD prompts the user: “Press ‘A’ to Begin” n The program is waiting to be interrupted by the keypad button ‘A’ n When the keypad button ‘A’ is pressed, the initial motor pulsing software is entered and the pendulum begins its oscillation

21 User Interface Software n As the initial motor burst software is entered, the LCD display changes to: “Press ‘B’ to Stop” n After every motor pulse, the code checks to see if the button ‘B’ has been pressed n If the button has been pressed, the motor is turned off and the the LCD is reset to the initial prompt

22 Constructed Pendulum

23 Optical Sensor n Two optical sensors: –Equilibrium Sensor –Predefined Angle Sensor n RF = 200 –Limits Current to 20 mA IF = 5V/200 = 20mA –Enough Current to transmit infrared signal –Not Enough Current to Damage Optical Sensor

24 Optical Sensor n R1 = 4700 to account for desired on/off switching times –ON Switching Time 8us * 1.7 = 14.4 us –OFF Switching Time 50us * 1.6 = 80us n Equilibrium and Predefined Angle Sensor Have Same Values.

25 Sensor Initialization n Equilibrium Sensor –Handled by Interrupt 3 –Once obstructed – Rerouted to code in order to output motor burst n Predefined Angle Sensor –Handled by Interrupt 4 –Once obstructed – Rerouted to code in order to count the number of obstructions –Used to determine overshoot or undershoot

26 Initial Design Plan n PWM signal will be used to initiate the oscillation of the pendulum. –Once pendulum is beyond the equilibrium sensor, timed pulse signals will be used to oscillate the pendulum.

27 Initial Design Plan n Pulse Width Measurement code used to measure length of time sensor is obstructed by pendulum. –This time will be used to control the length of the pulsel sent to motor to control oscillation of pendulum. Faster the oscillation = Smaller pulses Slower the oscillation = Larger pulses

28 Initial Design Plan n Pulse Width Measurement –Timer 2 used in gated mode –When P1.7 = High Timer begins counting –When P1.7 = Low Timer stops counting n Obtain time value through pulse width measurement when pendulum is dropped from desired angle. –Compare that value to value obtained each swing. If value obtained > stored value - INCREASE BURST LENGTH If value obtained < stored value – DECREASE BURST LENGTH

29 Initial Design Plan n Initial design was not used due to the complications encountered –Proved to be more time-consuming than expected –However, this design can be used for changing loads.

30 Summary of Progress n Completed H-bridge hardware n Completed EMAC to H- bridge hardware interface n Completed H-bridge software n Completed initial motor pulsing software n Completed incrementing motor pulsing software n Completed optical sensor Hardware n Completed optical sensor interrupt software n Completed oscillation stabilization software n Completed user interface software n Completed pendulum construction

31 Possible Additions n Adding additional angle sensors so that user may choose from multiple angles of oscillation n Changing initial motor pulsing code so that changing loads could be oscillated n Creating power storage circuitry so that system could run from a lower supply voltage

32 Questions?


Download ppt "Motor Control of an Oscillating Pendulum Nick Myers and Chirag Patel March 9, 2004 Advised by: Dr. James Irwin and Mr. Jose Sanchez Bradley University."

Similar presentations


Ads by Google