Position Control
Objective
Using control theory principles, I worked with one other student to control the position of a DC motor based on response from an infrared (IR) sensor. The aim was to ensure, the motor (which was attached to the sensor) would maintain a distance of approximately 6 inches from any surface in front of the sensor.
Technical Details
We used the LEGO® EV3 Large Motor for this project. Our first task was to characterize the motor, so as to obtain a transfer function for the plant/motor. We did this by powering the motor and obtaining a response for the speed in open loop. We obtained this response by videoing the motor in motion and analyzing using the Tracker software. From this open loop response, we calculated the motor gain and time constant.
We then needed to characterize the IR sensor, so as to estimate a value for the sensor gain and also find the voltage output from the sensor, when it is 6 inches from a surface. We did this by recording the output voltages from the sensor from distances for 3 to 24 in. We avoided starting from 0 in, as this sensor does not obey the inverse voltage-distance relationship for distances close to 0 in.
We used root locus diagrams, Nyquist plots and Routh’s Array to obtain a range of values for the controller gains. We used a proportional-derivative (PD) controller, but the gains were small enough that noise had little effect on the system and large enough that the motor was responsive.
Although I have experience using microcontrollers, we were not allowed to use those for this project. So, we built our controller using operational amplifiers, resistors and capacitors. The full system is shown in the slideshow above. I have also included a circuit schematic and a block diagram.
Results
As seen in the video above. The motor worked as expected, and maintained a distance of approximately 6 in from any surface.
