Multiple output sequential device driver ?
-
NorthernMonkey
- Posts: 4
- Joined: Mon Dec 16, 2013 9:33 pm
Multiple output sequential device driver ?
Hi there,
I'm new to this forum and a bit lacking in knowledge in regards to advanced electronics, I'm looking for some help on a project I'm wanting to undertake.
My background is mechanical engineering but I'm not a complete numpty when it comes to electronics.
So, what I'm wanting to achieve:-
My project involves a number of electro magnetic coils placed around a copper ring (hula hoop) roughly 1 metre in diameter
I'd like to be able to sequentially switch the electro magnetic coils in a loop one after the other creating a rotating field around the ring.
Now my initial thought was to try using the parallel port of a computer and write a program to switch the outputs but was informed that was quite difficult unless you had a really old computer.
I purchased a K8055N / VM110N USB Interface Board from maplins and was able to write a program that achieved the desired switching, the only issue was the max frequency at which it seemed to top out at.
I'd considered Arduino but that seems to suffer the same issues.
Ideally I'd like to be able to experiment with the switching from relatively low frequencies to above 1Mhz full sequence.
Has anyone got any ideas on a piece of equipment circuitry or program that would allow for this.
Any help would be greatly appreciated.
Thanks in advance.
NorthernMonkey
I'm new to this forum and a bit lacking in knowledge in regards to advanced electronics, I'm looking for some help on a project I'm wanting to undertake.
My background is mechanical engineering but I'm not a complete numpty when it comes to electronics.
So, what I'm wanting to achieve:-
My project involves a number of electro magnetic coils placed around a copper ring (hula hoop) roughly 1 metre in diameter
I'd like to be able to sequentially switch the electro magnetic coils in a loop one after the other creating a rotating field around the ring.
Now my initial thought was to try using the parallel port of a computer and write a program to switch the outputs but was informed that was quite difficult unless you had a really old computer.
I purchased a K8055N / VM110N USB Interface Board from maplins and was able to write a program that achieved the desired switching, the only issue was the max frequency at which it seemed to top out at.
I'd considered Arduino but that seems to suffer the same issues.
Ideally I'd like to be able to experiment with the switching from relatively low frequencies to above 1Mhz full sequence.
Has anyone got any ideas on a piece of equipment circuitry or program that would allow for this.
Any help would be greatly appreciated.
Thanks in advance.
NorthernMonkey
-
nicholasdark
- Posts: 29
- Joined: Sun Nov 24, 2013 12:17 am
Re: Multiple output sequential device driver ?
HI Northern Monkey,
I've not used an Arduino myself, so I'm not sure if there is something in their software framework that limits the speed but I would have thought the underlying chip should be capable of doing most of what you want.
How many electro-magnets do you have in the the loop? I'm assuming 8 if you were considering using the parallel port?
When you say you want to achieve frequencies of above 1MHz, is that per step or for a full run? In other words are you trying to fire all 8? in sequence within ~1uS or are you trying to achieve ~1uS between coils?
Is there any other processing to do for example random firing sequences of the coils or is it just a case of read a potentiometer and fire the coils in order at the appropriate speed?
Kind regards
Nick
I've not used an Arduino myself, so I'm not sure if there is something in their software framework that limits the speed but I would have thought the underlying chip should be capable of doing most of what you want.
How many electro-magnets do you have in the the loop? I'm assuming 8 if you were considering using the parallel port?
When you say you want to achieve frequencies of above 1MHz, is that per step or for a full run? In other words are you trying to fire all 8? in sequence within ~1uS or are you trying to achieve ~1uS between coils?
Is there any other processing to do for example random firing sequences of the coils or is it just a case of read a potentiometer and fire the coils in order at the appropriate speed?
Kind regards
Nick
www.widgethub.co.uk - WidgetHub - The home of electronics stuff
WH7833 a switch mode equivalent to the LM7833
New - ATXMEGA128A4U breakout board
WH7833 a switch mode equivalent to the LM7833
New - ATXMEGA128A4U breakout board
-
NorthernMonkey
- Posts: 4
- Joined: Mon Dec 16, 2013 9:33 pm
Re: Multiple output sequential device driver ?
Hi Nick
Thanks for the reply, and yes you assume correctly on 8 coils (or a multiple of eight), solely because the possible ways I've found so far to do this only have eight output ports.
The objective is to achieve a rotating eddy current around the copper ring with a velocity of one million metres per second or there abouts, as mentioned the copper ring is 1 metre in diameter so I would need to energize all eight coils in the ~1uS to achieve this, there's nothing fancy regarding the firing just one after the other but depending on how well each coil generates the eddy current it may be necessary to increase the number of coils to fill the gaps formed by the spacing around the ring, with only 8 outputs this would probably involve pairing coils at 180 degrees creating double eddy currents which isn't a problem, other than the fact the frequency would have to be increased to 2Mhz (0.5uS) as the sequence would then only perform half a rotation.
It may be necessary to go to the extent of 32 coils running at 4Mhz but until I can do some test I won't really know what will work best.
I hope this is making sense, what seems clear in my mind might not be coming across on paper, let me know if you need any clarification.
Regards
Leigh
Thanks for the reply, and yes you assume correctly on 8 coils (or a multiple of eight), solely because the possible ways I've found so far to do this only have eight output ports.
The objective is to achieve a rotating eddy current around the copper ring with a velocity of one million metres per second or there abouts, as mentioned the copper ring is 1 metre in diameter so I would need to energize all eight coils in the ~1uS to achieve this, there's nothing fancy regarding the firing just one after the other but depending on how well each coil generates the eddy current it may be necessary to increase the number of coils to fill the gaps formed by the spacing around the ring, with only 8 outputs this would probably involve pairing coils at 180 degrees creating double eddy currents which isn't a problem, other than the fact the frequency would have to be increased to 2Mhz (0.5uS) as the sequence would then only perform half a rotation.
It may be necessary to go to the extent of 32 coils running at 4Mhz but until I can do some test I won't really know what will work best.
I hope this is making sense, what seems clear in my mind might not be coming across on paper, let me know if you need any clarification.
Regards
Leigh
Re: Multiple output sequential device driver ?
Computers are nice, but they have severe speed limitations compared to dedicated hardware. I would build an eight-stage ring counter using CMOS dual D-type flip-flops, which circuit you can find here. Just add six more flip-flops (total of four dual D-type) for eight outputs. Use each output to drive a transistor that switches one side of each coil to ground, the other sides of the coils being connected together to a suitable positive DC power source. The coil driver can get real complicated, depending on coil inductance and current, but there are interface chips to handle that problem too.
There are some caveats and gotchas to avoid when implementing a ring counter. Firstly, all the counters must be placed in an initial state with a CLEAR command that sets the first flip-flop and resets the remaining flip-flops in the chain. Secondly, because a set of N number of flip-flops has 2^N possible states, only N of which are desired states, you need some way to detect when more than one flip-flop output is on and use that information to CLEAR the flip-flops back to the starting state. Getting the flip-flops into a "forbidden" state is easier than you might think if careful construction practice is not followed: by-pass the Vcc terminal at each flip-flop package with a capacitor; keep the wiring short; place the circuit in a metal enclosure to exclude external EMI that could affect the flip-flops; use a good power supply. And many more tips, tricks, and techniques too numerous to describe in this short note. But then you did say you are not totally unfamiliar with electronics.
73 de AC8NS
Hop
There are some caveats and gotchas to avoid when implementing a ring counter. Firstly, all the counters must be placed in an initial state with a CLEAR command that sets the first flip-flop and resets the remaining flip-flops in the chain. Secondly, because a set of N number of flip-flops has 2^N possible states, only N of which are desired states, you need some way to detect when more than one flip-flop output is on and use that information to CLEAR the flip-flops back to the starting state. Getting the flip-flops into a "forbidden" state is easier than you might think if careful construction practice is not followed: by-pass the Vcc terminal at each flip-flop package with a capacitor; keep the wiring short; place the circuit in a metal enclosure to exclude external EMI that could affect the flip-flops; use a good power supply. And many more tips, tricks, and techniques too numerous to describe in this short note. But then you did say you are not totally unfamiliar with electronics.
73 de AC8NS
Hop
Last edited by Hop on Sun Dec 29, 2013 1:46 am, edited 1 time in total.
-
NorthernMonkey
- Posts: 4
- Joined: Mon Dec 16, 2013 9:33 pm
Re: Multiple output sequential device driver ?
Hop you're a genius, simple but elegant solution!
And ok you got me, I am a complete numpty when it comes to electronics but with the wonders of t'interweb I can say with some authority that no longer are flip flops just something that aussie's wear.
Got myself some CD4013 dual D's 5 for 99p, a new breadboard and some jumper cables and hey prestow (spaghetti junction). Going to use a simple 555 circuit to provide my variable clock signal which I already have from a hho project a few years back.
Thanks for the heads up on the Vcc caps, any other major pitfalls I need to know about before I tune for maximum smoke?
Also do you have any suggestions on the circuitry for the initial state setting of the D flops, not had much look finding info on that, thinking transistor capacitor combo where the cap equals out the voltage across the transistor shutting it down after initial on, but I've no idea on components and their exact layout.
Think I should be able to find a circuit for the output transistors but if you know a direction in which to look, that would be helpful.
Thanks for your help and I promise to mention you in my nobel acceptance speech. Lol
Regards
Leigh
And ok you got me, I am a complete numpty when it comes to electronics but with the wonders of t'interweb I can say with some authority that no longer are flip flops just something that aussie's wear.
Got myself some CD4013 dual D's 5 for 99p, a new breadboard and some jumper cables and hey prestow (spaghetti junction). Going to use a simple 555 circuit to provide my variable clock signal which I already have from a hho project a few years back.
Thanks for the heads up on the Vcc caps, any other major pitfalls I need to know about before I tune for maximum smoke?
Also do you have any suggestions on the circuitry for the initial state setting of the D flops, not had much look finding info on that, thinking transistor capacitor combo where the cap equals out the voltage across the transistor shutting it down after initial on, but I've no idea on components and their exact layout.
Think I should be able to find a circuit for the output transistors but if you know a direction in which to look, that would be helpful.
Thanks for your help and I promise to mention you in my nobel acceptance speech. Lol
Regards
Leigh
Re: Multiple output sequential device driver ?
Leigh,
The transistor driver for the coil can be as simple as a small-signal NPN transistor with a 1000 ohm resistor in series with the base to limit the current drawn from the CMOS output when it goes “high” to turn on the transistor. You will also need a reverse-biased diode, such as 1N4004, with cathode connected to transistor collector and anode to circuit common (“ground”).
When the transistor turns off there will be a large negative voltage spike at the collector as the magnetic field in the coil collapses and attempts to maintain the current in the coil. The diode will turn on and conduct the current around the transistor, limiting the collector voltage to the forward voltage drop of the diode, about 0.6 volts or less. This will prevent destruction of the transistor during the switching transient.
The diode will also slow down the rate at which the magnetic field of the coil collapses, so it might be a good idea to insert a small-valued resistor in series with the diode to absorb the energy in the collapsing field and speed up its collapse. The optimum value will depend on coil inductance, stray capacitance, and how fast the transistor turns off. I would start with values in the range of one to ten ohms and work up or down from there.
It should go without saying, but I’ll say it anyway: an oscilloscope will be invaluable to see what is going on. Choose inexpensive transistors and buy a hundred or so since “accidents” happen. I like to use 2N3404 or NTE192A equivalent for small inductances and move up to Darlington-connected power transistors such as 2N3055 for larger inductances and currents.
Sometimes I use opto-isolators (4N35 series etc.) between logic circuits and the “real world” to protect the logic circuits. However, these may not turn on and off as fast as you want them to. For noise by-passing at the Vcc terminals, 0.1 microfarad capacitors are generally sufficient. Avoid electrolytic capacitors for high-frequency switching-noise by-pass applications because they often exhibit high effective series resistance (ESR). Electrolytic capacitors are generally good for filtering only low frequencies such as power supply ripple.
A good start-up reset circuit that I have used since about 1968 is a series resistor (1K to 10K) from Vcc to a small capacitor (0.1 to 1 microfarad) connected to circuit common. Neither value is critical. And an electrolytic capacitor is okay here, just be sure the positive terminal is connected to the resistor. Connect the junction of these two components to one input of a Schmitt-trigger inverter, such as 74C14. Connect a small silicon diode with the cathode to Vcc and the anode to the resistor/capacitor/inverter input junction. This diode will discharge the capacitor when power is removed from the circuit. When power is applied, the capacitor exponentially charges through the resistor but maintains the inverter input at logic “low” until a threshold voltage is reached. After that, the inverter input remains at logic “high” as the capacitor continues to charge toward Vcc. The input remains "high" until power is removed and the diode quickly discharges the capacitor. The inverter output will be "high" during start-up and then will switch to "low" when the threshold voltage is crossed. The output will remain "low" until power is cycled again. Add a monostable multivibrator (one-shot) if you want a reset pulse instead of a reset level.
I don’t know of a simple way to detect “forbidden” states with AND/OR/NAND/NOR logic gates if more than one output of the ring counter is “on”. You could try “summing” the eight outputs through a 10K resistor connected to each output and then tying the other ends of the eight resistors to a Schmitt-trigger inverter. Experiment with a lower-valued resistor from the Schmitt-trigger input to circuit common (to provide a logic "low") until the Schmitt-trigger inverter switches only when two or more outputs of the ring are “high”. Use that event to reset the ring. One problem with this quasi-analog approach is the possibility of switching transients from the inductors causing a false reset. Opto-isolators may help prevent this.
Good luck on moving that magnetic field around the ring! Have fun and stay out of the high voltage.
73 de AC8NS
Hop
The transistor driver for the coil can be as simple as a small-signal NPN transistor with a 1000 ohm resistor in series with the base to limit the current drawn from the CMOS output when it goes “high” to turn on the transistor. You will also need a reverse-biased diode, such as 1N4004, with cathode connected to transistor collector and anode to circuit common (“ground”).
When the transistor turns off there will be a large negative voltage spike at the collector as the magnetic field in the coil collapses and attempts to maintain the current in the coil. The diode will turn on and conduct the current around the transistor, limiting the collector voltage to the forward voltage drop of the diode, about 0.6 volts or less. This will prevent destruction of the transistor during the switching transient.
The diode will also slow down the rate at which the magnetic field of the coil collapses, so it might be a good idea to insert a small-valued resistor in series with the diode to absorb the energy in the collapsing field and speed up its collapse. The optimum value will depend on coil inductance, stray capacitance, and how fast the transistor turns off. I would start with values in the range of one to ten ohms and work up or down from there.
It should go without saying, but I’ll say it anyway: an oscilloscope will be invaluable to see what is going on. Choose inexpensive transistors and buy a hundred or so since “accidents” happen. I like to use 2N3404 or NTE192A equivalent for small inductances and move up to Darlington-connected power transistors such as 2N3055 for larger inductances and currents.
Sometimes I use opto-isolators (4N35 series etc.) between logic circuits and the “real world” to protect the logic circuits. However, these may not turn on and off as fast as you want them to. For noise by-passing at the Vcc terminals, 0.1 microfarad capacitors are generally sufficient. Avoid electrolytic capacitors for high-frequency switching-noise by-pass applications because they often exhibit high effective series resistance (ESR). Electrolytic capacitors are generally good for filtering only low frequencies such as power supply ripple.
A good start-up reset circuit that I have used since about 1968 is a series resistor (1K to 10K) from Vcc to a small capacitor (0.1 to 1 microfarad) connected to circuit common. Neither value is critical. And an electrolytic capacitor is okay here, just be sure the positive terminal is connected to the resistor. Connect the junction of these two components to one input of a Schmitt-trigger inverter, such as 74C14. Connect a small silicon diode with the cathode to Vcc and the anode to the resistor/capacitor/inverter input junction. This diode will discharge the capacitor when power is removed from the circuit. When power is applied, the capacitor exponentially charges through the resistor but maintains the inverter input at logic “low” until a threshold voltage is reached. After that, the inverter input remains at logic “high” as the capacitor continues to charge toward Vcc. The input remains "high" until power is removed and the diode quickly discharges the capacitor. The inverter output will be "high" during start-up and then will switch to "low" when the threshold voltage is crossed. The output will remain "low" until power is cycled again. Add a monostable multivibrator (one-shot) if you want a reset pulse instead of a reset level.
I don’t know of a simple way to detect “forbidden” states with AND/OR/NAND/NOR logic gates if more than one output of the ring counter is “on”. You could try “summing” the eight outputs through a 10K resistor connected to each output and then tying the other ends of the eight resistors to a Schmitt-trigger inverter. Experiment with a lower-valued resistor from the Schmitt-trigger input to circuit common (to provide a logic "low") until the Schmitt-trigger inverter switches only when two or more outputs of the ring are “high”. Use that event to reset the ring. One problem with this quasi-analog approach is the possibility of switching transients from the inductors causing a false reset. Opto-isolators may help prevent this.
Good luck on moving that magnetic field around the ring! Have fun and stay out of the high voltage.
73 de AC8NS
Hop
"Things should be explained as simple as possible, but not simpler." -- A. Einstein
-
NorthernMonkey
- Posts: 4
- Joined: Mon Dec 16, 2013 9:33 pm
Re: Multiple output sequential device driver ?
Cheers Hop you're a wealth of information.
You've given me plenty to make a start, now all I need to do is work my way through it all and figure out a circuit that will work best for me. I foresee a few late nights and aching brains.
If and when I get it going I'll post an update so you can see the fruits of your efforts.
Regards
Leigh
You've given me plenty to make a start, now all I need to do is work my way through it all and figure out a circuit that will work best for me. I foresee a few late nights and aching brains.
If and when I get it going I'll post an update so you can see the fruits of your efforts.
Regards
Leigh