Jump to content
 

Using a PIC micro-processor to control trains


MarshLane
 Share

Recommended Posts

3 hours ago, MarshLane said:

 

Hi Andy,

The topic is possibly getting a little off target, but that is my fault I guess!!  My original idea is a PCB that contains a PIC that provides (through PWM) a DC controller.  At its very basic level, thats it - it would allow me to set the speed from the code etc, or develop a handheld plug in containing a pot which could set the speed.  My plan was to crack all that and get it working, then progress.

 

The ultimate aim is that each DC controlled section has its own section controller PCB (SC), which has several settings coded into the software for the PIC for the class of train (UK being Class 0 (Light Engines) Class 1 (express passenger), Class 2 (local passenger), Class 4 (75mph freights), Class 5 (ECS), Class 6 (60mph freights) , Class 7 (45mph freights) Class 8 (35mph) Class 9 (25mph)).  In essence knowing which class of train is it would set a 'maximum line' speed on the PIC microprocessor, which is controlling the current section.

 

The information on the Class of freight would come from the timetable PIC processor, which is connected through a 'PIC'network to pass information to the first section board.   This can therefore set the maximum speed that is achieved through the section.  Through track circuiting, as the train approaches the end of the section, the Current SC passes current speed and train type data to the next SC over the 'PIC' network, therefore the information is being passed through with the progression of the train.  Through track circuiting, the current SC would know whether the next section was free or busy, if busy, it would slow the train and stop it by the signal.  Once the next section becomes clear and the signal (either automatically or manually) displays a proceed aspect, it would gradually increase the train train.  All of this can be done through track circuit inputs to the PIC and PIC software, although with a few other features that are on my 'to do' list - one for example, being the introduction of an RfID reader at the fiddle yard exit.    In essence all of this has already been done (with the exception of different speeds) by the MERG Superbloc system, but this is all component based from around 20 years ago, and I wanted to bring the PIC microprocessor into the mix to make it more flexible and dynamic.

 

On this basis, the locomotive identity is then passed to the next SC (along with the train class etc..) which would not only allow the maximum speed to be either the line speed or loco max speed, which ever is lower, but would also allow a form of individual loco settings to be created (such as initial boost when starting, or maximum/minimum speeds, crawl speed etc) to be stored.  Again its all data that can be handled by and communicated to/from the PIC microprocessor, But I am getting a along way down the development route at that stage.

 

The whole idea is that other than maybe the RfID chip, there is no modification required to the trains in anyway.  Everything is handled by the PCBs to allow the layout to run smoothly and prototypically, while allowing the operator to take on the roll of the signaller, rather than train driver.

 

Rich

 

Your plan definitely looks like a central control system with time and train class tables as the controlling information sources. You will need some sort of user interface to the tables to program those in initially and easily and quickly adjust them subsequently as needed.

 

One immediate concern I would have is that a roster of several different locomotives will each have a different DC voltage speed curve and limit, due to wheels size, gear ratio, motor efficiency, etc. . So you will also have to have a table of locomotive specs to modify the desired class speed to the one the individual loco actually in use has.  Bemf detection will stabilize the speed of any particular loco, but not take into account the mechanical differences between locos just mentioned.

 

With central control, you don't need (or likely want) independent decentralized PICs passing info from one to the next. Your central control can do that far more easily and reset/recover from track/running mishaps and loss of synchronisation when a loco "disappears" or somehow fails to be passed correctly. Either way though, your system is "open loop" and will have no way of knowing what's where, doing what, in many cases where some loco doesn't move as expected.

 

My unsolicited advice would be to design any centrally controlled system from the top down. That way you'll figure out the exact requirements of the bottom of the system section controllers before jumping and designing them, without knowing what the overall system needs them to be and do.

 

Andy.

 

 

 

 

 

 

 

 

 

 

 

  • Thanks 1
Link to post
Share on other sites

  • RMweb Gold
1 hour ago, Andy Reichert said:

 

Your plan definitely looks like a central control system with time and train class tables as the controlling information sources. You will need some sort of user interface to the tables to program those in initially and easily and quickly adjust them subsequently as needed.

 

One immediate concern I would have is that a roster of several different locomotives will each have a different DC voltage speed curve and limit, due to wheels size, gear ratio, motor efficiency, etc. . So you will also have to have a table of locomotive specs to modify the desired class speed to the one the individual loco actually in use has.  Bemf detection will stabilize the speed of any particular loco, but not take into account the mechanical differences between locos just mentioned.

 

