Pic code protection alert!
John Payson email (remove spam text)
> Assuming you get to build the power supply too, feed the track with AC
> (constant voltage) and (inside the train) slice either positive or negative
> half-cycles depending on the direction of travel commanded. This will
> simplify things since now you only need one switch, but it has to be
> bidirectional. For low frequencies a single triac (can you get triacs small
> enough?) could work, higher frequencies could use inverse-series connected
> MOSFETs or something similar. A custom drive waveform which is a square
> wave with maybe 10% return to zero time inbetween half-pulses would give the
> triac time to turn off and also an interval to synchronously send data in
> that will be fairly free of motor noise.
Hmm... I like this idea... [pondering how much a model RR setup would cost]...
Though thinking about it, what about running the rails with Manchester-coded
data [derived using a high-current bridge and a DC supply]? This could be
really easy (hardware) to decode (you've got a +/- 20 volt data signal)...
all you'd need to decode it would be a resistor going to a PIC port pin [RA4
would have a Shmidt trigger, but if you use that one you'd need a diode or
else tie the signal to another pin as well].
> If space permits, you can sense the motor voltage while the drive is off,
> this will be directly proportional to the speed. Thus a closed-loop speed
> control could be implemented.
Yup, this is possible but voltage->time is a little tricky to implement nicely
on a PIC; for fast speeds it could be done (use a resistor to convert voltage
into current, and use an RC timer). Alternatively, you might be able to AC
couple to a port pin and measure the frequency of the back-EMF waveform.
> The mind boggles at the possiblities of such a setup. Every locomotive,
> switch, and lamp-post in the whole model train landscape could be connected
> in parallel with two wires back to the control panel. (Ever heard of a
> "smart lamp-post"? You will.)
The one difficulty with this approach in general would be providing a back-
signal path from the locomotive to the main CPU; perhaps there could be a
current-sinking transistor in the locomotive to send data by modulating
In reply to: <199604261954.PAA14124@sable.cc.vt.edu> from "Mike Keitz" at Apr 26, 96 03:53:58 pm
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the