0
\$\begingroup\$

I'm working on a hobby project and bought some cheap linear actuators with motors in them. Due to the terrible motor speed/torque, I switched them out. Now I have to implement a safety feature to kill the power to the motor whenever a limit switch is actuated in the device. (It tears up the device if it goes too far.)

Below is the project setup, but this is what I think i need to do. I need to a N-channel power MOSFET to control a P-channel MOSFET. The first one can be this one and will control a 12v current from the power supply to trigger a second MOSFET. This second one is what will kill the power to the motor whenever a voltage is applied. I think i need to use two because the voltage difference between the arduino and the 12vdc power supply is too much to trigger the P-channel MOSFET by itself quickly enough.

How off am I? I'm a hobbyist, but i'm trying to design it right before building it.

Project Setup

  • Arduino board
  • 12vdc brushed motor that normally pulls 15-20 amps
  • H-Bridge Relay from Arduino to motor, for control, but not safety shutoff. http://www.vexrobotics.com/217-0220.html
  • 12vdc power supply
  • Linear actuator with gearing and two limit switches at either end of gear. (If either one is hit, then it breaks the circuit. setup in series.) Example actuator that looks similar but isn't.

schematic

simulate this circuit – Schematic created using CircuitLab

To make it clear: This is a safety shutoff and will only be used to protect the motor from destroying the actuator if there is a bug in the program actuating the device. I can flip the power manually if the power gets cut because of this new circuit. I just can't rebuild the gearing.

\$\endgroup\$
8
  • \$\begingroup\$ Would an Op-Amp be useful to increase/decrease the voltage instead of a two stage transistor setup? \$\endgroup\$ Feb 18, 2016 at 0:20
  • \$\begingroup\$ Please post a schematic of your proposed circuit. Otherwise, we don't know enough to provide real feedback. \$\endgroup\$ Feb 18, 2016 at 0:41
  • \$\begingroup\$ I can, but will need to get a program to do it. (I'm on a Mac.) I use pen and paper, but i don't think you want a picture of it. :) \$\endgroup\$ Feb 18, 2016 at 0:43
  • \$\begingroup\$ A pencil sketch or a white board drawing would be okay (at least for a start). \$\endgroup\$ Feb 18, 2016 at 0:45
  • 1
    \$\begingroup\$ @schumacherj You can add a schematic to your post via the built-in schematic editor. Also, Kicad, Eagle, and LTSpice all run on a Mac (and are free) and can be used for schematic capture. Granted, there might be a bit of a learning curve, but it's a good skill to have! \$\endgroup\$
    – uint128_t
    Feb 18, 2016 at 0:53

3 Answers 3

1
\$\begingroup\$

You're doing it the hard way (even ignoring a bunch of craziness and nonsense in your schematic, like shorting the power rails through two switches), because it's really annoying to control a FET in series with a load (the motor) where the voltage is all over the place because of the H-bridge.

The right answer is to leave the motor directly connected to the H-bridge and to control the H-bridge inputs using the limit switches.

What H-bridge are you using? Its control scheme (ENABLE+DIR? FWD/REV?) will change how you wire it up. You don't want to completely disable the motor when an end-stop is hit, you just want to prevent it from continuing in the same direction.

You say "H Bridge Relay", so I'll draw it as a pair of relays:

schematic

simulate this circuit – Schematic created using CircuitLab

With this schematic, the motor will be idle by default, will run one way when FWD is pulled up, and will run the other way when REV is pulled up (connect these wires to microcontroller outputs). If you pull them both up, it will stop.

SW3 and SW4 are your limit switches. Each one, when open, prevents the motor from running in one direction. The motor can still run in the other direction though, to allow it to come away from the stops.

If your bridge is something else (some FETs controlled by some fancy silicon?) the control scheme will differ, but the desire is the same: each limit switch prevents the motor from running in a particular direction.

Edit: I see you've posted the H-bridge model number now. It's mechanical therefore too slow for PWM, but it's also wired pretty much like I've drawn it above, with opto-isolators in place of the transistors I've shown.

If your limit switches are wired together and have only two terminals present, then you can't tell which switch has been hit, so you can't easily make a safe-in-hardware system. You would need to keep track in software of which direction the motor is running and monitor the limit switch in software. The software would be responsible for deducing from the motor-direction which limit switch was hit, and if it goes wrong (or the software crashes), your motor will crash into its hard stops.

If your limit switches have a common connection (3 pins), then it's doable like this:

schematic

simulate this circuit

The conjugate with NPN transistors would also work but it's less obvious which limit switch affects which end. Either way, you will need to do some testing+experimenting to make sure that things go in the direction you expect and stop in the correct directions.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the quick response. I'm updating my schematic to just show constraints. Namely, there is a single relay that has PWM for control. Also, the switches are naturally closed and are in series. They are embedded in the device and I can't change them. \$\endgroup\$ Feb 18, 2016 at 6:18
  • \$\begingroup\$ If it's a mechanical relay, you won't be able to use it for PWM. Do the switches have an available common connection or are there just two terminals? \$\endgroup\$ Feb 18, 2016 at 8:33
  • \$\begingroup\$ so I just saw you updated the schematic with the relay model number; the datasheet indicates that it is wired very nearly exactly as I've drawn above where FWD=white and REV=red; the only difference is that it contains opto-isolators. \$\endgroup\$ Feb 18, 2016 at 8:40
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Test circuit with 2-pole 2-way switch.

You mention in a comment that the limit switches are normally closed and in-series. This is most unusual because once a switch opens you won't know which one and you won't be able to run the motor to move off the switch.

The circuit in Figure 1 shows a more normal setup.

  • With the switch in the position shown the top of the motor is connected to battery + and the motor will run left until LIMIT-L is pressed.
  • When the switch is thrown the battery + is connected to the bottom of the motor and current will return to the battery from the motor top despite LIMIT-L being open at this time. The motor can now run right.

I recommend that you check the limit switches again and see if you can set up and understand a simple circuit like this before moving on to electronic control.

A photo and link to the actuator datasheet would be most useful. Also, note that the switches should be set back a little from the physical end of travel to give space for the motor to decelerate to a stop.

\$\endgroup\$
1
  • \$\begingroup\$ I thought it was unusual as well. I don't have the data sheet because the actuators are dirt cheat and don't have an identifying mark on them. I added a link to a similar looking one. The switches are set back from the ends inside the moving part. About an inch total of space. I'm not wanting to control the motor, but have a safety shutoff to stop the motor from damaging the part if it goes beyond a safe operating zone. \$\endgroup\$ Feb 18, 2016 at 7:36
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

A box is a H-Bridge, RLY1 is a power on relay, Sw1,2 are limit switches and a button Safety override is used to switch on manualy to move motor back in case it hit the limit switch. EDIT: Added start stop button to eliminate the glitch, when limit switches are overdriven on the edge.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.