De-coupling 3 - Have Arduino, will program...
De-coupling 3 - Have Arduino, will program...
Hi all again,
Looking at the 2 control panel boards running this circus, additional troubleshooting could burn more time that we don't have, The servos and the servo controller driving the 2 servos appear to be OK and are functioning as designed. So I need a Plan B.
Here's the thinking so far:
Defining the equipment
ChainHome - the reed switch that stops the undertrack chain at the end of the tip cycle
SkipArrive - the reed switch that starts the tip operations cycle - Starts the under-track chain
Cage - the reed switch under the tipple cage. This stops the under track chain and triggers the tipple servo that tips the coal from the skip.
KickbackApproach - the reed switch that triggers the kickback point to accept an incoming empty skip from the tipple
KickbackDivert - the reed switch that sets the kickback points to the divert route after the skip wheels have cleared the blades
CageServo - the servo that drives the tipple cage
KickbackServo - the servo that drives the kickback points.
Complications
The magnetic flux pattern changes as the skip rolls past a reed switch. Effectively there is zero magnetic flux and the reed switch will open if the magnet is centred directly over the reed switch. So once a field is sensed, we want the control circuitry to "stay switched" unless instructed otherwise.
Consider the kickback points. The ANE Smartswitch controller is currently set up so that a second signal on the same reed switch causes the same outcome as the first signal = No subsequent motion, because the reed switch has already triggered the move. so
At start-up - the first skip arriving from the tipple will set the direction of the turnout through the KickbackApproach reed switch. Prior to that first skip arriving, the orientation of the kickback turnout simply doesn't matter . Once the first skip arrives the circuit is self-correcting provided that the reed switches work.
There is also the problem of starting and stopping the under-track chain at different locations on demand. This is powered by a 12V gearhead motor that can pull up to 1.4 Amps.
The Plan B
Replace the control circuitry with an Arduino and use it to feed the "go" signals to the ANE Switchmaster that controls the speed and travel of the tipple and kickback servos. This part of the control system is working OK and looks like it does not have to be replaced.
The Arduino should be able to replicate the 555 timer inputs as part of the internal programming in Arduino-speak..
Implementing Plan B
So I bought an Arduino... and was able to load Dr Geoff's "Rotating Beacon" program into the Arduino, solder a resistor and a LED to some header wires.... and then got an LED that flashes as specified.
If I use several switches to stand in for the various reed switches, and assign them to some Arduino pins - that's the easy bit.
Now if I can pick the "right bits" of code and the shotgun them into the correct order into an Arduino sketch...
If I can get the Arduino to simulate the operations of the old control system, then it should be a case of unplugging the old control system, modifying the reed switches and ANE Switchmaster plugs to match the Arduino connections and then powering up the Arduino.
Hey - If I can get an LED to flash by Arduino, in the words of a former BBC motoring presenter "How hard can it be???"
Now would probably be a good time for some of the resident Arduino experts on here to chip in with some advice.. PLEASE!!!
Come back next time for Programming Logic 101. It will be along shortly