Motor Speed Control

Only available on StudyMode
  • Topic: Pulse-width modulation, Floating point, Control theory
  • Pages : 3 (952 words )
  • Download(s) : 147
  • Published : January 17, 2013
Open Document
Text Preview
EE 308

New Mexico Tech

Spring 2011

Lab 5 – Part 2 Final Project: Motor Speed Control
Introduction and Objectives
In this lab you will control the speed of a motor. Figure 1 shows the hardware setup, which is the same as for Week 1 of Lab 4. You will use the potentiometer on your evaluation board to set the desired speed of the motor, and you will control the speed through the PWM output of the HCS12. You will measure the speed of the motor using an input capture pin, and display the desired and actual speeds on the terminal..

1. The Lab
It is up to you how you design the system to accomplish the goal of this lab, nonetheless, here are some guidelines to assist you in ensuring proper operation of the system. 1. Build the circuit shown in Figure 1. 2. Design a real-time routine that gets executed every 8ms. Develop a method to verify the timing of that routine, e.g., increment LEDs. 3. Program the A/D converter to read the value from the pot either the one on the microcontroller board or an external one. In the routine developed in Part 1, read the A/D converter (use 8-bit mode). Again develop a method to display the results and verify the operation of the A/D converter as you change the input voltage. 4. Set up the PWM to generate a 50 kHz PWM signal on one of the four PWM channels. Set it up for high polarity. It will be easiest to set PWPERx to 255. Verify that the PWM works. In the real-time routine, write the eight most significant bits to the A/D value you read to PWDTYx. The motor speed should change as you use the pot to vary the voltage on the A/D. 5. Measure the speed of the motor by determining the time between two falling edges of the optical encoder. In your main program display this time on the LCD display. You can use floating point arithmetic to convert this time into RPM. Display the RPM value on the LCD display. What is the maximum motor speed? 6. Measure the speed for several different duty cycles by varying the voltage with the...
tracking img