H-Bridge to control multiple (16) motors
I have figured out the programming for my STAMP BS2 to control switch (PIN HIGH/LOW) for specific time and durations but I have a little problem. I would like to control 16 motors (12 V, 1.2 A) all simultaneously. These motors drive linear actuators for a solar panel setup. Most of the transister switching systems are generally under 2 amp. So, is there a relay approach anyone thnks would work?
AdobeJoe
AdobeJoe
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·
AdobeJoe
@ Kwinn-- If the motors are connected in series the you could not get the motors to drive at the same speed but in parallel the voltage and the current is constant. The only difference is if the motors have different resistance which this is highly likely but driving them within a 5-10% tolerance should be fine or at least close enough for what he is trying to do.
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
Post Edited (GWJax) : 4/3/2010 6:07:10 PM GMT
The 16 panels will be in a 4x4 array, each individually rotated (1-axis) with 30 inch stroke linear actuator. The STAMP and battery will be located in the center, for symmetry.
The motors are rated at 1200 mA, 12 V, under no-load.
Of course if there is wind, or snow, the load may vary, so I know there will be issues that have impacts.
The panels are 210 W, for 3.3 KW grid-connect.
The STAMP and linear actuators will be powered from a 12 V DC battery, on separate PV panel for trickle charge, maybe 30 W.
The controls from STAMP are Pin 4 on 5V to advance one direction, Pin 6 on 5V to retract or reset. I calculate about 30 amp-Hours per day to run actuators and stamp. In winter, I want about 100 Amp cold cranking capacity for my battery.
GWJax, I will look for more specs on motors. Any help appreciated
AdobeJoe
@adobejoe, I have never seen a design where all the motors are simultaneously controlled/run in parallel from one controller. I am certain you will end up with some fairly large positioning errors, if not initially, then as time and wear affect the individual motors and actuators.
For solar panel positioning speed is not a big issue so it would be feasible to have a single control system position each panel individually by enabling each motor in turn. Doing so would allow you to measure the voltage and current from each panel and stop it in a position where it outputs maximum power. Even simpler would be controlling the motors as a 4x4 array similar to how leds are multiplexed. Four H bridges would be enough to control the 16 motors.
Post Edited (kwinn) : 4/3/2010 10:15:12 PM GMT
I am not sure if this photo will come through, above, I am struggling with this MAC!
My design is unusual in the support which is on a diagonal, corner to corner, with the LA attached to the other "high" corner, providing pivot about the diagonal. This is stable in high winds, strong against winds and is a KISS style of mounting with rotation.
Anyway, the linear actuator is a Firgelli FA-05-12-30, adn I need to control all 16 with my single stamp program.
@GWJax, you may be right there may be some positioning errors, but I plan to build and test and determine for myself.
@kwin, I like the approach you mention with 8 DPDT relays. Can you sketch?
Regards
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
Thanks very much for your ideas. One thing, if it helps, would be for me to have two separate stamp BS2, operating independently, so that each would drive 8 motors/actuators...let me know
AdobeJoe
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
I must point out that unless the linear actuators you are using are excruciatingly slow there is no need to drive more than one motor at a time, and driving each motor in turn can reduce the peak power requirement, simplify the design, and opens up the possibility of a better control over panel positioning.
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
Good point, and since I am becoming more proficient with the programming, so I could just modify the code and use additional I/O pins. Say, rotate 4 panels at a time, in 15 minute increments, means I need 4 relays, each relay to control 4 panels? Now, what I need is a make and model for a relay that will operate under the 5 V from the output, and switch for 12 V/4x1200 ma or 4.8 amps, say 12V and 5 Amps on the motors. Where can I acquire a make and model to do this? Solid state or mechanical? Do you have a reference?
More challenging, is I need to reverse direction for one move of the panels back to home. What is wire diagram to do this?
Thanks for help, I can try to send a pic tomorrow from another PC.
AdobeJoe
While my preference would be to control the motors with solid state devices the relay circuit I posted will allow you to run the motors in both directions, and if your relay coil driver circuit (like the TPIC6595) can turn individual relays on and off you can drive one or more rows or columns of 4 motors at once, or multiple rows or columns at once.
If you have a circuit that can monitor the voltage and current from the panels you can use the BS2 to calculate the power output from the panels and in essence use them as the position sensor. As the four panels moves through their range the power will reach a peak at the point where they are in the best alignment with the sun. By adjusting each panel group to it's peak you can extract the maximum power from all the panels.
Also would be a good idea to measure how long it takes the linear actuator to go over it's full range of travel. That will determine if controlling each motor in sequence is practical.
Took me a few days to digest your image of 4/3/2010, but I finally have got it through my thick skull. Yes, I understand 8 single pole relays appear to be able to do the job, where each controls one group of four motors in the forward directions, or reverse. I can easily modify the software code. Thank you for that diagram!
The optoisolated triac drivers...aren't they only for AC circuits? I assume this is some LED sensing operation?
I am still confused about whether I should do this with solid state or mechanical relays. I bought at radio shack today a Tyco OMI-SS-212D just to play around. It is mechanical rated at coil voltage 12 VDC nominal coil current 60 mA. Pickup drop out voltage is 9.6//0.6 VDC. Not sure exactly what this means, but I know it switches at less then 9 V, because I tested it.
My STAMP I/O pin outputs 5 V, and 25 ma (sink) or 20 mA (source). Dumb question: Difference between sink and source? Can this output trigger or switch a relay directly, or do I need to trigger a 12 V with a transister?
Secondly, the group of 4 motors (linear actuators) should draw about 4.8 amp no load, but I should probably design higher, like 10 Amp?
AdobeJoe
One the schematics TP1 is A and TP2 is B these are where the signals come from your stamp to run it from CC to CCW and Stop. With this circuit never turn both A&B to a 1 Logic state or 5v to say. below is the truth table for the circuit
Function | A | B
Stop | 0 | 0
Forward | 1 | 0
Reverse | 0 | 1
Not
Allowed | 1 | 1
all caps are 25V and all resistors are 1/4 watt
Hope this helps you out.
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
Re >> The optoisolated triac drivers...aren't they only for AC circuits? I assume this is some LED sensing operation?
Triacs are generally used for AC circuits but they can also be used in DC circuits for some applications. In your case the triac is useful because it can conduct current in both directions. Once you trigger (turn on) a triac it remains conducting until the current through it drops below a threshold value. If you put the motor and triac in series between the legs of the H bridge you can use the H bridge to control the direction and to turn off the current through the motor and triac. Once that happens the triac will not conduct until it is triggered again.You could even use a single double pole double throw relay in place of the H bridge with the 16 triac circuits.
The 12VDC nominal coil 60mA relay spec refers to the normal operating voltage and current of the relay coil. The Pickup drop out voltage is the minimum voltage the relay is guaranteed to turn on and turn off at. It may operate at lower voltages but it is not guaranteed.
The sink current is when the load is between the +5V and the pin. The pin then sinks that current to ground.
The source current is when the load is between the pin and ground. The pin then sources the current to the load.
You will need a driver chip between the STAMP and the relay coils. A ULN2803 using 8 STAMP pins or a S/P like the TPIC6595 using 4 pins.
Using a relay that has contacts rated for about twice the expected current is a good idea. If you are only activating four motors at a time then an 8-10A contact rating for those 4 relays is a good idea. You could get away with a lower rating (2.5A) for the other 4 relays but it is usually simpler to make all 8 relays the same.
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
Thanks for these diagrams. I will have to study--be patient. Stuff like this takes more then a few days to sink in. I sense this may be the way to go, to eliminate the problems with mechanical switching (arcing, etc), but I just to study to understand how this would work. One concern is that I only have 16 I/O pins on the stamp, and three are dedicated to the DS1302 chip, so I have 13 available, and I am trying to rotate 16 panels.
Your circuit diagram with the Mosfets shows four motors (S1-S4) in parallel, so they would rotate together? The circuit is hard wired to those four motors...the triac drivers (your other diagram) would all connect to the single H-Bridge...to the same four motors? I need to rotate four sets of four as in the Kwinn diagram.
@kwin,
Your setup with 16 motors makes complete sense, just trying to couple with the stuff from GWJax.
AdobeJoe
When you combine both of the circuits it only takes 2 pin off the BS2 so to drive the 16 motors you will need to build 4 of these circuits. With that said you are only using 8 I/O pins to control the motors.
The Hbridge circuit should be able to take on 8 motors but this is pushing the circuit to it's limits. Now if you use the Spin chip you can operate all the siginal lines at the same time using 4 COGs but then there is a learning curve on the programming which I'm still trying to learn. If you can get your hands on the BS2PX24 then running your routines will increase about 1.5 times or so. This is my BS of choice.
The motors in the circuit will move at the same rate or real close to it depending on the resistance of the motors coils. What I would do is measure the resistance of each motor and apply a resistor of for the correct value so each motor has the same resistance at at least a 1% tolerance between them and make sure you use at least a 5-10 watt resistor for these to be on the safe side. The Hbridge will output at around 32 Amps so heat sinking these MOSFETs are a must.
Did you look at the youtube video of mine that shows how the optocouplers work? if not view this video to get a better understanding on how it works. If you need a detailed description how everything works just let me know and I'll step you through each process.
Keep us informed on what you will do and how things are working. If you want to share your source code with us we can help you out there as well.
One other thing is that you must connect all grounds together, that is including the BS2's Ground. If these are not connected then the circuit will not work with the BS2. This was just a little FYI in case you did not know it.
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..
Thanks for correspondence. Did look at the Utube and that helped some.
I am discussing this with a local electronics shop. Either have them build it, or decide to do it myself. The cost on the H-bridge can't be too expensive, and, yeah, I would need four, one for each bank of four motors.
A couple of other concerns is we get very cold here in winter, like -20 deg F, but it would be in an insulated battery box, so maybe not too big an issue.
I will mull it over the weekend, and decide what to do.
THANKS for your help.
AdobeJoe
Jax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..