** One solution is to use high frequency AC on the tracks in addition to whatever voltage runs the locos.
A voltage of about 1.7 volts rms at say 20 kHz should have virtually no effect on model electric DC motors and be inaudible too.
One simply capacitor couples the voltage to the tracks an uses a series cap inside the loco for each lamp - 4.7uF, 50 volt bi-polar types would do fine for both jobs. Long as the tracks are kept clean and wheels make good contact, lamp brightness is reasonably steady. Remote control of lamp brightness is made simple too by just varying the AC voltage level.
However, an on-board battery supply cannot be beaten for steady light - that will even keeps going if the loco crashes.
If you not using DCC or other digital controls on the locos the old classical way is to run 30 khz AC on the tracks, injected on top of the DC for the motors. the loco motors will not respond to the AC, and life is good. Of course the lamps are AC coupled with a cap to block the DC. The industry term is "constant current lighting" if you your looking for a module.
Since you appear to be talking of equipment that is powered by being "on track" the battery thing may be the best bet. Moreover if you switch to current drive you may be able to replace the GOW bulbs with LEDs.
Use a buck-boost converter. LEDs will still require a forward voltage across them of at least 1.7V. White and Blue LEDs considerably more.
Look on TI or Maxim's website for buck boost converters and see what you can find. The MAX1771 shows a SEPIC converter (which is the same as a buck boost configuration), but only works to 2V. Find a lower voltage chip and there is your answer
Failing that, use a boost converter and switch it out when the input voltage is above the desired output voltage
Coupling the AC (10-20 kHz) to the tracks with a cap (I note the suggestion of a transformer elsewhere in this thread) works fine, and the DC power supply we're using to motor the train does not defeat the AC -- so long as a train is not on the tracks. However, the moment a train is put on the tracks the light goes out -- our AC is apparently defeated.
When we put the AC directly across one of the motors used in the trains, a bulb connected in parallel will light just fine, though.
I'm inferring that something about a DC motor *in operation* presents a very different reactive load, which is defeating our AC completely (the motor may as well be a short).
I'm definitely baffled by this. Any ideas or suggestions?
Gah. Forgot to say that the above symptom is, indeed, on account of trying this while lacking something -- an inductor to separate the DC power supply from the rail (to isolate the AC to the track).
What kind of inductor would be necessary to isolate capacitance in the power supply from the AC we're injecting? Not being an engineer, what's freaking me out here is the complexity of the reactive supercircuit this coupling of AC through a cap and coupling of DC through an inductor are creating, where a motor -- inductive itself -- is consuming the DC (while presenting an open to the AC) and a resistive incandescent is consuming the AC (in series with a cap to present an open to the DC).
I learned about basic reactive circuits back in the day, but this is like some multivariate calculus. I'm definitely out of my comfort zone.
Your inductor must be rated for at least the maximum steady DC current that the DC supply can furnish, because of the possibility of a short across the tracks. The inductor will present inductive reactance of 2*pi*f*L to the AC. Larger L (inductance) gives greater isolation.
The higher the current and the higher the needed inductance, the higher the cost. If the frequency, worst case, is 10kHz, and you use 2 miliHenry inductance, the DC supply could load your AC supply about 13 mA. If you have a 100 mA AC supply and your lamp draws 80 mA, that should work. 20kHz would be better, reducing the load to about 7 mA. And higher inductance would reduce the loading, by increasing isolation.
OK, the plot thickens. Inductors upwards of 2 mH work as you say; however, there's a new problem.
Whenever the motor is powering up to speed (that is, DC is increased to the tracks through the isolation inductor, and the motor's current is increasing), the AC signal we're injecting is attenuated dramatically. Once the motor reaches an RPM proportional to the raised DC level again, the AC signal is not attenuated. If we stall the motor (stop its rotation), we lose the AC again.
We're using a cap to isolate a rectifier on the train engine, which feeds the incandescent light of interest.
We had one "success" that we wouldn't believe until we checked it, and it was a good thing. The inductor we're using for isolating the track power supply from the AC injection point is a common mode toroid. Without thinking much about the common core, in frustration we wired the motor (in the engine) through the other side of the toroid in an attempt to prevent the motor from shunting our AC -- or whatever the heck it's doing. Darned if it didn't work -- any change in DC or motor speed, power, load, etc. resulted in our lamp keeping consistent illumination.
Then we realized the common core was involved, and that's a bit of an issue unless we want the train to have a pair of wires running to the inductor back at the power source, under the layout. ;-)
So then we tried to figure out how we could replicate, reactively, whatever the heck was causing the faux success. So tantalizingly close. Basically, what worked was having the DC opposing on both coils, with the AC all on one side:
Pin 1: Power supply + Pin 2: Injection point of AC to track rail 1 Here's where the track commutes the power to the engine Pin 3: Pick off the AC with a cap and send to rectifier Pin 4: Motor high side, and then ground on track rail 0
...and of course we can't do that, because it's a common core that would need to be in two places. And I can't replicate that on the engine side alone, as far as I can tell.
I reckon I'm presumptuous imagining that anyone in their right mind would take pains to advise me without a schematic for this mess. ;-)
If a summary would help, it's this -- a DC motor (brushes) under load seems to suck AC through it like a vacuum cleaner. Even an inductor in series (a second one, not the one with a common core to the power supply) does not prevent the motor from just sucking the living daylights out of the AC.
This is where I come up short on theory, and I'd be glad of any insights. One additional problem is that the solution should ideally allow for changes to motor power without the light suffering any changes in brightness. I can imagine doing that with a big cap, but darned if our common core gaffe didn't keep the light perfectly consistent. Geez.
Argh. Thought we had it for a bit there. I put another common mode inductor on the ground side of things, and wired the second side of it to the high side of the motor. It worked perfectly. But alas, I then noticed that I'd clipped the AC signal to the ground-side inductor on the opposite side of the DC -- which isn't real because the rail supplies both.
If you put a 2 mH inductor in series with the motor, it will exhibit about 250 ohms impedance at 20 kHz. From what I understand of your description, I think you will need to do something along those lines. Install the inductor on the engine, in series with the motor, to test. You can figure out the mechanical work needed to install it inside, once you have tested and know whether it works or not.
Please post your results - inquiring minds want to know! :-)
OK, here's the upshot after reading the current coming out of the LM386: Whenever we apply DC to the tracks and the motor starts turning, the current draw on the power amplifier at frequency dramatically increases.
This is with an inductor in series with the motor on the engine, supposedly isolating the engine from the AC (the AC goes through a cap to the rectifier).
Even with a large inductor (100 mH or more), this is true.
When I read the motor side of its isolation inductor with a 'scope (thanks, Craigslist!), there's plenty of AC there. What the heck?
Also, when the motor's running the circuit is tuned differently; a higher frequency to the track illuminates the light brighter. With the motor off, a lower frequency is better.
The motor itself is introducing no AC component to the circuit.