ApolloHoax.net

Off Topic => General Discussion => Topic started by: Glom on November 24, 2015, 03:01:29 PM

Title: Electronics and microcontroller question
Post by: Glom on November 24, 2015, 03:01:29 PM
I'm working to design a simple control system for my Group Project and wondering whether this idea I have is horrible or not.

The system will control some fail-closed valves on the fuel supplies to a combustion system.  It's just a little rig for combustion experiments.

Naturally, there will be an ESD, which will open the circuit supplying power to the valves.  But, I don't want the valves to just open again when the ESD alone is reset.  I want all switch to be reset first before the circuit will allow the valves to be reopened.  So there will be an electronic switch connected to a microcontroller.

In order to detect the state of the valve switches, even if there is no power going to them, I thought about adding a second power connection at heavily reduced voltage.  The voltage will not be enough to power the valves, but will be enough for the microcontroller to detect when the switches are closed.  That way it won't send the command to close the electronic switch until it detects that all other switches are where they are supposed to be.

The attached picture shows some doodling of mine.  Hopefully, you can make out the microcontroller on the left and the three reactant supply valves on the right and the connections to the microcontroller for detection of voltages, indicating switch states.  On the far left is a reset switch for the operator to press once all the important switches are where they are supposed to be.  If they are, the microcontroller will send the signal.

Is having a secondary reduced power supply to provide instrumentation voltages a good idea or a terrible one?  This is of course safety critical.
Title: Re: Electronics and microcontroller question
Post by: ka9q on November 24, 2015, 04:06:22 PM
ESD? Electrostatic discharge?

It would help if you described the behavior of the valves.
Title: Re: Electronics and microcontroller question
Post by: Glom on November 24, 2015, 06:57:49 PM
ESD is Emergency shut down.

The valves will be fail closed valves so the electrical current is needed to keep them open.
Title: Re: Electronics and microcontroller question
Post by: ka9q on November 25, 2015, 01:41:54 AM
OK, now I think I understand what you're trying to do. Sort of.

What specific error or failure mode(s) are you concerned about? Somebody forgetting to turn the switches off? The switches appearing to be off but are actually on because of an internal short? Have you estimated its likelihood? What are the consequences of a failure?

Title: Re: Electronics and microcontroller question
Post by: Glom on November 25, 2015, 12:37:28 PM
OK, now I think I understand what you're trying to do. Sort of.

What specific error or failure mode(s) are you concerned about? Somebody forgetting to turn the switches off? The switches appearing to be off but are actually on because of an internal short? Have you estimated its likelihood? What are the consequences of a failure?



