News:

we are back up and running again!

Main Menu

master/slave using pc hardware

Started by mobile_bob, December 10, 2009, 02:32:25 PM

Previous topic - Next topic

mobile_bob

I decided to take a few pics of the hardware that i am going to use to build my automation system

rather than reinvent the wheel, i decided to use off the shelf pc parts, basically a reapplication of existing stuff
then make it work for my purposes.

the case chassis, is a standard 19" rack mount unit, that has 8 externally accessible drive bays, and it came with
a standard pc power supply, so it has the requisite 5vdc for my micro controllers and also 12volts for the intermediate
relays.

into this case i installed 8 removeable drive caddys, got the wrong ones for my purposes (sata) instead of the ones
i wanted (ata) SATA has only 5 or 6 comm lines as opposed to the ata having something like 40 or so, (never counted them
but there is far more than what i need)
i recently picked up 8 new ata caddy systems and will be installing them, in place of the sata drive caddys

the ribbon cable is the interconnecting cable from each of the drive bays, and will be recommissioned to be my data buss
between the master and the other 7 slave units that will populate each of the 8 available bays.

the drive caddys unlatch and slide out of the bays from the front end without need for disassembly of the case, making removal
very quick and easy for reprogramming as needed, there is also a seperate lock for each bay to keep them from being removed
by someone not knowing what he is doing.

the particular caddy's i am useing are non standard 3.5" units, non standard in that they are a bit wider than standard to allow
for shock pads for hard drives, this added width allows the ability to use the widely available relay boards that fit nicely inside, and
the much smaller daughterboards, which are also available for very little cost, will fit within the caddy as well.

sorry for the quality of the pics, my camera flash is not working for some reason?

as i start to assemble the system, i will try to take more pics and document the process here on the forum.

lest i forget, the reason i decided on a 19" rack mount case is because there are tons of rack mount cases surplus
that can be had for a song that can be used to house all sorts of relays, switchgear, etc, making for a clean setup
and probably contain much of the emi crap we are concerned with. also my exeltech inverter system is a rack mount
setup so the total system can be setup in a nice vertical package that would take up a quite small footprint of a small
closet.

bob g

mobile_bob

the comm ribbon cable and a caddy partially inserted into the case

each one of the little black bars are connectors that plug into the caddy racks inside the case


bob g

BruceM

#2
Thanks for the pictures, Bob.   It's going to be a 1st class industrial, rack mount setup.

The classic rack mount design issue is getting your external inputs/outputs to each board. From the front to each board is sometimes done, but it's way tidier from the rear- IDE cable side, if you can pull it off, as front  cables to boards is a bit of a mess and your access to boards is impaired. (It can be and is done often.) Maybe a unique to the board auxilary I/O connector off the backside of the board depending on the board's needs?  Can't see enough detail of the board in drive box to see how it might work.  

I'm sure you have a scheme already figured, so do tell, I'll bet its good. :)

Bruce



mobile_bob

thanks Bruce:

the caddy enclosure has a centronics male connector and the bay has the centronics female, so when the caddy is
inserted into the bay and locked in, the connection between the two is made, providing connection to the ide ribbon cable
and the 4 wire power cable (its also the standard drive plug, which name escapes me just now)

inside the case of the caddy there is a short ribbon cable that would normally connect the to the ide harddrive connection and also
the 4 wire power connections

all i need to do is map the conductors and then make up and attach the short ribbon to the relay board for outputs, and to the daughterboard (that carries the processor and its related components) for inputs and for comm lines onto my wide buss for
bi directional communication between the master and the slaves.

i am seriously considering useing this chassis for only slaves and have the master in a second case stacked above this case in the rack tower. the advantage would be that everything within this case only has outputs, and comm lines and no other outside inputs coming in, leaving the master within another case to have ample room for all the other stuff that makes input to the master.

