Programming the Advanced Mode

Programming Advanced Mode

If you wish to further tailor the operation of the module, then there are many options.  It is by no means necessary to understand this section, but it does illustrate all the options available if you have a special requirement.

The module works by making a number of decisions once it is triggered.  Each of these decisions can be altered by the user by reprogramming various settings. 

The module begins by searching for trains (A in the diagram below).

Whether the module is triggered or not by a passing train is based on the sensitivity setting for the infra-red sensor.  The sensitivity setting will not normally need adjustment, but it could be for instance to ignore carriages with dark undersides and only react to ones with white tape on the underside.

Trains need to be present over the sensor for a set period, before the module decides a train is actually present.  The duration is normall set to 1 second, but can be increased by reprogramming the Detection_delay.

 

Once the module has confirmed the true presence of the train, the module checks whether it should react (B).  There are three choices.  The module can be set to always trigger, or a proportion of trains trigger the module, or the module reacts randomly tor trains, the rest are ignored.  In the case of the proportion setting, the module keeps track of the number of triggerings, and only reacts to every 3rd, 4th, 5th train etc.  With the random setting, the module randomly choses whether to react.  Again, the module can be set to 1 in every 3,  1 in every 4, etc.  If it is decided that the module should not react to the detected train on this occasion, then it start searching for trains again (A).

If the module is triggered as a result of this check, a delay can be set to occur before the relay is energised (C).  There are three options.  The options are no delay, a fixed delay, or a random delay.  The fixed delay is up to 255 seconds.  The random delay is calculated each time the module is triggered, and falls between 25% and 100% of the fixed delay set.

After any delay, the module checks to see if it should wait for the train to clear the sensor, before activating (D).  It can be set to wait for the train to clear before activating, otherwise it immediately activates.

Activation means that the relay is then energised (BOD2-RLY) or the servo moves (SRV1-NS).

The module then follows the operations in the second diagram, below, and then returns to searching again.

Module Operation once Activated

wiring the BLOCKsignalling SRV1-NS 

There are a number of places in the program where the module can be forced to wait for the sensor to be clear before moving on.  For instance, if the train stopped over the sensor in front of a set of points, you might not want the program to continue until the train has moved off.

There is now the possibility of another delay.  Again, there are three options.  The options are no delay, a fixed delay, or a random delay.  The fixed delay is up to 255 seconds.  The random delay is calculated each time the module is triggered, and falls between 25% and 100% of the fixed delay set.

The sensor can again be checked at this point to see if the sensor is clear.

Then the relay is denergised.

Next, there is the option of another check for the sensor to be clear, another delay, and another check for the sensor to be clear.

If the operation of the relay needs to be occur several times, it can be repeated up to 255 times, following the same delays each time.

The module can also be set to:

always repeat if the sensor is obstructed
always repeat if the sensor is clear
never repeat if the sensor is obstructed
never repeat if the sensor is clear

Once the required number of operations has occured, there is the possibly to finally check the sensor is clear, before the module restarts.