So basically, someone presses the ESD and that cuts power to the valves causing them to close.  Fuel (and air) are stopped flowing from the sources to the burners.  Without any further logic, if someone just twisted the ESD button, the button itself would reset and the valves would open again, which may not be a good idea in the circumstances (something caught fire that shouldn't have etc).

So I want to make sure that the system is fully reset.  Basically, it works like this.

Operating normally: ESD closed, electronic safety switch closed.  Closed valve switches to supply electrical power to respective valves.

ESD pressed: electrical supply is cut to the valves and they close.  Electronic safety switch opened by the micro-controller though at this point it makes little difference.

ESD reset: electronic safety switch still open so still no power to the valves.

System reset button pressed: micro-controller looks at the state of the valve switches and the ESD.  If the valves switches are off and the ESD is reset, it closes the electronic safety switch.  Else, it leaves it open.

That's why I'm needing the low voltage to bypass the ESD and electronic safety switch so that the state of the valves switches can be read.  The idea is to have only a small voltage, which will be insufficient to actually power the valves, but enough for the micro-controller to detect as on, indicating closed switches.
Title: Re: Electronics and microcontroller question
Post by: VQ on November 25, 2015, 07:51:23 PM
What you are describing sounds like a normal latched relay, which is a common way of managing on/off control. I do not understand the bit about the system reset being interlocked with the valve switches, though. In what situation would the ESD switch be activated but the valve power switches be closed?

More generally, usually actuator position feedback is a separate circuit than the actuator power, ie a separate position switch or positioner, rather than "leaking" reduced voltage to the actuator.
Title: Re: Electronics and microcontroller question
Post by: ka9q on November 25, 2015, 08:23:31 PM
I was about to make just that suggestion. Use on/off buttons (rather than toggle switches) and latching relay circuits to control the valves.

There are mechanical latching relays, but I'm not talking about them. Take an ordinary normally-open relay where a spring keeps the contacts open unless current flows through the coil. Wire it with the contacts in parallel with the "on" button such that when push it, the relay closes and keeps itself on. Put a second button with normally closed contacts in series with the circuit so that when you push it, you interrupt the supply current and the relay drops out. That opens the contacts, so when you release the "off" button the relay stays de-energized and the contacts remain open.

Add indicator lights to show the state of the circuit. You might consider having both "on" and "off" lights, with the "off" light powered by the normally closed contacts of the relay.

Instead of finding a push button with normally closed contacts, you could instead use a toggle switch as your "off" control. Label it as "enable" when the contacts are closed and "off" when open. So now if you put the "enable" switch in the "disable" position, pushing the "on" button has no effect. Put the enable switch in the "enable" position and nothing happens until you push the "on" button again to activate the relay and open the valve. Turn the enable switch to "disable" and the relay opens and the valve closes, and again the "on" button has no effect.

Put your "emergency shut off" switch in series with the supply to all three relay circuits so that opening it shuts power off to them all. If you then close that switch again, the relays will remain off and the valves closed.

If you don't want to use electromechanical logic you could do this with logic circuits, but I recommend the old-fashioned stuff for its simplicity and ease of understanding, and also because it can be made to work at the oddball voltages required to control the valve -- "oddball" in the sense that they're probably different from logic levels, and you'd need level shifters and a drive transistor to control the valves with logic signals.

My high school electronics lab used exactly this mechanism to control the AC power to the lab benches. A set of ordinary wall switches, wired in series, were placed around the classroom as "emergency off" switches. Turn any one off, and the power dropped and stayed off even if the emergency switch was turned back on. The teacher had to momentarily activate a key switch on a panel to turn the power back on.
Title: Re: Electronics and microcontroller question
Post by: Glom on November 28, 2015, 02:15:46 PM
Interesting thoughts.  Thanks.

This week has been about the plumbing itself, but I'll be getting back to the control system soon.
Title: Re: Electronics and microcontroller question
Post by: VQ on November 29, 2015, 04:14:35 AM
Keep us posted!
Title: Re: Electronics and microcontroller question
Post by: ka9q on November 29, 2015, 05:56:45 AM
If you need me to sketch out a more detailed schematic, let me know.
Title: Re: Electronics and microcontroller question
Post by: Glom on December 06, 2015, 12:50:27 PM
I resisted the urge to claw my face off shopping for valves.  The clawing will resume later.

So I think I understand the relay concept.  Attached is a zoom in on a case for a single valve.  I also checked and Maplin do indeed have (one) push-to-break button so that is an alternative to the toggle switch.

It would then be simple to add all the LED's I want for the different states and/or send signals to the microcontroller.

This way I don't need the microcontroller to worry about the toggle switch state (if I even have one).  The valves won't reopen until they are specifically instructed to reopen.  That would indeed be preferable to leaking current.

I can apply this to entire circuit to allow master system reset without needing to go through a microcontroller.  However, I have other uses for the microcontroller (e.g. receiving instrumentation inputs and setting trips) so I'll probably keep that anyway, but it creates options if we need to downsize our scope (again).
Title: Re: Electronics and microcontroller question
Post by: ka9q on December 06, 2015, 07:23:27 PM
Not quite. You have the relay coil in series with the valve coil. You want them in parallel.
Title: Re: Electronics and microcontroller question
Post by: ka9q on December 07, 2015, 03:43:09 AM
Oh, in case you haven't noticed it, you have a short circuit across the relay coil. It will never close. The valve will momentarily close when you hit the on button and then open again when you release it.
Title: Re: Electronics and microcontroller question
Post by: ka9q on December 07, 2015, 03:58:56 AM
Here, try this. Omit any indicator lights you don't need. I do recommend them, however, as they unambiguously show the state of the system at all times. This was more important back with incandescent pilot lamps that could often burn out, but they're still desirable now.
Title: Re: Electronics and microcontroller question
Post by: Glom on December 07, 2015, 12:00:13 PM
Thanks.

I did actually have the relay coil in parallel to begin with, but edited it for some reason that eludes me.  The original is correct I think.

Tomorrow I hope to have a play with a demo circuit once I make the trip to Maplin.  If I don't electrocute myself, I'll report back.
Title: Re: Electronics and microcontroller question
Post by: ka9q on December 07, 2015, 12:38:10 PM
What voltages are involved? If you don't feel confident about your abilities, please use a solenoid valve coil with a low voltage rating, e.g., 12V DC, rather than 120V AC. Naturally the relay coil will have to have the same rating as the coil. You marked the top of your schematic with a (+) so I hope it's low voltage DC...

Title: Re: Electronics and microcontroller question
Post by: nomuse on December 25, 2015, 12:46:27 PM
I feel like throwing in a bit of relay logic I ran into on a job that was done wrong. Cable-driven wagon (aka a platform with wheels) in a production of "A Christmas Carol." Operator-cued, but with safety limit switches at each end of the track that would cut the motor power (the motor was self-braking).

The upstage limit switch, as I discovered afterwards, was wired to supply power to a relay that broke the motor connection. And they'd supplied this power by running an extension cord along the floor under the pinrail. Which got kicked out of the outlet by a railman during tech rehearsal.

So of course the next time they ran the wagon all the way upstage, it over-ran the limit switch and smashed into the back wall -- crushing the very same relay box that was supposed to prevent this.

Wiring to the other side of the relay would have, of course, prevented this. I've noticed, though, how many people can only think on the positive side. How the thing is "supposed" to work or how it works when it is working correctly. The scientific equivalent of only looking at data that proves the hypothesis. Takes training and effort to properly plan so your devices fail safe instead of catastrophic.
Title: Re: Electronics and microcontroller question
Post by: ka9q on December 25, 2015, 08:26:29 PM
Takes training and effort to properly plan so your devices fail safe instead of catastrophic.
Yup.
Title: Re: Electronics and microcontroller question
Post by: ka9q on December 25, 2015, 09:04:58 PM
Naturally the relay coil will have to have the same rating as the coil.
Actually, they can be different if you use a relay with two poles. One pole latches the relay, the other actuates the valve.
Title: Re: Electronics and microcontroller question
Post by: Glom on December 26, 2015, 09:22:05 AM
Finally Tapatalk allows me to upload.

Anyway I have a demo circuit. The green LED represents the load. The single push of the push button turns it on and it stays on.

Now I'm just waiting on more details on the valves from the vendors before I can build the actual device.

In the meantime, I can focus on other work.
Title: Re: Electronics and microcontroller question
Post by: Glom on February 19, 2016, 01:27:17 PM
More stupid questions.

I have a transistor that had a Vebo of 6V. My power supply is 24V. Now this is how much greater the emitter can be that the Base. So does that mean that it's okay as long as the Base is connected to ground?
Title: Re: Electronics and microcontroller question
Post by: ka9q on February 20, 2016, 09:21:37 AM
Vebo refers to the maximum reverse voltage the emitter-base junction can withstand without breaking down. It's a limit.

Bipolar transistors are normally forward biased in their base-emitter junctions, and in this direction it behaves essentially as a diode, with a forward voltage drop of maybe 0.6 volts.
Title: Re: Electronics and microcontroller question
Post by: Glom on March 08, 2016, 08:54:28 AM
Just so you know. The thing is being put into practice. God help us all.
Title: Re: Electronics and microcontroller question
Post by: bknight on March 08, 2016, 10:35:50 AM
Just so you know. The thing is being put into practice. God help us all.
Fail Safe? :)
Good luck
Title: Re: Electronics and microcontroller question
Post by: BazBear on March 08, 2016, 02:19:25 PM
Just so you know. The thing is being put into practice. God help us all.
Sinister looking thing, isn't it?;)
Title: Re: Electronics and microcontroller question
Post by: Glom on March 08, 2016, 05:30:28 PM
Just so you know. The thing is being put into practice. God help us all.
Sinister looking thing, isn't it?;)
The police didn't like me waiting at the bus station with it.
Title: Re: Electronics and microcontroller question
Post by: smartcooky on March 08, 2016, 07:39:01 PM
Just so you know. The thing is being put into practice. God help us all.
Sinister looking thing, isn't it?;)
The police didn't like me waiting at the bus station with it.