With central control, you don't need (or likely want) independent decentralized PICs passing info from one to the next. Your central control can do that far more easily and reset/recover from track/running mishaps and loss of synchronisation when a loco "disappears" or somehow fails to be passed correctly. Either way though, your system is "open loop" and will have no way of knowing what's where, doing what, in many cases where some loco doesn't move as expected.

 

My unsolicited advice would be to design any centrally controlled system from the top down. That way you'll figure out the exact requirements of the bottom of the system section controllers before jumping and designing them, without knowing what the overall system needs them to be and do.

 

Andy.

 

Hi Andy,

Thanks for the advice - all is welcome, unsolicited or not!  I actually like when people disagree with a thought, as it tends to bring other thoughts up, and whether we eventually agree, or agree o differ, its always a welcome conversation point, as different people can throw up different ways of doing things.   What I'd put was very much a simplified view, but it may certainly be worth looking at a centrally controlled system.  Initially, I was intending to just use the MERG Superbloc boards, but the previously mentioned issues swayed me away from that.  The idea then was simply to update them to cover the same functions, but with some 'modern day magic' from microprocessors to allow it do other things.  When I sat thinking about it, I then realised that if I am going to update it, the logic would be to get it to handle other things too, and adapt to modern day ways of working.

 

For example the original Superbloc boards had a single 'train on track indication' to which a separate sensor could be added - the basics being if the board was slowing the train, then it started to reduce to a crawl once the TOTI activated, and stopped when the sensor switched on.  The decision on whether to stop or not being based on an electrical feed from the next section board.  Logically today, while the same TOTI/Sensor (infra-red?) approach could be made, the feed from the next section TOTI would be better based on the MERG CBUS data - with the TOTI on each section putting out a CBUS message on activation/deactivation.  On the original boards, there is a track connection from the onboard controller, but also a separate connection from the current Superbloc to the next one with the track power - if this is lower than the set speed of the next section, then the next section will speed match as the train enters and continue the acceleration to the section speed.  That happens automatically, so the new system needs to take the same approach.  My view being that can be done through communication (within set parameters) between the PICs.

 

 

Now, following my line of thought, keeping everything decentralised made sense, as each board was then only concerned with power and TOTIs/Sensors within its own area, as well as monitoring CBUS for any related messages from appropriate producers.  It keeps things simple in that respect.  I don't think any form of UI would be need for the Train Class data as that would be unlikely to ever change.  What would need a UI would be the loco roster info (the equivalent of specific loco CV values in DCC).  In essence keeping the timetable system as one dedicated board, possibly loading WTTs from an SD card with the files being created on a PC/Mac/Web-based system, and keeping the loco roster data on another dedicated independent board, would in my mind make sense.  Each section board would have defaults built into the software that are used in the case of an unidentified loco (ie a visitor or unidentified resident).  However, with each board passing data from one to another, the system 'should not' (famous last words!) ever lose an engine.  But if it did there is a default fallback.  The one big advantage I can see is that everything works independently - if the timetable processor goes down or is not plugged in, the trains can be departed manually.  If the loco roster doesn't work or only a couple of layout boards have been erected, the automated operations will still run.  Another reason for decentralised, if a section board ever fails, its a simple swap out with a spare and everything is back up and running, because in essence there is no section specific information contained in the software or on the PCB, each one is the same as the next and just reacting to information received.

 

However, moving to your suggestion and a centralised system.  I can see advantages there, in that there is one central system (perhaps more involved) that is monitoring everything and although with TOTI reporting on CBUS, it can still monitor which track circuits are enabled etc, a centralised system potentially has to handle a lot more 'to and fro' of data.  Such as managing speeds between sections - something that on a decentralised system the two adjacent boards manage themselves.  I acknowledge that on a centralised basis, the master processor, timetable processor and loco roster would likely all be combined, so that the master has all the data at its finger tips, but I am not sure thats a bonus in this case?  What are you thoughts - am I missing something obvious, that is gained through a centralised approach?

 

On the original Superbloc cards, each block had the ability to switch to shunt mode - a manual operation if you like, that could cross in to the next section.  With PIC processors, that becomes far easier as instead of needing a complete set of manual controls for each section that may require a 'shunt' mode, the layout could have two or three dumb handheld controllers, which are simply 'plugged in' and using CBUS or the 'PIC' network broadcast a message with a speed setting.  Any section control that is placed in shunt mode (by way of a push-button on the panel) could then change its speed setting in relation to the message and data received.

 