because the master would take so little room in another case, it would allow space for a small 12volt gell cell alarm type battery to keep
the master powered even when other power sources are inoperative, not online or whatever. also there would be ample room on the front panel for a really cool led interface to illustrate what the system is up to. for kicks i tried a piece of 3/8" lexan, painted black, with
holes drilled partially through with leds pressed into the panel from the rear, the look is awesome in my opinion, and with a bit of artwork
all the labeling could be sandwiched between and made to illuminate as a specific thing is in operation.

then another case racked below the slaves could house the power relays to drive all manner of other switch gear, such as starter relays, glowplug relays, coolant pumps, fans, inverter to st switchgear etc.

i am a big fan of automotive cube iso relays, they are cheap, dependable and you can find them everywhere, i plan on useing a lot of them and have to build up a suitable array to mount them within a case. i also like industrial fuse mounts, the panel mount twist in type, and plan on use them where appropriate, and of course ebay is a wonderful source of very good relays and contactors which would make for a very robust system.

been collecting parts for several years, and finally have it all, just need to sit down and start assembling the system.


maybe it has more to do with growing up under the influence of star trek?  maybe its because of old frankenstien movies?
maybe its because of my envy of guys like edison and tesla having their own labs?

or some other perversion?

or all the above!



probably has more to do with working on other folks systems, and being in awe of what others have done, coupled with a time
in our history where there is so much surplus available to work with.  all i know is there is far more to work with today than
what there was 30 years ago, and much lower in cost.

at least in this way, we got it much better now than in the good old days.

bob g

AdeV

#4
Bob, that looks like the beginnings of a really nice system - and so extensible too! I've found that, if you find the right sale on eBay, the big (42U) cabinets go for a song, because they're far too big for most people. But for this sort of application, where it can live out in the garage, the big racks really are the cat's meow. The hardest thing to deal with in the 19" racking world is those PITA cage nuts. They are such a dog to get in & out...

Anyway, I'm watching this one with interest, and I hope to copy the concept in the future.

I got to wondering what on earth Lexan was. Fortunately, a quick google showed it was just a clear plastic sheet, very similar to perspex . If you go with your 2-layer idea, you could screen-print the front of the inner layer, partially drill, and achieve spectacular results. Screen printing, although a bit tedious, would really bring that "ST:TNG" look to life. Now, if you could just make it touch-sensitive.....

I'd better hit the sack now, before I get any more useless ideas  ;D
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

BruceM

Damn, that's sweet, Bob, all cable off the back side.  When you get to it, consider doing solid state switches (logic level MOSFETs) instead of some of those nasty old relays.  They really are solid, and more reliable than relays when designed properly, plus consume no power.   I'd be glad to help.   

You've raised the bar to new heights for extensible multi-processor electro-mechanical design.

You concept of power management from the master seems ideal for this arrangement.  Somewhere in your system is battery bank management, right? How does that fit in?









mobile_bob

here is a rough overview, and i must preface the methods i use are somewhat outdated, but they work for me :)

the master has a basic set of code to just sit and scan though, it scans inputs for a "high" indicating there is a need
that needs attention,

