Just want to pick your brains over a project I'm looking at starting. I want to build a controller for a club layout and thought that I could use a PIC rather than traditional descrete components.
The controler will initially have direct control (ie no simulated coasting and breaking), so I thought of two possible ways the PIC could be used, and wondered if you had any comments.
The first is to use A/D to read the voltage on one pin, and then output a DC voltage to a FET / power transistor to drive the motor from a 12v supply.
The second uses the same A/D to read the voltage on a pin, but the output is PWM (or more exact PPM), which is then used to drive the FET or power transistor in the same way.
The reason I wanted to use a PIC was to add things later such as auto station stops (triggere by a sensor on the track) and simulated inetia, and programming the pick to to that might be better than loads of high value capacitors and the like
Not 100% sure what it's called, but have you ever heard of DMC control (again, not sure what it really is)?
As far as I know, you put DC power to the track, superimpose a digital HF signal over the top of the DC power (AC riding on DC). Each 'unit' has a receiver waiting for some sort of encoded sequence, whatever. 1000 different ways of doing it I suppose. Not sure how I'd do it if I had to. Maybe even IR LEDs spaced out everywhere along the track and IR detectors in each 'unit' to detect various codes and commands...
Yes I'm awear of the "digital revolution" that is now appearing in the model railway world, however its not a possibility here for several reasons.
1) - its a club layout, so we need to use "traditional" controllers so that members can run their own locos, and most don't use DMC
2) - we're modelling in N gauge, and most of the modules are too large to fit is the intended stock
So, you have member A, with his regular ol' analog controller (big transformer, big pot, reversing switch, etc) running his loco on the same length (electrically and physically) of track (only for arguments sake) as member B who has his own controller and his own loco...
And you want them to be able to control their 2 loco's independently...using those same controllers so the members don't have to go out and buy completely new stuff, but instead add new stuff to the output of their old stuff to make their old things do new things...
And be able to fit these controllers inside an N gauge loco...
Woof! Ya don't ask for much do ya
Or have I missed something...(I probably have). I've got a few ideas (as I'm sure others do), but each one of them would require some sort of PCB to be added to each loco so it could decode what it needs to do. A small PIC based decoder with a MOSFET using bidirectional PWM drive shouldn't take up that much space (maybe 1 or 2 sq.inches. at most). I've got a 3 channel driver board that'll handle a few amps on each channel, has a 16F628A onboard along with a few other things and it's almost small enough to fit inside an N gauge loco. Take off those 'other things', redesign the board and it should fit...but again, I've probably missed something...
So, you have member A, with his regular ol' analog controller (big transformer, big pot, reversing switch, etc) running his loco on the same length (electrically and physically) of track (only for arguments sake) as member B who has his own controller and his own loco...
No - the member will not be asked to bring their own controllers. The idea is that the club layout will have its own control panel with its own controllers, and as 96% of the membership don't have DCC type control the decision was taken to build "traditional" means of control so that on a club night any member can bring their own locos along and "play trains"
As we need the option to control four trains at one time, I thought that the use of a PIC could reduce the amount of descrete components required (or use 2 pics if there aren't any that have 4 A/D ports - have yet to check the Microchip site) - especially when the controller gets developed a stage further and we build in delays to represent coasting, and simulated acceleration.
just to translate from "Old" logical circuits to PIC ...
All functions to program are clearly shown.
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
hopefully the attached image will try to get over my idea. By adjusting VR1 the resulting value is used to adjust the PPM output on RB0 which (via the power tranny) is fed to the tracks.
Bookmarks