This project involved designing and implementing a closed-loop motor monitoring and control system using an Arduino Uno, and a DC motor with a rotary encoder, The goal was to accurately determine the angular position, rotational speed (RPM), and linear speed while maintaining reliable control over motor direction and rotation. This setup was conducted to prepare for the motorized car project.
The rotary encoder attached to the motor shaft provided pulse signals corresponding to the DC shaft movement. These pulses were read by the Arduino using interrupt-based counting to ensure accurate measurement even at higher speeds. By tracking the number of encoder ticks over time, the system computed the angular displacement and rotational velocity of the motor. RPM was calculated from the pulse frequency within a sampling interval.
The code takes in the speed every 'milliseconds' number of milliseconds. The motor is connected to pins 2 and 3 and in the function 'myFunction,' a counter increases by one value if either pin is on. The float 'getSpeed' takes in the difference of position every 100 milliseconds to find the angle that the motor is at during any given point in time. To convert it to RPM, the 'getSpeed' function converts the angle to degrees/seconds, then to RPM. In the loop function, it continues to take in the angle of the motor driver and prints it out for the user to see.
In order to find the dimensions of the trash can's arms, I decided to map out the positions
of the tray using Math Illustrations. I setup an intermediate tray position away from the trashcan to prevent its
contents from toppling over. Then, I mapped out the change in positions of the midpoint (A) and one of the endpoints (B) by
drawing out lines between the points. Those lines connect as such: A to A', B to B', A' to A'', and B' to B''. Finally, I
found the perpendicular bisectors of those lines and placed points where they intersected. The position of the points are
where the trash can's arms are located and their lengths are where they attach to A' and B'.
All units are in centimeters.
The objective of this project was to design a trash can that can lift a tray to dispose of trash without dropping it. I conducted a geometrical simulation using sketches to determine where the arm should be placed on the trash can before modeling the final prototype using Solidworks.
This project involved analyzing the motion of a four bar crank mechanism using a CAD motion simulation in Solidworks. A motion study was created to simulate the mechanism operating at a constant angular speed, then at a speed of 600 RPM.
From the motion study, the maximum motor torque, the crank angle at which this torque occurs, the maximum vertical forces acting on the bearing supports, and the minimum motor power required to maintain a constant rotational speed were obtained. All components in the mechanism are made from plain carbon steel and gravity is included in the motion study.
From the plot, the maximum torque is 20 Nmm at an angle of 0 degrees. The extension bar and crank move on the x axis and the maximum vertical force exerted on both bearings is 0.3N. The power required to move the motor at 600RPM is 425 Watts. The negative motor torque, which indicates points where the inertia help the arms move rather than resisting it. This means that the motor torque has to slow down the rotation of the crank to retain the speed of 20RPM.
We designed and assembled a car capable of transporting a 12 inch bar at a controlled speed. The system was designed to prevent the bar from tipping or falling during transport. Careful consideration was given to the size of the wheels, speed control, and proper assembly to ensure the car can withstand multiple trials.
From our hand calculations, the maximum acceleration of the car is around 0.8m/s^2.
I simulated the movement of the car with the beam on top. In order to simulate it, I chose a position for the beam to sit on the car and I mated it to prevent it from tipping over. This was done just to understand the theoretical maximum speed that the car and beam can travel at to set our motor speed. To obtain 0 redundancies, I kept my simulation simple and decided to leave out the wheels and other components however, it does not reflect a full CAD of the final prototype. Since there were no wheels in my model, I subbed in a linear motor for the typical rotary motor. The RPM was automatically set by Solidworks after I specified the 10 ft distance that the car must travel. Results from the motion study are shown below.
After simulating the path that our car will take, we determined the theoretical maximum acceleration of the car
From our results, we determined that the car can travel at a theoretical max speed of 0.7m/s.
The DC motor is hooked up to a HW-95 board and an Arduino Uno. The motor control pins are hooked up to pins 2 and 3 on the Arduino and they are alternatively powered to move the car forward and backwards.
While our motion study shows that we can balance the beam at a maximum of 0.7m/s, the body of the car touches the road, changing the overall center of mass of the car. Our car's body has an approximate elevation of 3 inches from the ground, so we had to decrease our car's speed to prevent the beam from falling. We reduced our speed by 25%, which allowed the beam to stay on the car.
As shown above, the car can successfully transport the beam ten feet and back without dropping it. We had to make some adjustments to the beam placement due to the center of mass of our car. In our motion study, the beam is placed at the back of the car however, we ended up placing the beam closer to the front of the car, because our other components were bolted to the back. We also turned the beam 45 degrees in an attempt to further equalize the center of mass of the entire system and the results proved that the orientation of the beam also had an effect on its stablization due to its cross sectional pattern.