there are slaves for each of the following, (from memory, i don't have my notes handy)
engine management, battery managment, refrigeration,(heatpump valving),  heating and cooling, power generation ST head, power generation alternator, and a few other items like solar, and wind generation.

for battery management i plan to use a rather crude system, of a bar driver, where a row of led's indicate the voltage level of the battery bank, attached to that rail will be a photo transistor for low setpoint and high setpoiint, so that i can manually adjust them
to trigger for a low voltage setpoint and  a high voltage setpoint.  batteries get down to perhaps 12.4volts the line goes from low to high
and the master while scanning picks up this event or request, and passes both a high on the address line to the engine slave to initiate
a startup and also another high on the alternator control slave to bring on the charging,, which it will do until such time as the high setpoint is reached.

now this is purposely basic and by most standards rather simple/crude, but it is adequate for the 50/80 charge regime, where i will be doing the 80-100% charge on a weekly basis and have much tighter control.  i just need something that works and can be adjusted quite easily, and this system satisfies this quite well without lengthy codeing and A/D conversions. because the resolution of the bar driver can be quite reasonable when cascaded and because it can be physically adjusted i can alter the set points quickly and easily to also account for ambeint temperature, again without the need to alter the very basic coding.

again it is not perfect, and certainly there are much better ways of doing the same thing and probably more accurately, but i don't need
a high degree of accuracy and would favor simplicity of a manually adjustable system.  i have to think down the road should i need to instuct someone else how to adjust the system, and i am not at all sure i want anyone chopping into the coding if i can help it.

btw, i really would rather be using solid state swtches, but the relay boards are available with all the parts, in a size that fits for a low price
so for now i will likely just use them. maybe after the system is up and running i can change to SSR's and pic processors too   :)

anyway getting back to the system overview

the idea is for the master to sit there scanning all loads, beit electrical, or thermal,
if i need to wash clothes the master knows this can be a scheduled event and will wait to activate that load
until either the predetermined time of day has arrived or there is sufficient other loads requesting service to warrant
a startup of the engine and allow it to run at near peak load.

if it senses a need for more heat in the thermal mass storage, it can balance that need against, battery charging,
and other loads, effect a startup and apply any combination of loads to the engine so as to maintain near full load
and not allow it to go into overload condition. overload would dictate that the master decide which load can be dropped
so that the engine can maintain the loading.

my thinking is the master has three things to do, one is monitoring requests, two is making decisions, and three issueing
start commands to the various slaves needed to satisfy the need. this allows the slaves to be able to really be good at specific
jobs that might be tedious and require a lot of babysitting, freeing up the master to scan continously checking requests, making decisions
and issueing start commands.

i see the master doing a lot of "looping" while the slaves do the sequential stepped operations where the processor is hung up waiting
to do the next thing in sequence (although i realize it need not have to wait)

there is so much more, but it is easier for me to do that try to explain it

bob g

BruceM

Bob,
I have a single op amp circuit that does the proper wet lead acid temperature compensation (4mv per degree C) that could be adapted to meet your needs. (Attached.)  The set point is adjustable by trim pot, the current version does float, cyclic, and equalize voltages, all temperature compensated.  Adding a comparator for low voltage sensing (start the genny) is just a comparator and reference, and another trim pot so you can adjust a bit as your battery ages.

State of charge by voltage alone would be a lot better with an added current sensor; for a specific battery, with a known load, voltage can predict (table lookup) SOC. Otherwise, load can drop the battery voltage such that voltage alone will trip your detector, even though it was just a brief current surge. With a massive enough battery, and light loads you might get away with it.




mobile_bob

Thanks Bruce

after i wrote that last diatribe, i got to thinking and remembered what i was going to use

what i have is several of the front panels off of apc ups systems, they have the 5 or 6 led battery soc indicators
and also another row of 5 or 6 load sense led indicators.

the little panels have a pc board attached to them, with some ic's of somesort, and they are very stable in operation
heavy loads do not drop the led indicated until the voltage is actually down to that level for what  i think is several seconds
this keeps them from indicating low voltage under surge conditions i would guess.

i don't know, other than they are so well built, and would be very easy to just take the logic straight off the board, and through
a dip switch setup so that i could basically just set a dip switch to get a voltage setpoint,

it would be very simple to do in my opinion, the dip switch could be mounted on the prototype part of the daughter board that
the processor is mounted on easy enough,

these are the finer details some of which i have not firmed up on yet, but rather have some idea's on how to get a system working
well enough to then go back and make improvments to each subsection beit the slaves or the master.

that was one of the other attractions of the master/slave architecture, that being a modular approach, where one can build a system
even if crude, and then go through and modify/improve each while still retaining an operational system.

because of my back problems, i am dramatically limited to what i can do physically, so i have to save what little back i have for
making money, and this puts off other facets of my system until such time as the surgeon performs his magic, however
the control system is relatively light and it is something i can do in a chair if i have to.  so maybe i can make some real progress over the
winter months.

too darned cold out to want to do anything out there anyway

:)

