Precise control of the speed of a D.C. motor requires that one be able to accurately measure the speed so that corrective action can be taken if the speed is not the desired value. The D.C. motor used in this lab contains a tachometer that produces a sinusoidal signal as the motor rotates. Both the frequency and amplitude of this sinusoidal waveform are proportional to the speed of the motor. The objective of this week’s lab is to measure the amplitude of the signal produced by the motor’s tachometer, which is proportional to motor speed. This will be done by converting the tachometer AC signal to a DC signal, and then measuring its amplitude with the analog to digital converter in the microcontroller.
9 v Power
Figure 9.1. D.C. Motor Speed Controller Block Diagram
BUEHLER MOTOR: AC TACHOMETER
In the Buehler motor used in the lab, the AC tachometer comprises a separate winding, or “pickup coil”, that senses the magnetic field at one end of the motor rotor. The frequency and amplitude of the voltage induced in this coil are proportional to the rotational speed of the motor. Therefore, measuring the speed of the motor requires measuring either the frequency or amplitude of the tachometer output signal.
AC TO DC CONVERSION
Since the output of the tachometer is a sinusoid, symmetric around 0 volts, its amplitude can be measured by rectifying and filtering the signal, to produce an approximately DC level, and then converting the DC level to a binary number with an analog to digital converter (ADC). For the ADC on the STM32L100RC microcontroller, the ideal range of input voltages would be 0 to 3 volts. Therefore, the rectifier and filter circuit should ideally produce a signal in that range, over the range of motor speeds to be measured.
ANALOG TO DIGITAL CONVERSION
Refer to class slides for description of analog to digital conversion and the STM32L100RC analog to digital converter, including configuration and operation.
HARDWARE AND SOFTWARE DESIGN
Referring to your circuits book and/or other references, design a simple half-wave or full-wave rectifier and filter to translate the tachometer signal to a D.C. voltage that is proportional to the amplitude of the tachometer signal. The circuit should be modeled and simulated in PSPICE before building it in the lab, to verify that the circuit and component values produce an output voltage that approximates a D.C. level. Model the tachometer as you did in Lab 9.
There will be a variety of diodes, resistors and capacitors available in the lab for constructing your rectifier and filter. As before, each team is to have a hardware design ready to wire and a test at the start of lab, so that lab time can be used for construction and testing. Use the oscilloscope to measure the tachometer signal amplitude and the output of your constructed circuit, to verify that the circuit output voltage increases linearly with tachometer signal amplitude (which increases linearly with motor speed). Also examine the “ripple” in your rectified signal. If this is excessive, you may need filtering to reduce it.
Modify the software from the previous lab to enable the microcontroller to measure the amplitude of the waveform via its analog to digital converter.
Design, model and simulate your rectifier circuit in PSPICE, verifying that the circuit produces a D.C. voltage level proportional to the amplitude of the tachometer signal. Sketch the final circuit diagram in your lab book.
As before, design experiments to test your hardware. write a test procedure in your lab books, as well calculations.
Prior to the lab, design and as entering any component
During the lab period, document each experiment in your lab notebook, and summarize the most significant ones in your report.
Construct the rectifier circuit and test it prior to connecting it to the microcontroller. Verify that the circuit produces the desired D.C. levels over the entire range of motor speeds by measuring the tachometer signal and rectifier output on the oscilloscope.
Connect the rectified tachometer signal to the microcontroller and run your application program, measuring the tachometer signal amplitude for each of the seven switch-selectable speeds over the motor’s operating range. Plot the amplitude as a function of the duty cycle of the PWM signal used to drive the motor, relating measured speed to the control parameter used in the control program.
Note, if you have been using all of the Port AD pins to drive LEDs or read switch states, you will need to free up one of these pins to configure as an input the analog to digital converter.
FOR FUTURE LABORATORY REPORTS
Briefly describe the circuit (but not “wire by wire”) and attach a circuit diagram and software listing. Make sure your program includes descriptive comments.
Briefly discuss your results, including plots of ADC value vs tachometer output amplitude, ADC value vs. ATD input voltage (rectifier/filter output), and ADC value vs. PWM signal duty cycle. Consider using captured images from the oscilloscope to show waveforms.