There are other aspects of course as I am intending that the setting of points and signals will be undertaken using CBUS messages too, that therefore allows the system to adapt at junctions easily, but interlocking and ensuring that a set of points cannot be changed while the signal is clear, and vice-versa will potentially mean other decentralised PCBs for specific functions - that may well be better handled centrally.  But one of my basic criteria is that is should be possible to erect part of the layout for display, operation or testing and everything to still function.

 

I have a lot of ideas of what I would like to enable the system to do, and this brings me back to the start, getting the basic controller working first (and understanding the electronics away from the PIC processor) before jumping in too deep.  But trying to have some fun with getting electronics to do things as well.  Above all I am a believer in the KISS (keep it simple stupid!) principals, the less complicated, the less chance of problems and errors!

 

I welcome views and constructive criticism from @Andy Reichert, @AndyID and anyone else that is following or reading the thread.  Its all valued input, and I'll be back to some actual electronics very shortly I hope :)

 

Rich

Link to post
Share on other sites

  • RMweb Gold
On 11/01/2020 at 01:49, Tricky Dicky said:

Have you considered PICAXE. Not usually the first choice of PIC due to speed and memory capacity but for what you are planning will easily cope. Plenty of interfacing circuits in the free manuals and cheap to get started.

 

http://www.picaxe.com/

 

Richard

 

Richard,

Sorry I seem to have missed your message.  I haven't although I have looked at it previously - I'll certainly take another look when I get to that stage, so thanks for the input.


Rich

Link to post
Share on other sites

1 hour ago, Andy Reichert said:

Bemf detection will stabilize the speed of any particular loco, but not take into account the mechanical differences between locos just mentioned.

 

BEMF is proportional to the motor's speed. You only need to know the motor's resistance, current and track voltage to calculate the BEMF. If you know the relationship between BEMF and actual speed for a particular locomotive you can calculate the instantaneous speed at any track voltage.

 

So you need to know two constants for each locomotive, resistance and speed against BEMF. The throttle is capable of determining both.

  • Informative/Useful 1
Link to post
Share on other sites

3 hours ago, Junctionmad said:

hS 

 

I meant some people dont  like PWM, ie 

pulse width modulation of a pulse signal. So the alternative is a DC level control via series pass element , yes via a amplifier which could   be driven in a number of ways from the PIC , R2R , DAC , or frequency to voltage etc. 

 

Ah! That was where you were going. You could use an amp but you could also just jack-up the PWM frequency and filter out the high frequency components.

Link to post
Share on other sites

On 27/12/2019 at 11:54, MarshLane said:

 

There is a risk of failing at the first hurdle here, and hence I am seeking some advice. First basic challenge is to slow a train down and quicken it up. My idea is to connect a digital potentiometer to the PIC, communicating over SPI, so that the pic software can control the speed curve. 2mm runs on 12v DC, most digital pots seem to be 0-5v - there are some 12v ones but they are running at £3-£4 a pot, where as the lower voltage ones are <£1.

 

So the initial question (sorry for the long run-in) is could I run a 0-5v digital pot connected to A PNP Darlington Pair to increase the voltage to the track? If so, are there any specifics for the Darlington Pair/chip that I need to take into account? Obviously I don’t want the voltage to the track to exceed 12v, but my thought was that if the pair was giving 15-18v for example at the top end, then this could be limited by preventing the software from setting the pot beyond the 12v level, or b) by using resistors to give a failsafe approach - or both!

 

My idea is that the PCB will, like the BC3, have two analog pots that can be set with a screwdriver, to allow the rate of acceleration/deceleration to be adapted for each board - basically feeding a value into the PIC which is used in the maths calculations to establish the change rate.

 

Any thoughts/suggestions on the query would be appreciated. 

 

Rich

 I only know Arduino,  if I were coding an Arduino  to set a limit to 12V then  I would process the  the output value of the digital pot with the functions min (value), or constrain ( minvalue, maxvalue),  where arguments value or maxvalue are equivalent to the digital pot setting for an  output of 12 Volts to the track, minvalue being  the digital pot setting for 0 Volts to the track, in essence you wish to overide the value of the digital pot when beyond your chosen limit of 12 V to the track

Are you working in  MicroPic C or Basic?  Please check the language reference book for the equivalent  functions which do the work of  , min, constrain, both  are  core functions in coding,  they may have a different name, but a penny to a pound they will be somewhere within your choice of coding  language for the MicroPic

 

Ps, re-eading your post, I am confused by your description of digital pots,  digital pots output  only digital  pulses  of logic 1 or 0 as you turn the control knob,  they do not  directly control "power".