btw, thanks for the circuit, i will give it a hard look, while i might not use it at first, it will likely be something i will look to incorporate
later.

bob g

BruceM

By disconnecting the shunt regulator's power transistor, the circuit becomes a simple but temperature compensated battery voltage comparator.  Google or Wiki op amp voltage comparator to see how they work.  If battery voltage is below the trim pot adjusted level then the op amp output goes low.  When you set the voltage, you just have to get it right for the present temperature.  I use an external probe (bead type radial lead NTC resistor) which is sealed in shrink wrap, attached to the battery.

There are two opto-isolated inputs which can shift the voltage higher, for a cyclic charge voltage, and equalize.  You might not want that part.

When you do get there, give a holler.  The time delay on a fixed voltage might work out too.

DC current sensing is as simple as a single op amp and a shunt resistor.

When you get to your battery subsystem, just give a holler.

Bruce


mobile_bob

Thanks Bruce

you will be hearing from me for sure!

thanks

bob g

mobile_bob

got another piece of the project picked up today on the way back from the surgeons office

although i was a bit late and the pickin's were thin, i think i managed to get enough of what i needed.

what i got was the slot covers that go into the back of a PC, that have both DB15 and DB25 connectors
with ribbon cables attached

they were a buck for each assy, so i got 10 assorted ones, and i think i have enough to do what i want
to do,

i can now replace the slot blockoff plates at the back of the case, and install these that have the DB connectors
and route the ribbon cable up to to buss connector at the back of each slave controller bay.

this will enable an egress from each slave driver, so that i can then attach a DB cable and join the slave chassis
with the switch gear/ relay chassis that will be mounted below it.

so far it looks like this will be a very clean setup, using off the shelf/common and cheap surplus parts for the most part.

the fun of assembly should start just about anytime now!

bob g

BruceM

Nice find, Bob.  For up to an amp (I woudn't push even that on a single pin), the DB connectors are one of the most reliable.

mobile_bob

i figured to keep it to a half amp per pin, and if i have to pull more than that i will use multiple pins

but that will be avoided as much as possilble

thanks for the confirmation on this reality

bob g

mobile_bob

a bit of an update on design of my system:

because of the various slave controllers doing independant duty in controlling the system
it would be helpful to have some indication as to what process each slave is doing at any particular time.

the plc guys use a cascade of led's that are numerically linked to an input or output terminal so you can look
at a module and tell which pin is doing what in real time.

as mentioned earlier i want to borrow this methodology and figured on using a piece of 3/8 plexiglass/lexan/ plastic
where i will then drill hole into the back but not quite clear through, so that i can insert led's and build up an array

i wanted to then stencil or silk screen all the info needed to identify each led indicator, and then cover this with another
thin layer of plexiglass/lexan/plastic.

now stenciling or decals can be done, just as silkscreening, but layout is a bit tedious for me.

then it dawned on me to just create the layout in a word processor using the font that i want, laying out spacing a placement
are much easier and cleaner. then it occurred to me to just print it out on a transparency and then sandwich it between the
led mount and cover plate.

i can't imagine a cleaner and easier to setup process to get a custom look that will look very professional or should look that way.

this should really make for a neat appearance where form follows function.

having a layout for a slave for example

power  *
Estop  *
address *
decompress *
glowplug  *
rack  *
starter *
hi/low speed *

of course this is a crude example of what can be done, the (*) is the led indicator
and they would be all inline vertically. also a two color led would be used on positions
such as the starter to indicate a fault should the engine fail to start after 3rd attempt

those are all details, and the purpose of this post is to illustrate a method of labeling the panel
that would be very easy in my opinion

bob g