chiark / gitweb /
new booster stuff
authorian <ian>
Sun, 16 Jan 2005 00:51:40 +0000 (00:51 +0000)
committerian <ian>
Sun, 16 Jan 2005 00:51:40 +0000 (00:51 +0000)
cebpic/README.circuitry

index ceeb9cde5ff949711f701fdccbc3c515c7f56ac7..7a58958a07f7c28578e8d3b41dfdb2810979cedb 100644 (file)
@@ -1,4 +1,4 @@
-                       TRAIN SET CIRCUITRY
+                       TRAIN SET CIRCUITRY                     -*-text-*-
                        -------------------
 
 This README describes some of the circuitry connected to the train set
@@ -17,61 +17,91 @@ The `booster' generates the track voltage.  It includes an overload
 protection feature.
 
 The PIC has direct control and responsibility for
-       Turning the track voltage on and off
-       Switching the track polarity according to the NMRA DCC spec
-       * Responding to overload
+       Turning the track voltage on and off
+       Switching the track polarity according to the NMRA DCC spec
+       Responding to overload (together with the hardware cutout)
 
 The relevant pins are
-       Booster Disable (output)
-       Booster Overcurrent (input)
-       Booster Flag (TBD)
-       Booster PWM (output)
+       Booster Shutdown (output)
+       Booster Recent Overload (input)
        Booster Direction (output)
+       User Fault Indicator (output)  *** PROVISONAL ***
 
-If both of the following conditions are true, the track will be
+If the following conditions are true, the track will be
 supplied with power:
-       * PWM is H
+       * Shutdown is L
        * The overcurrent cutout permits
-The polarity of the power is controlled by the Direction pin.
-(There is no need to specify which polarity is which, as this is not
+The polarity of the power is controlled by the Direction pin.  (There
+is no need to specify which polarity is which, as this is not
 meaningful in NMRA DCC.)
 
-The overload cutout circuit works, and should be driven, as follows:
-
-Initially, the Disable output should be Z or H.
-
-WIP up to here
-
-During normal operation, the Disable output should be L.  The track
-current is measured, and checked against a preset value.  If it is
-excessive this is considered `overload'.  If undervoltage persists for
-more than around 20-40us then the cutout will trigger: the power to
-the track will be disconnected (perhaps with a delay of up to 150us).
-Since the cutout prevents track power from being supplied, the
-undervoltage will persist.
-
-After a period of track undervoltage (including at startup), the
-cutout will start in the `tripped' state.  The PIC may override the
-trip by setting Retry H.  This will instruct the booster to (attempt
-to) supply track voltage, resetting the cutout, for up to 150us.  If
-this rectifies the undervoltage (for around 150us), the cutout will
-no longer feel the need to trip (and Retry can be taken L).
-
-If turning the track power back on does not rectify the undervoltage,
-the cutout will re-trip after 150us after Retry was set H.  In this
-case, the PIC must take Retry L for at least 4.7ms before another
-attempt can be made.
-
-Note that timings above are approximate, subject to variance during
-testing.  All of these timings are done with R-C timing circuits which
-maintain two notions of credit (undervoltage credit and retry credit),
-so short-term glitches don't affect things and oscillations etc. are
-averaged out.
-
-Note also that during a change of the Direction the booster fails to
-supply track power for around 10us.
-
-The Flag pin was originally intended for a use connected with an
-earlier (now abandoned) scheme for short circuit detection.  My
-current best guess at its best use is to control the Green segment of
-the track indicator LED.
+Booster Overload Cutout and Shutdown
+------------------------------------
+
+Initially, the Shutdown output should be Z.
+
+During normal operation, when the PIC wishes to supply power to the
+track, the Shutdown output should be L.  (The PIC should allow the
+host to say whether the track should be provided with power.)
+
+The overload cutout compares the track current against a preset value.
+Excessive current (or excessive voltage drop on booster's power input)
+constitutes overload.  If an overload occurs, the track power will be
+disconnected.  (This may take anywhere between a few hundred ns and a
+few tens of us, depending on circumstances, and is not guaranteed not
+to involve multiple switchings.)
+
+With no track power, there will be no track current and the overload
+immediately disappears.  So to prevent rapid oscillation, and as a
+backstop against PIC program failure, the overload circuit contains a
+retriggerable monostable: for the (approximately) 10ms following any
+overload, the cutout will still prevent the track power being
+restored.  During this period, the Booster Recent Overload input will
+be H.
+
+Overload shutdown and decoders
+------------------------------
+
+However, following an overload-induced cutout it is in fact necessary
+to further delay the return of track power: firstly, a track power
+interruption of 10ms is not enough to ensure that a DCC decoder will
+not retain speed and similar information from before the outage, and
+secondly, the out-of-specification fluctuations on the track during
+overload and cutout can be misinterpreted by the decoder as an attempt
+to communicate via a different protocol or to drive it in DC mode.
+
+Therefore, following an overload, the PIC should arrange to keep the
+booster shut down (using the Shutdown output) for at least 100ms
+before trying again.
+
+Overload shutdown and the host
+------------------------------
+
+The host must be informed about overload cutouts, so that it can know
+that the trains have stopped and inform the user.  Provision for this
+should be made in the PIC-to-host protocol.
+
+However, the host will not necessarily react to overload indications
+in a timely manner; in particular, it may continue to provide NMRA
+data which is only valid in the context of the state before the
+overload.  The PIC must disregard such NMRA bitstrings, so there must
+be provision made in the protocol for the host to acknowledge the
+overload, and for NMRA data (and perhaps other instructions) to be
+processed only if they follow such an acknowledgement.
+
+(One way for the host to acknowledge would be to have the host reissue
+the `apply track power' instruction, or similar.)
+
+User Fault Indicator
+--------------------
+
+*** PROVISIONAL ***
+
+The User Fault Indicator output controls, directly, the green segment
+of the `track power' tri-colour indicator LED.  This segment should be
+lit by the PIC whenever an overload has been detected and the fault
+has not yet been rectified by the user.
+
+When a fault is present, the PIC should occasionally attempt to
+reapply track power, so that it can indicate to the user when the
+fault has been fixed.