sinking only outputs

Forgive me for more OT posts. I'm pretty weak on EE work. And I'm getting good advice here. So there will be a lot of queries on my high tunnel ventilation project.

I ordered this board to deal with my IO shortage:

formatting link
Turns out this board can only sink the outs, not source. I need to run a dc motor both directions. The only solution I see is to also have a pair of double pole ice cube relays. Close relay 1 for up relay 2 for down. Am I missing another solution?

This works and I'm moving on. But its a kludge - Module to expander to relay pair. VS just a brain attached to an Opto22 board and use four outs for up and down.

I got the same query on how to direct the IO group to which one of the four motors. The plan here is to have four outs that turn on all the IO for motors one, two, three, or four. (each motor has power up, power down, upper limit, lower limit, rotation counter) Only deal with one motor at a time. I always think in terms of sourcing - turn the power on to the group I'm using. With sinking only outs, I'll have 12 volt everywhere and only ground the group I'm using. Is this a problem? I don't feel comfortable with it. Should I also have four ice cube relays to direct power to the right motor? Again, this will work but its a total kludge.

You guys are going to start thinking I'm just like that "Stryped" fella building his garage.

Karl

Reply to
Karl Townsend
Loading thread data ...

I'd drive an H bridge from the open-collector outputs, which are an advantage because they let you shift the logic levels to the higher voltage of the motor power supply.

Leave some OFF time between directions. Transistors and especially relays close faster than they open.

jsw

Reply to
Jim Wilkins

If you use one double-pole double-throw relay for reversing, and another for on/off, there will be a physical prevention from attempting to drive the motor both ways at once.

Dave

Reply to
Dave__67

You're missing a few things, not the least of which is "off".

Digital I/O has two states, 1/0, on/off, true/false, etc. It takes two I/O bits to control a motor for fwd/off/rev, typically as run and dir outputs.

The next thing you're missing is current capacity as nearly all I/O boards only have sub Amp capacity on the I/O lines to drive other circuits, not big devices like motors directly. The ULN2803 drivers on your board are rated at 500mA per output, and total package dissipation is limited to about 2W or less depending on ambient temperature (see graph in ULN2803 data sheet). 500mA at 12V is 6W, so you can't even run one output at full load continuous without exceeding package dissipation.

There are various "H Bridge" motor drive chips, typically in a big TO-something heat sinkable package, as well as the obvious mechanical relays.

Look at your wiring for a relay for up and a relay for down configuration and you'll likely see additional power supply complexity and a failure mode to short the power supply. Run and dir is simpler and safer with a DPDT reversing relay and a SPST run relay. Or an "H Bridge" chip for solid state control.

Unless your rotation counting encoder is on the output side of a slow rotating gear motor you are going to have potential to miss counts if you are not careful. Your limit switches should protect you, but be sure they allow for some mechanical over travel as the micro reacts and shuts off power and the motor coasts to a stop since you have no braking.

You could potentially add braking resistors to a relay motor drive configuration of use an drive chip that supports braking to help limit coast.

Reply to
Pete C.

A subtle danger: one DPDT or "2 form C" relay with mechanically connected contacts should work, but if you assemble it out of two paralleled relays and one is faster they can short out the power supply when the motor reverses with power applied.

Four single pole, normally open ice cube relays will make an H bridge. One I/O bit pulls in the two relays on say the NorthWest and SouthEast legs of the H to drive in one direction, the other bit pulls in the NE and SW relays for the other direction. The motor is in the crossbar, power above and below.

Both bits together short the power supply and light up the series- connected headlight bulb that means Operator Attention Required. Always assume relay contacts can weld shut or semiconductors fail shorted.

jsw

Reply to
Jim Wilkins

One more warning. Small relays, like the cube relays mentioned by Karl, can have problems switching DC inductive loads. Best case, the relay contacts will have a short life. A bigger problem is that the arc initiated when the relay opens may not quench and will deliver enough current keep the motor turning. Obviously the potential for problems with arcing is greater with a 90V motor than a 12V motor.

Reply to
Ned Simmons

You're getting at least as good of advice here as you'd get from sci.electronics.design -- particularly because over 50% of the people there wouldn't understand that you don't want to custom build 50 boards.

Close both relays for Pffft!

I think it's mentioned already -- one DPDT relay for reverse, one SPST relay for 'on'.

If you mean four outs for an H bridge, yea -- see my "pffft" comment above. As a career embedded software guy, I always like to see a bit of hardware in between the software I may write on a bad day -- and a contractor may 'improve' on a worse day -- and any direct paths between the power supply rails.

I'm confused by this -- what are you really trying to do? Why not just use two outputs for each motor, with their relays, and (if that's what you want) constrain software to run one motor at a time, or gang them, or whatever. It seems that directing power around in hardware would just be redundant.

If you really need to be parsimonious with I/O you could use one line as a master reverse line and a bunch of DPST relays to connect in each motor. This would constrain you to never having two motors going in different directions simultaneously, but it sounds like this isn't in your game plan.

Not yet. Different classes of questions.

Reply to
Tim Wescott

Most of the various "H bridge" driver chips will have control protection built in and provide run and dir inputs.

Actually this is a pretty good idea and could reduce relay count as well. One larger DPDT relay to reverse the master motor power supply, and then just one DPST relay per motor for run control, vs. two relays per motor.

Reply to
Pete C.

Also, if he's polling for encoder counts it's best not to move more than one motor at a time. Honestly, I think a better and easier plan would be to use 1/4 scale RC servos and one of the various serial servo controller boards available. One I/O line could control a master servo power connection to provide for a power down standby for the long periods between motion commands.

Reply to
Pete C.

OK, group. Thanks for the help. Best plan here is each of the four motors has two ice cube relays. One for power on and one for forward/reverse. Uses