...and looking at it, I can well understand why!
Title: Re: Electronics and microcontroller question
Post by: Kiwi on March 09, 2016, 08:12:56 AM
The police didn't like me waiting at the bus station with it.

Would it be correct of us to instantly assume that that was not at a bus station somewhere between Mexico and Canada? And that otherwise you would be dead because of the unfortunate conjunction of, at a minimum, 27 super-swift bullets and your soft, pink body?  :)
Title: Re: Electronics and microcontroller question
Post by: Glom on March 09, 2016, 09:37:08 AM
Yeah good thing our cops don't carry guns.
Title: Re: Electronics and microcontroller question
Post by: Glom on March 10, 2016, 06:19:12 PM
BTW what are people's experiences with soldering iron tips? Are they supposed to last a while? I've been cleaning my tip with a mild kitchen wipe. Seems to help restore the heat a bit but it is diminishing returns every time.
Title: Re: Electronics and microcontroller question
Post by: VQ on March 11, 2016, 12:33:47 AM
BTW what are people's experiences with soldering iron tips? Are they supposed to last a while? I've been cleaning my tip with a mild kitchen wipe. Seems to help restore the heat a bit but it is diminishing returns every time.

Yes, it should last a long time. I suggest using a damp sponge rather than a kitchen wipe that might introduce additional salts onto the metal. If oxides are piling up that don't come off on the sponge while the iron is hot, you can try scraping off using copper wool. Remember to tin the tip before shutting down.
Title: Re: Electronics and microcontroller question
Post by: smartcooky on March 13, 2016, 05:19:25 AM
BTW what are people's experiences with soldering iron tips? Are they supposed to last a while? I've been cleaning my tip with a mild kitchen wipe. Seems to help restore the heat a bit but it is diminishing returns every time.

I use a small square of clean, new sponge in my soldering iron stand, which I wipe the tip on regularly.

Every so often I file the tip flat and re-tin it.
Title: Re: Electronics and microcontroller question
Post by: Glom on July 08, 2016, 02:52:39 AM
Thanks to everyone for their help. I got an A- for the project, which given how much of a mess it ended up is pretty good.

My next project involves me needing to learn motors, piezoelectric materials, photovoltaics and RLC circuits.  I never realised how dumb I was before undertaking this.  Fortunately, this will be the last one before I can return to getting paid.