Arduino Project
In Winter 2015, I took a design class, MAE 156A Fundamental Principles of Mechanical Design I. and we had a class mechatronic project which was a project including mechanical and electronic components. It was my first time using electronic components other than motors in my projects and also a new challenge and eye-opener for me because I had never had an idea about these components we used in this project.
![](https://static.wixstatic.com/media/60d45d_3ce3c6fe12b84b74a206cd21244b13df.jpg/v1/fill/w_676,h_1148,al_c,q_85,enc_avif,quality_auto/60d45d_3ce3c6fe12b84b74a206cd21244b13df.jpg)
This project was to build the test stand hardware that had two identical inertia disks controlled by a microprocessor, Arduino. The first inertia disk would be connected to the motor with a 1:4 rotational output ratio for the timing belt. The second inertia disk shaft was connected to the first shaft with an undetermined output ratio of the timing belt. The second shaft and inertia disk system defines the output motion of the system. Our job was to program the Arduino to control the motion of the inertia disks. The spin of the first inertia disk needed to be 2 times faster than that of the second inertia disk. In additional, the first inertia disk had to reach multiple angles sequentially: 30°, -60°, +90°, -120°, +120°, -90°, +60°, and -30°. The criteria for arriving at set point was that the displacement error needed to be less than 1.5° and the magnitude of velocity was less than 5°/s. Finally, the system had to hold at each set point for 0.5s between moves.
![](https://static.wixstatic.com/media/60d45d_fba5ba021a904c4ab00d678b25efee6d.jpg/v1/fill/w_692,h_521,al_c,q_85,enc_avif,quality_auto/60d45d_fba5ba021a904c4ab00d678b25efee6d.jpg)
Image: https://sites.google.com/a/eng.ucsd.edu/mae156a/_/rsrc/1420563330972/mechatronics-project/1DOF_annotated_upload.jpg?height=300&width=400
This project was a combination of materials from all the classes I had taken in UCSD. It required different theories in one project and it was a summary of my study in UCSD. This project consisted of mechanical design, optimization of mechanical components, programming and system control. The principle of this project was that microprocessor, Arduino, was programmed to control the motion of the motor, the motor gave power up the whole system to move the inertia disks and the potentiometer measured the angle of the shaft and kept track of the position of the disks. When the disks reached the desired angle, Arduino would stop the motor and change the direction of the motor to turn the disks to the next angle. Practically, the microprocessor does not stop the motor exactly at the desired angle. Therefore, we used PID control for this system and PWM for the motor. PID is proportional-integral-derivative controller which is a control loop feedback mechanism. It continuously calculates an error value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error over time by adjustment of a control variable. After the system adjusts the control variable, the microprocessor will control the speed of the motor by PWM in order to reach the desired angle. Pulse-width modulation (PWM) is a modulation technique used to encode a message into a pulsing signal. Although this modulation technique can be used to encode information for transmission, its main use is to allow the control of the power supplied to electrical devices especially motors. The average value of voltage fed to the load is controlled by turning the switch between supply and load on and off at a fast rate. The longer the switch is on compared to the off periods, the higher the total power supplied to the load. The PWM switching frequency has to be much higher than what would affect the, which is to say that the resultant waveform perceived by the load must be as smooth as possible.
In the beginning of the project, I was paired up with another student in my session and we started working closely with each other throughout the quarter. Before this class, I had not had a chance to work with just one teammate and I had been always relied on the other teammates. However, we both had strengths and weaknesses in different subjects but fortunately, we were just a good fit to each other because he was good at mechanical part and I was good at programming part. We first tried to work together and discussed a lot about the theories before we took action. Later on, the class work became heavier and more difficult and we had busier schedules so we spent less time to work together and discuss. We just worked on the part we were adept at. It was interesting that although we had less discussion, we had more faith in each other’s work and studied and learned each other’s work individually. This was the take-away for me to trust the people you work with and respect their expertise. In this project, I had learned a lot by just observing and studying my teammate’s work. On the other hand, this project also practiced my responsibility to complete my own part in order not to slow down the process and then my teammate could continue his work on top of my contribution.