It is  the analogue pot  which varies resistance in ohms as you turn the pot,  the analogue pot  could be used to  directly control the power to a motor   ( low power only or the pot would go up in smoke)!

 

Are you thinking that a digital pot works in the same way as an analogue pot?

Edited by Pandora
Link to post
Share on other sites

11 hours ago, Pandora said:

 

Ps, re-eading your post, I am confused by your description of digital pots,  digital pots output  only digital  pulses  of logic 1 or 0 as you turn the control knob,  they do not  directly control "power".

It is  the analogue pot  which varies resistance in ohms as you turn the pot,  the analogue pot  could be used to  directly control the power to a motor   ( low power only or the pot would go up in smoke)!

 

Are you thinking that a digital pot works in the same way as an analogue pot?

 

https://www.maximintegrated.com/en/products/analog/data-converters/digital-potentiometers.html

 

Digital pots generally contain a chain of, typically, 100 or 256 (sometimes less) resistors internally between a Vmax and Vmin (or some similarity named pins) which correspond to the two ends of a traditional pot. A multiplexor controlled by a digital register selects a point in the chain to tap. Some digital pots let you write the position register directly, others have an up/down counter which you pulse to get you to where you want to be.

 

Usually, because of the way the technology works the ends of the resistor chain must be within 0V to the logic power rail (typically 5V) - i.e. at least with the ones I've seen you can't use a digital pot directly to generate a 0-12V output.

 

To a circuit they are connected to they do look much like a traditional pot.

 

 

Edited by sharris
Link to post
Share on other sites

Quote

There is a risk of failing at the first hurdle here, and hence I am seeking some advice. First basic challenge is to slow a train down and quicken it up. My idea is to connect a digital potentiometer to the PIC, communicating over SPI, so that the pic software can control the speed curve. 2mm runs on 12v DC, most digital pots seem to be 0-5v - there are some 12v ones but they are running at £3-£4 a pot, where as the lower voltage ones are <£1.

 

So the initial question (sorry for the long run-in) is could I run a 0-5v digital pot connected to A PNP Darlington Pair to increase the voltage to the track? If so, are there any specifics for the Darlington Pair/chip that I need to take into account? Obviously I don’t want the voltage to the track to exceed 12v, but my thought was that if the pair was giving 15-18v for example at the top end, then this could be limited by preventing the software from setting the pot beyond the 12v level, or b) by using resistors to give a failsafe approach - or both!

 

My idea is that the PCB will, like the BC3, have two analog pots that can be set with a screwdriver, to allow the rate of acceleration/deceleration to be adapted for each board - basically feeding a value into the PIC which is used in the maths calculations to establish the change rate.

 

Any thoughts/suggestions on the query would be appreciated. 

 

Rich

 

You can easily do what you are saying with a 5V digital pot chip , an amplifier to step up the voltage and a darlington pair . Equally you can use a H-Bridge and filter it to produce DC

 

Its worth putting this question into the MERG forum as there are some current and recent projects to create distributed DC control systems.  One of the issue with PWM is at teh boundary the loco may in effect join two H-bridges together in parallel , but these bridges are not synchronised and hence create shorts for one another . IN the MERG system this was solved by distributing a clock to keep all teh PWM synchronised 

 

A pure DC system is easier to manage in that respect 

 

 

 

Link to post
Share on other sites

Quote

There is a risk of failing at the first hurdle here, and hence I am seeking some advice. First basic challenge is to slow a train down and quicken it up. My idea is to connect a digital potentiometer to the PIC, communicating over SPI, so that the pic software can control the speed curve. 2mm runs on 12v DC, most digital pots seem to be 0-5v - there are some 12v ones but they are running at £3-£4 a pot, where as the lower voltage ones are <£1.

 

So the initial question (sorry for the long run-in) is could I run a 0-5v digital pot connected to A PNP Darlington Pair to increase the voltage to the track? If so, are there any specifics for the Darlington Pair/chip that I need to take into account? Obviously I don’t want the voltage to the track to exceed 12v, but my thought was that if the pair was giving 15-18v for example at the top end, then this could be limited by preventing the software from setting the pot beyond the 12v level, or b) by using resistors to give a failsafe approach - or both!

 

My idea is that the PCB will, like the BC3, have two analog pots that can be set with a screwdriver, to allow the rate of acceleration/deceleration to be adapted for each board - basically feeding a value into the PIC which is used in the maths calculations to establish the change rate.

 

