BASIC MOTOR CONTROL AND RELAY LOGICMany machine functions involve turning motors on and off and/or reversing their direction. While there are many electronic motor controllers of all types on the market, if all one needs is to power a motor or other load on and off, an electromechanical relay is often all that is needed. For switches with more than two poles or throws, the number is given as a numeral such as "4PDT" for a Four Pole, Double Throw Switch. In the diagram, the dashed line indicates that all poles of the switch operate together. RelaysRelays are nothing more than electrically operated switches. Relays use an electromagnetic coil to pull the poles of the switch into position. Most relays return to the normally closed position by a spring when the coil is deenergized, so relay contacts are usually identified in the same way as those of a momentary contact switch. Simple DC Motor ControlPutting all of this together, here is a simple motor control circuit. The paramaters of this circuit design call for a single continuous contact switch (such as a basic wall switch or toggle switch) to activate a motor to drive a load to a certain limit. The load could be a gate opener, an elevator hoist, or a valve actuator, for example. We want the operator to drive the load to its limit, then stop and remain there until the switch opens, at which time the operator will return to its "home" position.This particular control application can be accomplished with two SPDT momentary contact limit switches, two SPDT relays, and one SPDT toggle switch. Here is the circuit diagram: Let's analyze the circuit, starting with the two SPDT relays. These relays are configured in a reversing arrangement. If we follow the power and ground leads from the battery, we see that each normally closed position is connected to positive (+) and each normally open position is connected to ground (-). In this way the motor normally sees +12V at both leads. Since there is no net difference in potential, the motor remains stationary. In fact, since the motor leads are electrically connected, or shorted, in this arrangement it acts a brake to keep the motor from moving. This same arrangement has been used in golf carts and other motorized equipment to assist with braking. Notice, though, that if either of the relays are activated, we get a connection to ground on that relay. If you trace the paths you will see that depending on which relay is activated the motor polarity will reverse. (You might also notice that if both relays are activated simultaneously we will see negative or ground at both motor terminals and again the motor will stop- however, this does not come into play in this example.) What we have described thus far is a basic motor reversing cicuit that could be used in many robotic applications. The only real difference in how it is applied comes in how the relays themselves are controlled. For our example we have arranged limit switches to provide a specific behavior. In this diagram, we see the circuit as it would be in the "home" position. The SPDT toggle switch is up, which is the "home" or "off" position for our purposes. For the sake of discussion, we will say that we are controlling a gate opener, and as we see it here the gate is in the closed position. We can see Limit Switch 1 in the activated position, the dashed line indicating that the normally closed position is now open. If we trace power from the battery, we see that it goes through the normally closed position of the toggle switch, up to Limit 1 where it is blocked because that throw is currently open (because the closed gate is resting against it.)
Now let's say that we wish to throw the switch and open the gate. The next diagram shows the new positions of our switches and relays: Again tracing power from the battery we see the toggle switch now closed. Power has now been directed through Limit Switch 2 and on to the Left Side Relay, which has activated. In this position we see that our negative motor lead is now getting a connection to ground, so we see our motor rotating clockwise. (This direction is arbitrary- I could have shown it going the other way.) Our gate is now opening! Note that Limit Switch 1 would have changed positions the minute the gate started moving. The position of this switch no longer matters, though, since as you can see nothing else is connected to it at this point.
Next we see that our gate has fully opened. As it reached the end of its travel it contacted Limit Switch 2 and activated it. This in turn cut off power to the right side relay, which disconnected our ground connection to our motor shutting it off. Our toggle switch is still in the "on" position, which will hold our gate open as long as it remains in this position. Finally, we decide to close the gate. By placing the toggle switch back in the "off" position, we route power back up to Limit 1, which is now in the normal position. We see that current can now flow through the normally closed throw to energize the Right Side relay. This connects ground to the positive side of our motor, and we see it indicated as moving in the counterclockwise direction. Our gate is now closing! Without the need for another drawing, we can see that the gate will continue to close until it once again contacts Limit Switch 1, at which time the ground connection through the Right Side Relay will be cut and the motor will stop, with everything back in the "Home" position.
If your application called for the motors to be activated by a voltage signal instead of directly by a switch you would need only the replace the SPDT switch with a SPDT relay, then activate the relay with your signal voltage. The last diagram illustrates this. In this way you could control the gate with a remote control, or use the circuit to power a headlight door whenever it recieves voltage from the headlight circuit. Updated 12 April, 2008 |