PoE: Lab 3 -- PID Control RESULTS

Using the CoolTerm program to read Arduino serial values to a txt file, we print the serial output values of position, target position, error, and motor output and then used MATLAB to plot these values.We used the PID equation, output = Kp*Error + Ki*Total + Kd*Difference, where Error = target ­ count,  Total = total + error, and Difference = Error_previous - Error_current. With a little experimentation, we found that our control works best when Kp = 14, Ki = .01, and Kd = .1. Yet, we noticed that the accuracy of our plots was not as high as it could be with a 36­resolution encoder, which caused large steps in our plots, as seen in Figures 4 and 5. We tried increasing the accuracy by using different encoders, up to 72­resolution.

Challenges:

A key challenge in this lab was understanding the dynamics of PID control system and how to translate them into the encoder­motor system we built. Another challenge we had to overcome was dissecting the diagram and data sheets for the sensor, as both members of team are trying to become more familiar with electronics --originally translating the schematic as having a separate LED connection. 

Once we had values to read, we had difficulty in identifying clear distinctions between a black sheet and a white sheet of paper: we played with the distances of the object and material to determine the best methods of setting up our encoder. Eventually, we started receiving distinct ranges and were able to plot them, with each varying constant, in MATLAB.  We also would have ideally had more accuracy in our plots by using encoders with higher resolutions. However, it was difficult to determine the ideal resolution of the encoder to fit with both the capabilities of the sensor as well as the speed of the motor. While our final plots do show trends, we would do more trial and error in the future to determine a better resolution for our encoder.

Another technical obstacle we faced was, terrifyingly, fire. While experimenting with our different constants in our code, the power and ground wires (which we had stripped too long) began touching. Before we ran the motor, we noticed the wires were touching and removed them, but it was too late. The components had overheated and we had a mini­fire in motor port 1. After unplugging the system from power, allowing it to cool down, and trimming our wires so the problem wouldn’t occur again, we were able to continue our lab using a different motor port.

Reflection:

Taking our experience with the many technical difficulties in the last lab, we learned to not wait so long before reaching out for help and also learned where to look for problem areas.
When we first ran into the issue of calibration, we immediately looked into the set­up rather than the code and utilized all resources to understand the sensor we were using. Having the past experience helped prepare us for this one. Additionally, in adapting the Arduino encoderPID code, we learned the importance of breaking the problems into smaller, manageable parts. By doing
so, we were able to assess each component of the PID equation and alter parts of the equation easily, whereas without prior experience, we would have tried to tackle it all at once without clear direction and parameters.


Comments

Popular posts from this blog

Laser-Cut Bottle Opener (3 of 3)

Introduction to My Product

Hackathon: TechTogether Boston