Any thoughts/suggestions on the query would be appreciated. 

 

Rich

 

You can easily do what you are saying with a 5V digital pot chip , an amplifier to step up the voltage and a darlington pair . Equally you can use a H-Bridge and filter it to produce DC

 

Its worth putting this question into the MERG forum as there are some current and recent projects to create distributed DC control systems.  One of the issue with PWM is at teh boundary the loco may in effect join two H-bridges together in parallel , but these bridges are not synchronised and hence create shorts for one another . IN the MERG system this was solved by distributing a clock to keep all teh PWM synchronised 

 

A pure DC system is easier to manage in that respect 

 

 

 

 

 

Screenshot 2020-01-21 12.33.27.png

Edited by Junctionmad
Link to post
Share on other sites

A decentralised systems is easier to manage , ie a digital Superbloc as to my knowledge no off the shelf " whole layout " automation is available for DC , so your very much into a roll your own 

 

A digital version of Superbloc would look something like this 

 

The disadvantages are common to all DC control systems, that is you have no knowledge of the relationship between  the applied DC violate and the running speed .  Sensing BEMF doesnt help , in order to have a relationship , you are into train identification , as you have to relate the train in the block with its DC characteristics .  This is a whole big can of worms.  Superbloc makes no attempt at that and in my view neither should you .

 

 

 

Link to post
Share on other sites

13 hours ago, AndyID said:

 

BEMF is proportional to the motor's speed. You only need to know the motor's resistance, current and track voltage to calculate the BEMF. If you know the relationship between BEMF and actual speed for a particular locomotive you can calculate the instantaneous speed at any track voltage.

 

So you need to know two constants for each locomotive, resistance and speed against BEMF. The throttle is capable of determining both.

 

Maybe I confused everyone by not saying a bemf feedback controller can stabilize a loco speed. 

 

Otherwise I'm afraid I don't understand what you are suggesting . Bemf is the voltage produced by a moving motor due to the dynamo effect. It's proportional to the motor speed. You can dynamically measure it on a moving model DC loco directly from the track voltage at zero motor current it by blocking the applied power for around 50 uS as often as necessary.

 

Andy

Link to post
Share on other sites

1 hour ago, Andy Reichert said:

 

Otherwise I'm afraid I don't understand what you are suggesting . Bemf is the voltage produced by a moving motor due to the dynamo effect. It's proportional to the motor speed. You can dynamically measure it on a moving model DC loco directly from the track voltage at zero motor current it by blocking the applied power for around 50 uS as often as necessary.

 

 

Yes, that's one way to do it but you can also determine the BEMF from the track voltage and motor current if you know the internal resistance of the motor. With that method there is no need to cut power to the motor.

 

The BEMF equals Track Voltage minus (Current x IntRes)

 

And to maintain constant speed you just add Current x IntRes to the "demand" voltage to compensate for the voltage drop across the motor's internal resistance. The motor is running on DC which is much better for coreless motors.

 

However, there cannot be a lot of resistance between the controller and the motor so it does require good power distribution practice but that's always good anyway.

 

 

  • Like 1
Link to post
Share on other sites

Knowing the BEMF is useless , because unless you have a relationship stored somewhere that relates a loco ID to the speed over the ground . 
 

this then means you need loco ID ie trains-ponding so that the block controller knows what loco it’s dealing with 

 

if you do that , you still don’t need BEMF , because you might as well store speed versus applied voltage for a given loco and simply look up the needed DC voltage for a given speed 

 

the alternative is a whole layout control system that knows where everything is and what everything is. Good luck with that in DC. 
 

the practicalities of implementing a solution in a DC layout means in reality you will simply have to accept you can’t profile locos no identify the specific loco in the block section . All you can do is ramp up and down the track voltage and the locos  respond based on load and gear ratios 

Link to post
Share on other sites

11 hours ago, sharris said:

 

https://www.maximintegrated.com/en/products/analog/data-converters/digital-potentiometers.html

 

Digital pots generally contain a chain of, typically, 100 or 256 (sometimes less) resistors internally between a Vmax and Vmin (or some similarity named pins) which correspond to the two ends of a traditional pot. A multiplexor controlled by a digital register selects a point in the chain to tap. Some digital pots let you write the position register directly, others have an up/down counter which you pulse to get you to where you want to be.

 

Usually, because of the way the technology works the ends of the resistor chain must be within 0V to the logic power rail (typically 5V) - i.e. at least with the ones I've seen you can't use a digital pot directly to generate a 0-12V output.

 

