OK Oliver, here's the design I've come up with.
It uses quite a few more components than I had hoped, but I can't see any way to simplify it, and it does seem to work pretty well (in simulation, at least).
The circuit requires a 24V DC power supply that is powered via your timer. When the timer turns ON and the 24V DC appears on the circuit's input, it pulses relay K1 ON for around 0.4 seconds. When the timer turns OFF and the 24V DC drops away to zero, the circuit pulses relay K2 ON for around 0.3 seconds. I'm assuming the pulse durations aren't critical.
The circuit uses four transistors, five diodes, one IC (U1), four capacitors, 14 resistors, and two relays. You can build it up on stripboard - Google stripboard construction to learn more about this. You will need all your components to be THT (through-hole technology) - i.e. with wire leads.
The three components at the left side of the diagram represent parts inside the 24V DC power supply and are not part of the circuit design. They are needed for simulation.
The circuit accepts 24V DC from the power supply on the two rails marked +24V (connect to power supply positive) and 0V (connect to negative).
The blue trace on the graph, marked V(n001), is actually the voltage at DP's anode. It represents the mains supply (from the timer) turning ON and OFF.
Here are some notes on the components in the design. I will include information on suitable components available by mail order from Digikey (
http://www.digikey.com) but you can also use locally available equivalent parts.
If you need more specific information please let me know.
Here's a complete components list:
2x 1k5 (1.5 kilohm) 1W resistor (R1,2)
1x 180R (180 ohm) resistor (R3)
4x 5k6 (5.6 kilohm) resistor (R4,9,11,14)
5x 22k resistor (R5,8,10,12,13)
2x 3k3 (3.3 kilohm) resistor (R6,7)
1x 1000 µF, 35V electrolytic capacitor (C1)
3x 10 µF, 35V electrolytic capacitor (C2,3,4)
1x 1N5404 diode (D1)
4x 1N914 or 1N4148 diode (D2,3,4,5)
2x 2N3906 or BC557B transistor (Q1,3)
2x 2N3904 or BC547B transistor (Q2,4)
1x TL431LP shunt regulator IC (U1)
2x relays, 24V DC coil, coil resistance 2400 ohms or higher, SPST (aka SPNO) or SPDT (aka SPCO) or DPDT (aka DPCO) contact arrangement.
R1 and R2 must be rated for 1W (one watt) power dissipation and should be mounted raised off the board slightly (e.g. 1/4 inch). Something like
http://www.digikey.com/product-detail/en/FMP100JR-52-1K5/1.5KWCT-ND/2058904
All other resistors should be 1/3W or 1/4W rated. Digikey have the Stackpole RNMF series available ex stock in all the required values.
Resistors are non-polarised and can be inserted either way round. All the other components must be connected the right way. Google electronic component polarity markings to find out how they're marked.
The capacitors are all standard electrolytic types rated for 35V or more. The hollow plate on the diagram (the top plate on C1, C2 and C3, and the left plate on C4) is the positive terminal.
D1 is shown as an MURS320 or 1N5404, but the MURS320 marking is only there because the simulation software doesn't have the 1N5404, which is the part I recommend. D2,3,45 are 1N914 or 1N4148 glass diodes.
There are four transistors. Q1 and Q3 are 2N3906 types (PNP) and Q2 and Q4 are 2N3904 types (NPN). These should be readily available anywhere but you can also use BC557B for the PNPs and BC547B for the NPNs.
U1 is a TL431LP device. It looks exactly like a transistor but it isn't one.
You will need to download the data sheets for the transistors and U1 to figure out which wire is what. These data sheets are available through Digikey. Do a search for the part number, and you'll see a column of PDF symbols near the left side of the results table. These are links to the data sheets. These components are available from several manfacturers; they are interchangeable.
The resistors marked K1 and K2 on the diagram with resistances of 3840 ohms actually represent the coils of the two relays, K1 and K2. These relays must have a 24V DC coil and a rated coil current no higher than 10 mA (milliamps), which corresponds to a coil resistance of 2400 ohms or more.
Two suitable relays available from Digikey are the Omron G5V-1-D and the TE Connectivity V23026A1004B201 but you can use a local alternative as long as its coil is rated for 24V DC with a resistance of 2400 ohms or higher. You'll need the data sheet too. The marked resistance, 3840 ohms, matches the Omron relay.
The relays only need to have an SPST (aka SPNO) contact arrangement. The Omron and TE Connectivity relays both have an SPDT (aka SPCO) contact arrangement, so you need to connect to the COM (common) and NO (normally open) terminals. You can also use DPDT (aka DPCO) relays; use the COM and NO connections on one side.
The wires from the relay contacts connect in parallel with the START and STOP buttons on the machine to be controlled.
That's all the special information on the components.
Here's a circuit description. Don't worry if you don't understand all of it.
The graph shows the circuit's operation over a six second period. Incoming power is applied for the first second, and removed for the next second, and the cycle repeats three times.
The blue trace, V(n001), represents the mains supply. It is ON for one second, then OFF for one second, and the cycle repeats two more times. This demonstrates the generation of the relay pulses three times each.
R1 provides a load to discharge the output capacitor(s) in the power supply, so that when the power supply loses its AC power source, the output voltage will drop within a reasonable amount of time. This is needed because the circuit monitors this voltage to detect loss of power so it can pulse the STOP relay. R1 ensures that the voltage falls reasonably quickly.
R2, R3 and U1 are the voltage monitor that detects falling input voltage. R2 and R3 form a voltage divider that provides a fixed proportion of the input (power supply) voltage into U1, which has an input voltage threshold of 2.5V. This translates into a power supply voltage threshold of around 18V.
When the power supply voltage is greater than the threshold, U1 pulls its output (the K node) down to 0V, which turns Q1 ON. R4 provides positive feedback (hysteresis) to the measurement node so that the circuit switches quickly and cleanly.
The green graph trace, V(k), shows the voltage at node K relative to the 0V rail.
The voltage at noce C swings up to +24V when the input voltage is greater than around 18V, and down to close to 0V when the input voltage is less than around 18V.
The red trace on the graph, V(c), shows the voltage at node C relative to the 0V rail.
The 0V rail is interrupted by D1. The 0V rail right of D1 is named 0VB. C1 provides smoothing between +24V and 0VB. This allows the relay coil drive circuit for K2 to start with about 24V even when the input voltage has dropped significantly, so K2 will close reliably.
When power is applied and node C goes positive, current through C2 and R8 turns Q2 ON, applying about 24V across the K1 coil. When C2 has charged up, Q2 turns OFF, and K1 drops out. This generates the START pulse from K1.
The pink trace on the graph, I(K1), shows the current pulse through K1 when power is applied.
C3 and associated components delay detection of low voltage. This is needed because when the circuit is initially powered up, as the input supply voltage rises, U1 will briefly detect that the voltage is below the threshold. Once the incoming voltage has passed the threshold, U1 will pull node K down, and Q1 will pull node C high, but node C will be low briefly during power-up. R10 and C3 form an RC delay circuit to prevent Q3 from turning ON during this brief power-up pulse.
When the incoming power supply voltage has dropped below the 18V (approx) threshold and node C has gone low long enough for C3 to charge to Q3's base-emitter threshold voltage, Q3 turns on, and node D goes high.
The cyan trace on the graph, V(d)-V(0vb), shows the voltage at node D relative to 0VB, i.e. the voltage across R12.
This rising voltage is coupled through C4 into Q4 in the same way that node C is coupled into Q2. This causes Q4 to turn ON briefly and produce an activation on K2, operating the STOP button. The supply for K2 is provided by C1, which discharges somewhat during the pulse.
D2 and D4 protect Q2 and Q4 from negative base voltages, and D3 and D5 protect Q2 and Q4 from back EMF from the relay coils.
Feedback, opinions or suggestions, anyone?