8 total outputs. I got eight left to use.

I'm looking for a way to conserve inputs. Each motor has two limits and a count pulse for a total of twelve. There's no need to look at more than one motor's inputs at a time. So, I'm looking for a scheme to use only three inputs and have all the forward limits on one input, all the reverse limts on one input, and all the pulse counts on one input. I got spare outs that only sink unless I go to a circuit description I don't quite understand in the doc:

formatting link
I guess my question boils down to "how to wire it?" using four outs and three ins and need to read twelve devices.

Karl

Reply to
Karl Townsend

You can use two SPDT relays (cheaper and more current capability than DPDT). (View with fixed width font):

VCC + | + --------------------------+ | | | | | | | | | _ | +-o / \ o- + K1 __--o----(_M_)-----o--__ K2 +-o \_/ o- + | | | | | | | | | | +---------------------------+ | === GND

Logic is as follows-- you can drive the relays with the ULN2x03 on your board with no added components.

K1 K2 Motor Off Off Off Off On CW On Off CCW On On Off (avoid this combination to save relay power).

Reply to
Spehro Pefhany

I don't know if this will help, Karl, but this is how I would do it...

The 74LS151 is a 1 of 8 input multiplexer.

formatting link

One of the eight inputs is addressed by three address bits. There is also a strobe pin, but it isn't needed here and can be grounded.

There is a singe data bit from each of these chips that will be wired to an input port bit. This is the bit you read.

According to the above, we need three of these guys.

One chip for each function - top limit, bottom limit, position pulse.

The three bits used for address are wired to all the mux chips in parallel so that, for instance, when motor 1 is selected, the mux chips all select the data from unit one.

So, set three output bits to select the inputs from unit (0 to 3). Read the respective input bits on the three input port bits.

So that lets you have up to eight channels.

If there are only going to be four, a 74ls153 will suffice. That a dual 1-of-four chip.

Now, for OUTPUT bits, consider my all time favorite, 74ls259.

formatting link
Eight addressable single bit output bits. This guy really helps simplify the software! No byte-wide bit masking required in software. Just out a 0 to set 0, or out a 1 to set 1.

Reply to
cavelamb

74LS259 is good for logic level outs. Allegro has a whole assortment of chips that can do the same thing, but drive relays directly - including protection diodes.
Reply to
rangerssuck

I think I get this. Is this the right way to say it in english?

  1. Hook 12 volt (Vcc for you EEs) to NO side of each relay.
  2. Hook ground to NC side of each relay.
  3. Hook motor to common on each relay.

Power to coil of relay 1 for forward, relay 2 for reverse.

Karl

Reply to
Karl Townsend

How are you going to combine the limit inputs? Since they can be in random states they can be neither ANDed nor OR'd together. You could XOR them, but vibrating another motor off the stop would give you a false transition. I think they are more useful to cut motor power, with the diode that allows reverse motion.

Does this thing have an A/D converter? If so you could watch motor current to hopefully detect a jam or binding or the shutoff at the limit. You might not need the pulse sensor. The position control would be open loop based on cumulative run time but you could get it up and running faster and cheaper and then see what improvements are needed, maybe string pot absolute position sensors which would recover from power loss without having to HOME all the motors.

formatting link
jsw

Reply to
Jim Wilkins

Sorry, guys. I don't build and design cirucit boards. I'm trying to build a working prototype with modules I can purchase. I'm looking for the best way to do it with the basic stamp with 16 opto isolated IO and 16 output expander that I've purchased.

Karl

Reply to
Karl Townsend

Yup. The nice thing about this -- if you use regular ol' break-before- make relays, and don't switch things too fast -- is you don't have to worry about tying the power rails together with your switches. Either of the both-coils-off or the both-coils-on states just shorts the motor and makes it stop.

Reply to
Tim Wescott

I don't know if there _is_ a way to do this without building the odd circuit board, or finding more inputs. Although this is about the easiest circuit board in the world to make, assuming you can still get the circuit boards from Rat Shack with their proto board pattern.

The alternative would be to go back to the idea of a basic stamp for each motor, and a supervisory basic stamp for the whole system. That's a programmer's delight, and may be a good architecture for a production system (as you just package motor and micro together into a 'smart motor'), but it's getting away from the Kludge it Kwik philosophy that I think you want.

You may be able to do this with RDL (resistor-diode logic) and tell yourself it's not "really" electronics. But that's kind of cheating.

Reply to
Tim Wescott

Spehro,

You just gave me the missing gem. Now I can see a way to do this in my mind's eye.

I've already got DPDT relays, so this idea gives me a spare. I'll put the forward limit switch between the common connection of relay 1 and pole 1 of the motor. From pole1 of the motor, I'll run a wire to the spare common connection on relay 1. From the NO side of this spare, I'll go to my limit switch input. (From the NC side, go to ground to bypass limit switch when not powered - enables backing off made limit) If the motor is running the limit switch is not made. I'll also go to the power side of my pulse counter from the spare NO connection. Now the counter is powered, and I'll see pulses on my counter input.

Do the same idea with the reverse relay and reverse limit switch.

I wish I was enough of a EE to at least draw this. Unfortunately I've never learned to draw my ideas into electrical prints.

Karl

Reply to
Karl Townsend

What's that Lassie? You say that Karl Townsend fell down the old rec.crafts.metalworking mine and will die if we don't mount a rescue by Tue, 12 Jan 2010 14:37:44 -0500:

You don't need to use any inputs for your limits if your motors are DC.

Just wire the limit switches in series with the motor. Then add a diode across the switch to allow the motor to back off the limit in the opposite direction. The controller won't know that your system has hit a limit, so if that is important you may need to use your inputs.

Reply to
dan

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.