To a circuit they are connected to they do look much like a traditional pot.

 

 

I stand corrected!  I am the one confused,  I am confusing the Digiital potentiometer with  the rotary digital encoder.

  • Friendly/supportive 1
Link to post
Share on other sites

31 minutes ago, Junctionmad said:

Knowing the BEMF is useless , because unless you have a relationship stored somewhere that relates a loco ID to the speed over the ground

 

A block controller can "hand off" data to adjacent block controllers.

 

31 minutes ago, Junctionmad said:

this then means you need loco ID ie trains-ponding so that the block controller knows what loco it’s dealing with 

 

without any train-sponding.

 

32 minutes ago, Junctionmad said:

if you do that , you still don’t need BEMF , because you might as well store speed versus applied voltage for a given loco and simply look up the needed DC voltage for a given speed 

 

You can't directly relate speed to track voltage. Train length/weight, gradients, curves, temperature etc all affect speed.

 

33 minutes ago, Junctionmad said:

the alternative is a whole layout control system that knows where everything is and what everything is. Good luck with that in DC.

 

You could do that of course but it doesn't make much difference whether it's DC or DCC. There are pros and cons for both. Anyway, Rich is looking for an incremental approach.

 

33 minutes ago, Junctionmad said:

the practicalities of implementing a solution in a DC layout means in reality you will simply have to accept you can’t profile locos no identify the specific loco in the block section . All you can do is ramp up and down the track voltage and the locos  respond based on load and gear ratios 

 

In your opinion. I would have to disagree.

  • Friendly/supportive 1
Link to post
Share on other sites

  • RMweb Gold
13 hours ago, Pandora said:

 I only know Arduino,  if I were coding an Arduino  to set a limit to 12V then  I would process the  the output value of the digital pot with the functions min (value), or constrain ( minvalue, maxvalue),  where arguments value or maxvalue are equivalent to the digital pot setting for an  output of 12 Volts to the track, minvalue being  the digital pot setting for 0 Volts to the track, in essence you wish to overide the value of the digital pot when beyond your chosen limit of 12 V to the track

Are you working in  MicroPic C or Basic?  Please check the language reference book for the equivalent  functions which do the work of  , min, constrain, both  are  core functions in coding,  they may have a different name, but a penny to a pound they will be somewhere within your choice of coding  language for the MicroPic

 

Ps, re-eading your post, I am confused by your description of digital pots,  digital pots output  only digital  pulses  of logic 1 or 0 as you turn the control knob,  they do not  directly control "power".

It is  the analogue pot  which varies resistance in ohms as you turn the pot,  the analogue pot  could be used to  directly control the power to a motor   ( low power only or the pot would go up in smoke)!

 

Are you thinking that a digital pot works in the same way as an analogue pot?

 

Thanks for the input on that.  I did seriously look at Arduino, as I wondered if the development around the microprocessor (rather than the software) would be easier, but I could never see how it could easily be transferred to a PCB to produce 20-30 of them as would be needed for a decentralised block approach.  Maybe I missed something tho?   With regards the digital pots, what I failed to include and probably brought about your confusion was that the digital pot would be an input to the PIC which would then work its magic through the software to control the outgoing 'power', rather than a direct connection.

 

 

7 hours ago, Junctionmad said:

A decentralised systems is easier to manage , ie a digital Superbloc as to my knowledge no off the shelf " whole layout " automation is available for DC , so your very much into a roll your own 

 

A digital version of Superbloc would look something like this 

 

The disadvantages are common to all DC control systems, that is you have no knowledge of the relationship between  the applied DC violate and the running speed .  Sensing BEMF doesnt help , in order to have a relationship , you are into train identification , as you have to relate the train in the block with its DC characteristics .  This is a whole big can of worms.  Superbloc makes no attempt at that and in my view neither should you .

 

Im coming the view that alot of this is personal preference, but I would respectfully disagree with the view that identification shouldn't be done. I totally agree that it opens another can of worms (which is why it comes towards the end of the project on my 'to-do' list!) But for the layout I am thinking of, it should be quite feasible to identify the loco, by using RfID chips, and that loco identification is then passed from block to block.  The actual block is not handling the identification, but simply being advised by the previous block.  In a worst case scenario, where something goes wrong and info doesn't appear, the block falls back to the default settings.  That I do not personally think, is too difficult.  How far the system goes towards tailoring system settings to a specific loco is a totally different subject and one that I feel ma only become apparent through testing, at the relevant time.

 

1 hour ago, Junctionmad said:

