slowing down a DCC loco in a "block" using an arduino or similar circuit ?

HI,
I have been researching this problem for several days, but to no avail. I have read about DCC packets etc, and even how to maybe capture them, but all I want to do is as follows :

I have 3 up and 3 down line tracks that are hidden and they are intended to hold trains in some sort of sequence so that every time a train approches this "Fiddle yard" it enters 1 of the 3 vacant loops, starts to slow down in the 1st block section of that loop track, and then stops before it reaches the exit point/switch in the 2nd block. This 1st block slow down will trigger a train waiting in one of the other loops to start up and exit the storage loops to go around the layout.

In it's simplest form, I want the incoming train to enter the designated loop track, start to slow down to about 1/2 speed in the first isolated block (separate DCC feed), and then when it hits the second isolated block (seperate DCC feed) it will stop, utilising its programmed deceleration from about half speed or similar controlled by the 1st block, ensuring that the train will come to a full stop BEFORE it reaches the exit switch/point.

This will allow me to send random different trains around the figure 8 circuit (controlled by the arduino) to provide automatic variation of the traffic arriving / passing round the layout and through the high level through station.

My concept is to use an Arduino to control which tracks the train enters, and also a randomizer to decide which train leaves the complex for the next run through.

My main problem is that I know I can simply cut the power to the 2nd isolated section by sensing loco entry to that final section in my design, and the train WILL STOP AT SOME POINT IN THAT BLOCK, but each one is set up differently in terms of top speed, decelaration etc, so the stopping distance will be different in each trains case, hence the need to have a progammable "slow down block" before the stop section so that I can be certain that the train will not overrun the exit switch/point in the 2nd block, which will cause a DISASTER for obvious reasons. I admit I am a bit of a perfectionist, so most of my locos are stup with pretty realistic deceleration/stopping distances, which makes calculating the actual stopping point pretty difficult to ascertain.

I am a reasonably confident Arduino programmer, (and have written "C" programs commercially for many years) and can also handle a soldering iron and PCB or breadboard plus electronic components as well as most others, so I am simply looking for some sort of circuit that will let me automate this scenario relatively easily. I understand and already have circuit block detection in these loops, so my existing train detection system will be used to trigger the slow down ofthe incoming trains entry to the first block.

That is where I come to a brick wall. I understand that DCC uses data packets rather than PWM to control the loco, so I woullld guess that I need a way to modify the "speed" parameter of the data packet alone in each of the blocks to achieve my solution, or maybe I can use a different method to achieve the same end result ?

Any input on this issue would really be welcome, it has been driving me mad over several weeks now. !

Ian

Can you explain what this has to do with "sensors", please?

I think he has to sense the location of the locomotive before he slows it down.

The problem is that the whole idea of DCC is to get rid of the need for 'blocks' to power the locomotives although you may want to use them in the process of sensing the train location. You certainly don't control whether a locomotive moves or not by applying or removing power to a block.

You also do not 'modify the "speed" parameter of the data packet alone' in any block. The data packets are keyed to the locomotives and are the same for the entire layout. The speed is indeed determined by PWM, the data packets control the PWM rate.

In essence you have to sense the fact that a locomotive has reached a specific point. Then you have to modify the information in the packets that are addressed to that particular locomotive to slow it down and then stop it. I believe there are parameters, individually set for each locomotive, that determine how fast it accelerates and decelerates.

Don

AWOL - i hoped that their maybe some form of sensor that i might be able to use to achieve this aim ?

FLORESTA - I would agree that it seems that I need to use the Arduino to modify the DCC packet when my loco first enters the "slow down section" of my storage system (using a sensor of some form). Equally, I also want it to respond to a STOP command in the following block (with another sensor), where it is intended the loco will then stop reasonably gently, ensuring the entire train is FULLY IN the storage road, and it does not overrun the exit points.

I sortta hoped that maybe adding some form of resistance / Capacitive circuit might achieve the required result ? by kidding the loco to slow down due to an AC carrier voltage drop ? I usedot do this trick when using analogue DC control using various values of Thermistors which made the DC voltage slowly drop, thereby making the trains also slow downor even stop in some (precalculated) given distance. It was an imprecise science, but worked quite well on the whole.

The research I have done so far indicates that messing with the DCC packet construction is a pretty complex task, reading them and writing them seems to require a degree in calculus or similar ?

I am looking for an easy answer (of course) to what seems to be a relatively simple requirement. Maybe it is the holy grail, I do not know, but I am sure many other would be interested in such a solution to help with consist automation under DCC ?

Best, Ian

Don't even think about trying to control a DCC equipped locomotive by tinkering with the track power. Your sensors should notify your Arduino where the train is. Your Arduino should somehow tell the DCC command station to alter the signals that it sends to your particular locomotive.

In other words your Arduino should be communicating with or replacing your handheld controller.

Don