Last chance to enter The Hackaday Prize.

Mechanical relay logic that was snubbed for a microcontroller

[Alex] was tasked with a control design problem for a set of motors. The application called for the back of a truck to open up, some 3D scanning equipment to rise from its enclosure, and finally the equipment needed to rotate into place. All of this needed to happen with one flip of a switch, then proceed in reverse when the switch was turned off. We can understand why the final design used a microcontroller, but we also think that [Alex's] relay logic circuit is an eloquent way of doing things.

He uses limiting switches as the feedback loop for the logic. In the video after the break he walks us through the schematic. Each of the three motors has an up and down limiting switch. These control the three relays which switch power to the motors. We like the design because interrupting the movement mid-operation provides no problem for the system. The only real issue we see is that relays wear out, and the automotive application of the hardware may cause this to happen more quickly than normal.

You may recognize the clear gears used in the demo. [Alex] previously showed us how he makes those.

Comments

  1. EccentricElectron says:

    ELEGANT

  2. redfive1976 says:

    It seems that he could deal with the relay wear issue by simply socketing all the relays. Then if one wears out, it’s trivial to replace it.

    • draeath says:

      If you really want to get clever, you can put em all in a box similar to the one the truck already has :)

      Heck, there might even be enough room for one to put them in the same box!

    • sparkmike77 says:

      trivial and CHEAP.

    • And then a miracle occurs says:

      As an intern, I built a calibration device from old gold-plated telecom relays, after being told repeatedly by an older engineer that it had to be done solid state – as relays would never hold up – and that he would create the unit using a variety of technologies.

      I had gotten stuck hand calibrating these beasts to test prototypes, and after the third one, I decided I could automate it. Permission to automate the process was refused.

      The device required an 12 step calibration curve, and although a D/A unit could have done it, it was easier to simply switch .1% resistors in and out of the circuit. This was done at three temperature ranges (cold, hot and room) and the resulting data normalized through a table of quadratic math – and turned out to be accurate enough to vastly outperform the competition.

      It was budgeted to cost $3000 and take a month-
      So I just built it in a few hours (you know, I needed a test rig to develop software on…), using $25 worth of junk and a stupid arduino forerunner that spoke BASIC.

      I calibrated about a 100 units before they got wise to the existence of the device. I was off one day and the tech standing in for me could only calibrate one unit in the time it took me to do 10. Being older and wiser, he was suspicious that my units were being shoddily calibrated, so he had an emergency meeting and they pulled as many of the units back as they could.

      Everyone of them exceeded specs by a factor of 10, and that’s how they caught on. The whole device fit into a little box the size of a small cooler, since that’s what I used. You need to precisely control temperatures of resistors to within 1 degree in order to get that kind of accuracy. And humans would have to make one measurement a second or more to keep up with me.

      After the come-to-jesus meeting, It became sanctioned by consensus and calibrated about 185,000 units and outlived the company. It didn’t help my relationship with that engineer much.

      • Jim says:

        That’s really too bad. Unfortunately you sometimes end up in a position where you have someone managing you who simply is not qualified for their job. It will happen more and more as you get better at what you do, but it will bother you less because there is still usually a reason they are there.

        Also, you should have patented that thing and contacted them through a salesman you hired and charge them 20 grand for the unit plus “service”. You wouldn’t believe how much this happens.

  3. redfive1976 says:

    It seems like the relay issue could be mitigated by installing the relays into sockets.

  4. squishyrobot says:

    I design movable bridge (AKA drawbridge) control systems like that all day, every day, though we sketch them out in ladder logic form. And even if we use PLCs, we still write the program in ladder logic. When you consider the capabilities of the electricians maintaining the bridge on a regular basis, along with vibration from passing trucks and surges from lightning strikes, relays start to look like a pretty good option. Oh yeah, and you can always find replacement relays, whereas PLCs go out of production after a while.

  5. th3badwolf says:

    This is clearly a mechanical engineering technician here folks. I had the privilege of having similar courses and this is straight simple industry automation process at works.

    Great job!

  6. NewCommentor1283 says:

    i would have kept all the relays, but i would have used an “output relay” for each motor connection and had the logic running in small low current relays.

    that way you can see (with extra lights) if the logic+switches are bad or just an output relay (arcing from motor kickback)…

    and seperate fuses and power buses clearly indicates failure of motor (short) or failure of other parts (shorted/incorrect switch wires)

    just my two cents

    PS: LOVE THE SCHEMATIC AND SIMPLICITY!!! (of the relays)

  7. fonz says:

    Doubt wear out is a big issue, there’s lots of relays in a car, ignition, fuel pump, headlights etc.

  8. 'Duino says:

    I am worried about the relays wearing out but I also worry about the limit switches failing to detect a limit has been reached.

    In which case, NOTHING will stop the mechanical motion from potentially ripping something apart. With a microcontroller, at least you can setup a watchdog timer to STOP the thing if a set time period elapses when the limit switch really should have been triggered, in order to limit damage to the unit and also alert the operator of an error state and or automatically shut it down.

    • Alex says:

      At a company I worked for, we had some large rotation jigs that were designed with that in mind. It had 2 sets of switches. One set was just plain stop switches. Then there were failsafe endstop switches that tripped a separate emergency stop circuit. If the endstop switches were ever hit, we were required to halt all use of the machine until maintainence could determine why the endstop switches were hit.

    • NewCommentor1283 says:

      execpt maybe a fuse… and a “cotter pin”

      cotter pins are used in lawnmowers for when you hit a big rock or curb, the cotter pin snaps and the motor keeps on operating (after being re-started of course)

      otherwise you get a mashed up (or shattered) cam-shaft and engine block (completely and utterly destroyed engine)

      but of course theres still a 0.1% chance you might eject a piston and the engine block might actually survive, assuming you dont get hit with the piston, in which case you wont be around to repair said engine ;)

      PS: i heard its technically possible to re-build an engine failed in such a way, but reboring and custom cutting pistons costs more then a new engine (wer talking lawnmower here), so its only for hobbyists or special casees

    • Cyril says:

      Two limit switched in series, staggered even. Use highly rated parts.

      If you’re using a uC/SCR, how would you mitigate the latch-up problem when every element in the circuit can (in practice) start in an unknown state?

  9. Joshua says:

    Controls engineer here. First, relays wear out, yes. Some after a million cycles or better. They’ll never wear out in an application like this. Second, with relay ladder logic, the programming is in wires, not and/or/xor gates, so no mucking around with voltage regulation, capacitance, voltage spikes, reverse voltage polarity breaking something delicate, no interface circuitry for large loads, bla bla bla. There’s a reason relays have been used in industrial automation for decades. Because they work, work well, and are simple (K.I.S.S.). And about the limit switch issue. Use a normally closed limit switch mounted in an interference position, and when you get to the stop point, the limit switch contacts WILL break. It’s called fail safe engineering. A good idea even if you are using a micro and can use a watchdog. Micros latch up. Relays suffer from contact weld. Pick your poison. In this instance, my money is on relays.

  10. Yates says:

    Actually ’60s era convertibles also used an arrangement of relays, solenoids, and limit switches to raise and lower the top.

    https://en.wikipedia.org/wiki/Ford_Thunderbird#Convertible_models

    Unsurprisingly they were not very fun or easy to diagnose when something went wrong.

    http://www.auto-wiring-diagram.com/wp-content/uploads/2011/07/convertible-tops-wiring-diagram-of-1961-63-ford-lincoln-continental.jpg

  11. Mduplive says:

    @’Duino

    You could also incorporate a timer into the mix. Several manufacturers make quality products for this very purpose.

  12. Velli says:

    uC or relay, uC or relay…
    A few well-trained orphans would work just fine.

  13. Ron says:

    For sheer reliability in this kind of application, relays every time. This is very similar if not identical to what custom car audio installers have used for years for motorization for amp racks, monitors, etc. No need for anything more complicated. Talk to any seasoned installer as far on the spot hacks and we can take care of most anything with what we’ve got laying in the shop of which, on the electronic side, are relays, diodes, resistors, and some capacitors. When a customer is breathing down your neck for a solution, you go with what experience tells you what will work. Just today, we had to slap together an AV switcher with 6 relays and a toggle switch. Tested with no noticeable loss in quality from either source. I have started to delve into microcontrollers but a bit slowly but I’ll never abandon the good old Bosch relay.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,230 other followers