Knowing the BEMF is useless , because unless you have a relationship stored somewhere that relates a loco ID to the speed over the ground . 
 

this then means you need loco ID ie trains-ponding so that the block controller knows what loco it’s dealing with 

 

if you do that , you still don’t need BEMF , because you might as well store speed versus applied voltage for a given loco and simply look up the needed DC voltage for a given speed 

 

the alternative is a whole layout control system that knows where everything is and what everything is. Good luck with that in DC. 
 

the practicalities of implementing a solution in a DC layout means in reality you will simply have to accept you can’t profile locos no identify the specific loco in the block section . All you can do is ramp up and down the track voltage and the locos  respond based on load and gear ratios 

 

I can see (I think) where your coming from, but again, with a centralised control approach, depending on the complexity of the layout, it should not be very difficult to pass information from block to block - even if that information never leaves the centralised system.  But there are a couple of ways of identifying the loco in a block (such as RfID as I suggested earlier) where the identification does not need to take place in EVERY block, possibly just the first after leaving the fiddle yard.  But that is something that is very specific to the complexities of each layout, and could also depend on whether trains are single locos, double heading, or multiple 'lash-ups' in American parlance.

 

Rich

Link to post
Share on other sites

3 hours ago, AndyID said:

 

Yes, that's one way to do it but you can also determine the BEMF from the track voltage and motor current if you know the internal resistance of the motor. With that method there is no need to cut power to the motor.

 

The BEMF equals Track Voltage minus (Current x IntRes)

 

And to maintain constant speed you just add Current x IntRes to the "demand" voltage to compensate for the voltage drop across the motor's internal resistance. The motor is running on DC which is much better for coreless motors.

 

However, there cannot be a lot of resistance between the controller and the motor so it does require good power distribution practice but that's always good anyway.

 

 

 

Actually it's the way I designed and built my own DC controllers.  Since most controllers of the time needed to incorporate some speed associated pulse power to assist low speed starting and running, chopping the output as needed was a free function. 

 

I'm supposing your example would need additional current measurement and calculation functions plus an operator input to select which motor (and hence which internal resistance value + the controllers own internal impedance ) to use in your calculations?  Since all those impedances are very low in the first place, I wonder how you would measure the motor current in that case?

 

Sorry if this is heading away from the substance of the topic.  I only introduced "bemf" as likely to be incorporated to increase the consistency of each section speed control.

 

Andy

  • Like 1
Link to post
Share on other sites

  • RMweb Gold
41 minutes ago, Andy Reichert said:

I'm supposing your example would need additional current measurement and calculation functions plus an operator input to select which motor (and hence which internal resistance value + the controllers own internal impedance ) to use in your calculations?  Since all those impedances are very low in the first place, I wonder how you would measure the motor current in that case?

 

Sorry if this is heading away from the substance of the topic.  I only introduced "bemf" as likely to be incorporated to increase the consistency of each section speed control.

 

Andy

 

Hi Andy,

Dont apologise - its got debate going which can only be a good thing, and its an interesting conversation (well to me anyway!) at the same time.


Rich

Link to post
Share on other sites

  • RMweb Gold
2 minutes ago, Andy Reichert said:

I should have asked early on if the modular block section pass-on design is intended for one way only (say LH running on double track) or both way, as in single track working?

 

Andy

 

Hi Andy,

Nominally it would be directional - so each block section would generally be signalled for one direction.  However, my plan is to keep it reversible (same as the older MERG Superbloc) so that it can cope with bi-directional and also automated short moves, just like the real railway.  For example:

 

BC4-Block-Section-Diagram.png.7d3490ee658d95e5b52c60a12748b070.png

 

In this case the automated movements would be Section A to either B or C, depending on the setting of the points, then B > D and C > D.  However, there may need to be an occasion when a locomotive 'runs-round' its train. In which case the process that clears Signal S3 to allow the move into Section D, also sends a message to the PIC on Section D board that this a short-move, this has the effect of steadily slowing and stopping the locos as soon as the TOTI (Track Circuit) for Section D activates.  Section B block processor would then auto select 'reverse' and wait for S5 shunt signal to be cleared for a Section D > C movement.  When that signal is cleared, Section D PIC would advise Section C PIC of a 'reverse movement'.  

 

The same happens at the left side of Section C. Once S6 shunt signal is cleared, Section C PIC would advise Section A PIC of a 'reverse short movement'.  Section A PIC would then slow the loco as soon as the track circuit activated and bring it to a stop, putting the block back into 'normal' (ie not reverse) operation, and waiting for S1 or S2 to clear.  (In this case it would need to be S2, as the track circuit for Section B would be occupied by the wagons/coaches off the train, there by preventing the main aspect from clearing).

 

