Saturday, March 04, 2006

Debugging feedback blocks

Last time I mentioned I was having problems with the software forgetting which train was in which block.

Closer investigation showed that there was a problem with one particular block. The train would leave the block and the ‘occupied’ light would go out, but shortly afterwards the occupied light would come back on and stay on.

I checked the wiring but there where no faults there, so I ran a test train over it at slow speed. For testing I’d hooked up a loco to a rake of coaches. Normally for block detection you would wire a resistor across a wheelset at the end of a train, otherwise you would just detect the presence of the engine. But I hadn’t got around to installing any resistors on the coaches.

So the block would read empty while the coaches where still occupying it. I didn’t think this would be a problem for some simple testing. However, occasionally one of the wheels on the train was making an electrical connection between the two block segments and the Lenz LB101 block sensor would be detecting the presence of the loco in the briefly linked block. And for some unknown reason it would fail to register the block as empty once the connection was broken. My assumption is that there is a fault in the Lenz LR101 feedback sensor when there is only a momentary signal on the input.

Later I’ll add some extra code to the software to double check the LR101 status when such a spurious signal arrives.

I removed the carriages and testing with one loco now worked flawlessly.

I added a second loco and again all worked fine - the trailing loco successfully stopping at the entry of the previous section whilst it waited for the first loco to exit. But I did notice on a couple of occasions that the LR101s would fail to successfully report that a section was empty. Usually this was corrected when a loco entered or left another section using the same LR101 (the LR101s report back the status of a block of four feedback items at one go).

That was until the lead loco simply refused to enter a section which was shown as being empty.

This afternoon I added a lot of extra code to the software to log the state as it gets updated by locos entering and exiting blocks. I’ve left two locos trailing each other around for over an hour waiting for the problem to recur but, as sods law often dictates, everything ran perfectly.

Posted by Mike on 03/04 at 06:26 PM
DCCSoftware • (1) Comments • (0) TrackbacksPermalink