0
\$\begingroup\$

I need to sequentially power some coils with 10 milliseconds of delay between stages. I'll demonstrate it with 1s and 0s because it is the easiest way for me. 1 = On, 0 = Off. Each coil is powered for 20ms. I will be using 2 of these batteries: http://www.all-battery.com/li-ion1865074v2200mahrechargeablebatterymodulewithpcb.aspx?utm_source=GoogleShopping&utm_medium=GDF&gdffi=fb520bc42d4e46cbab702234d35f7d38&gdfms=84C089F27C604843AE94F6D58759BF54&gclid=Cj0KEQjwjK--BRCzv-Wyu4OTosEBEiQAgFp5OHAsNGKWYNXVuPJ-seUqnTcQIQYEQvtMRQt3g-JGD1kaAkvo8P8HAQ

Battery Stats: Amps: 4, Volts: 7.4, OHMs: 1.85.

Coils: Each is supposed to be provided with 0.5 Volts of DC power, Application: move a 3 inch metal rod as fast as possible, Each coil is on for 20ms, Intercoil delay should be 10ms

~Stage One:
Coil 1: 1
Coil 2: 0
Coil 3: 0

Delay 10ms

~Stage two:
Coil 1: 0
Coil 2: 1
Coil 3: 0

Delay 10ms

~Stage three:
Coil 1: 0
Coil 2: 0
Coil 3: 1

Code proposed: http://pastebin.com/jBQqZWjR

\$\endgroup\$
  • \$\begingroup\$ what electronic construction skills do you have? Does this repeat? What power level? \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Sep 5 '16 at 0:19
  • \$\begingroup\$ How long will each coil be energized? \$\endgroup\$ – EM Fields Sep 5 '16 at 2:35
  • \$\begingroup\$ @EMFields the question (including original version) specifies 10 ms per 'state'. \$\endgroup\$ – user2943160 Sep 5 '16 at 2:38
  • 1
    \$\begingroup\$ note: ms, not MS.That may seem trivial but things like that affect the way in which your questions get handled. (FWIW MS = mega-Siemen). | I see you have added on delays and spaced on periods apart as you originally intended. \$\endgroup\$ – Russell McMahon Sep 5 '16 at 8:01
  • 1
    \$\begingroup\$ There are some significant inconsistincies in your supplied information. You say "Battery Stats: ... Volts: 7.4," = ?: 1 coil, 4 coils, battery impedance, ...? . You have a 12V battery. You say also "Each is supposed to be provided with 0.5 Volts of DC power" . But: 12 <> 7.5 <> 0.5. | And FYO LiIon 7.4V nominal = 6V-8.4V across operating range. What is the COIL resistance per coil? How are you going to limit coll current. || Rail gun? Timing matters. Other: ? - timing may matter. | \$\endgroup\$ – Russell McMahon Sep 5 '16 at 8:14
2
\$\begingroup\$

Given that you know what code you wish to use the electronic requirement is trivial.
Note: "Trivial" does NOT mean easy, or will not destroy things if done wrong :-).
What coil voltage.
What coil current?
AC or DC coil voltage.

In this case it should be easy, and should not destroy things :-).
IF DC coil voltage is used either a diode should be placed across the coil so as to not conduct when the coil is activated. This will slow down coil current die-down times when the driver is turned off and you need to supply more information if this is liable to be important. As always, actually telling us what you are trying to do and not just what you think may work is likely to get a better-quicker answer.

Note that your code is wrong and it does not do what you say you want.
It is easy to change it to do what you want.
Do so!!!
(At present it turns each coil on for 10 mS at a time with NO delay between each transition. )

You need a Coil driver per coil which accepts a 0/5V signal as off/on input and has a suitable current and voltage rating.

Here is about as simple a circuit as you can get. ( From here but not really important.) Yhe relaay contacts need to be rated to suit the load. The coil COULD be placed in the collector of the tramsistor where the relaty is with no relay - and the +5V supply could ve V_coil_supply, but you get only partial isolation.

Microcontroller pin at left. Resistor depends on drive needed. 1k probably OK.
Transistor type depends on relay but in many cases the one shown or similar is OK

enter image description here

And here are a few zillion idea starters.

And here are microcontroller to MOSFET driver ideas. In each case the relay shown COULD be the coil directly.


In the code, how can I add a timing for how long each coil stays on?

This varies (of course) with controller, language etc but eg

delay(off_delay_time)
digitalWrite(coilXXX, HIGH);
delay(on_time);
digitalWrite(coilXXX, LOW);
...
\$\endgroup\$
  • \$\begingroup\$ What is a "Coil Driver" and can you please go into slightly more detail about "IF DC coil voltage is used either a diode should be placed across the coil so as to not conduct when the coil is activated. This will slow down coil current die-down times when the driver is turned off?" Also, what is the use of the relay and is it needed? \$\endgroup\$ – Zivicium Sep 5 '16 at 3:16
  • \$\begingroup\$ ... that's exactly what trivial means... \$\endgroup\$ – Passerby Sep 5 '16 at 4:16
  • 1
    \$\begingroup\$ @Zivicium Read again carefully and look at the links I cited. Look for examples of "diodes placed across coils so as not to conduct ...". Before asking questions about specific it is usually wise to read the answers given AND look at the references to see if the answers then become clearer. We don't mind you asking but we like people to learn by engagement as well. ie thhis is not just pedantry on our part. (Not JUST :-) ). | Understanding relay use is a basic essential and you will find utterly vast amounts on web. My answer comments re it being needed or not. \$\endgroup\$ – Russell McMahon Sep 5 '16 at 8:05
  • 1
    \$\begingroup\$ @Zivicium Affect of and relevance of diode on timing can be discussed when we find out more about what you are trying to do. \$\endgroup\$ – Russell McMahon Sep 5 '16 at 8:15
3
\$\begingroup\$

Some 74LS logic would do this. Specifically a 74LS590 counter and 74LS138 demux, paired with a 555 timer and a couple transistors.

Simply wire the 5th output on the 74LS138 back to the Reset on the 590 to initiate a reset after the first 4 pins have been sequentially energized. Or use the 5th pin as an enable/disable bit, to stop the timer after one run.

Depending on current requirements, you could use 2n2222 transistors and flyback diodes, or something more heavy-duty like Fairchild's FDD8447L MOSFETs.

Add the requisite passives and a 5v regulator for the 74 series chips, and you're good to go.

\$\endgroup\$
-1
\$\begingroup\$

Use an MCU to switch coil drivers on/off

\$\endgroup\$
  • 2
    \$\begingroup\$ This is not a good answer. At most this should be a comment to the original question. And @Zivicium, do you not think that such a requirement should be included into the body of your question ? \$\endgroup\$ – efox29 Sep 5 '16 at 1:44

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.