Saturday, January 27, 2018

Lab 8: Bi-directional Motor Control

In this lab we experimented with changing the direction of a spinning motor.  If the positive and negative of the current are switched to the motor, the motor will spin the opposite direction.  This can be achieved with a DPDT relay.  When power is turned on and off to the coil of the relay, the relay switched between normally open and normally closed on both sides of the relay.  This gives the result of the motor changing the spinning direction.  We constructed a simple circuit with the relay and controlled the direction of the spinning motor through the wires that fed power to the relay coil.



You can hear the relay clicking as power is applied and removed and also see the direction of the motor changing as power is applied and removed.



Next we used an H-bridge to control the direction of the motor.  We chose option 2 in the lab which meant we would solder together our own H-bridge to use in the lab.  We obtained the correct circuit board, transistors, resistors, diodes, and soldered everything to the board using the diagram on the circuit board.  Here is the H-bridge:








After building the H-bridge, we connected it to our breadboard and also connected the motor across the M+ and M- pins.  We used the 5V power supply across the VCC and GND pins.  By simply changing the positive and negative to the H-bridge by switching the wires, the motor changed it's direction of spin.





This is like a manual relay where you change the positive and negative by hand and unplug the wires.



Then we connected IN1 and IN2 to pins 12 and 13 of the Arduino and referred to the code used in the previous lab to turn the motor on for 50ms, stop for 1 second, reverse direction for 50ms, stop for 1 second.  This was set up in the loop so that it would continue endlessly.



Lab 8 finished!



No comments:

Post a Comment

Lab 17: Using IR Sensors for flame and line detection for the VEX

In this lab, we used everything we learned in the previous labs to complete this final lab challenge.  The challenge was to navigate a maze ...