I've just realised that I haven show S7, which would be a three aspect colour light above S6, controlling the left exit from section B to Section A.  But you'll understand my thought .. I hope!  The above is just a quick example, and does not represent any location on the proposed layout, but is suitable for showing the various moves, as Section A, B, C, and D would all be identical block control boards.

 

RIch

Link to post
Share on other sites

I still see several significant issues 

 

while it’s entirely possible to rely loco specific data from block to block , something at the start has to provide that initial data. ! 
 

secondly when people bandy about terms like RFID , they are clearly not aware of the issues. Merg members have done a huge amount of work in this area but the systems using commercially available tags and readers are not yet “mission capable “ because there are issues like speed of reading , antenna position /distance and multi track interference. 
 

these are not easily solved 

 

when I was in college , we cloned the term “ microprocessor do wonder “ to describe the situation where with a wave of the hand technical issues were bypassed 

 

there is already man years on implanting the basic digital super bloc , merely mind trying to make it loco specific 

 

I’m not decrying trans-ponding , but I know from my on experiments that the devil is very much in the detail 

 

in the same way mention was made of “ using CBUS “ etc. Right now CBUS for example has no means of transferring analog values without custom module software , doable ,yes , out of the box ,no 

  • Friendly/supportive 1
Link to post
Share on other sites

On 21/01/2020 at 13:53, Andy Reichert said:

 

Actually it's the way I designed and built my own DC controllers.  Since most controllers of the time needed to incorporate some speed associated pulse power to assist low speed starting and running, chopping the output as needed was a free function. 

 

I'm supposing your example would need additional current measurement and calculation functions plus an operator input to select which motor (and hence which internal resistance value + the controllers own internal impedance ) to use in your calculations?  Since all those impedances are very low in the first place, I wonder how you would measure the motor current in that case?

 

Sorry if this is heading away from the substance of the topic.  I only introduced "bemf" as likely to be incorporated to increase the consistency of each section speed control.

 

Andy

 

Hi Andy,

 

I think it's very relevant to the substance of the topic (the OP and others might have a different opinion).

 

With DCC you can tell a locomotive what speed it should run at but you don't have that option with DC unless you do some tricks. The idea of using some sort of voltage boost to compensate for changes in load is an old idea. I think I saw it first in a US model railroad mag I picked up in Glasgow many many moons ago.

 

For a basic feedback controller, my method is to use a couple of op-amps. One sums the demand and the feedback, and the other provides the current value and these are summed into a virtual earth. The snag (as you point out) is, unless you know the resistance of the motor in advance, how much do you compensate for the current? Well, with a PIC or similar just measure the motor's resistance before it gets going, add a fudge factor, and carry on.

 

Reply here or please PM me for more details if you think we are heading into the undergrowth.

 

Cheers!

AndyID

 

 

  • Informative/Useful 1
Link to post
Share on other sites

On 21/01/2020 at 15:43, Junctionmad said:

when people bandy about terms like RFID , they are clearly not aware of the issues

 

Hi Dave,

 

Perhaps I missed it but I rather think the only person who brought up RFID is your good-self. Feel free to correct me. I'm usually wrong (according to MrsID).

 

Andy

Link to post
Share on other sites

7 hours ago, AndyID said:

 

Hi Dave,

 

Perhaps I missed it but I rather think the only person who brought up RFID is your good-self. Feel free to correct me. I'm usually wrong (according to MrsID).

 

Andy

Mrs ID is right , 

 

MarchLane brought it up first ( my emphasis ) . I mentioned that you have to link loco to its profile . I didnt suggest RFID until it was mentioned 

 

Quote

 

Im coming the view that alot of this is personal preference, but I would respectfully disagree with the view that identification shouldn't be done. I totally agree that it opens another can of worms (which is why it comes towards the end of the project on my 'to-do' list!) But for the layout I am thinking of, it should be quite feasible to identify the loco, by using RfID chips, and that loco identification is then passed from block to block.  The actual block is not handling the identification, but simply being advised by the previous block.  In a worst case scenario, where something goes wrong and info doesn't appear, the block falls back to the default settings.  That I do not personally think, is too difficult.  How far the system goes towards tailoring system settings to a specific loco is a totally different subject and one that I feel ma only become apparent through testing, at the relevant time.

 

Edited by Junctionmad
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...