About a month ago, I had blogged about my lab projects for my Mechatronics class. Well, every week the labs got progressively more complicated and right before Spring Break, our second to last lab, we had to use sensors to provide feedback to control a linear motion system. The rest of this blog is me geeking out about this cool lab. It was mostly frustrating until, slowly, each component worked and then it was exciting.
Basically, we used a motor to turn a nut that was threaded on a metal screw. Thus, this linear motion system translated rotational motion (turning) of the motor into linear (back and forth) motion of the nut on the screw. To prevent the nut from rotating, we had to find innovative ways to keep it in place.
Then, we used whatever sensor we wanted (I chose an ultrasonic sensor – see picture) to measure the limits of the motion range and use that to program the system to move the nut to the middle of the motion range. We also had to program it to move an arbitrary distance – say 3.5 inches – based on user input, which basically just meant changing a variable in the micro-controller code that controlled this closed-loop system.
Some of the challenges I ran into was using a motor that didn’t have high enough torque and troubleshooting my code to control the motor based on software and sensor readings. Luckily the ultrasonic sensor was robust and usually provided consistent measurements so that was surprisingly easier than expected.
This lab has applications in a CNC turning machine, 3D printer, or something as simple as a gated entry, like those in front of some apartment complexes around USC. This open-ended lab with specific tasks but multiple ways to reach the end goal required problem solving and perseverance. Ultimately, my set-up worked! Now I feel slightly more comfortable calling myself an engineer!
Published on March 27th, 2016
Last updated on January 20th, 2021