Jump to content

Shinkansen DCC Interior lighting with Flicker-Free feature


Costas

Recommended Posts

Hello Melandir,

 

Could you install these between sub-floor parts?

 

Hello E6,

 

In the Shinkansen yes, it's possible to install all the components under floor (not in the motor car ofc), I have already done it with the old system that is the one you can find in the first post of this thread described by Costas

 

But we are bound to tantalum capacitors, electrolytic capacitors are just too big to fit anywere

Link to comment

Yeah this site was the topic of another thread on the forum. It uses a constant current diode that's hard to get outside Japan unfortunately. But very similar idea. here is the old post.

 

http://www.jnsforum.com/community/topic/3812-new-interior-light-design/?hl=%2Bconstant+%2Bcurrent+%2Bdiode&do=findComment&comment=43190

 

Jeff

Edited by cteno4
Link to comment

Yes, both work by setting a fixed current for the leds, so they have constant brightness over a large range of voltages and as a side effect they consume less power when the voltage is high, so a charged capacitor lasts longer. The 'diode' actually contains a transistor and a resistor in a current regulator setup. This is the same what the current reference chip does with an external resistor. The problem, as always is getting the required parts somewhere far from the electronics manufacturing centers of the world.

Link to comment

In Japan they are only 35 cents each, but that goes up fast after you get someone like Nariichi to source it and then two layers of shipping.

 

Jeff

Link to comment

I don't see a current value for that part, only a maximum limiting voltage. For a current limiting diode, the most important part would be the current limit. (the second being the input voltage range and the reverse breakdown voltage)

Edited by kvp
Link to comment

Yes, the only problem is the relatively high minimum voltage. 6V for N scale is way too high as a minimum speed.

 

Imho it would be easier to just use a Constant Lighting PWM controller with a bridge, a cap and simple resistor limited leds. That way the input voltage is always 12V and the filter capacitor can smooth out the PWM signal into a flat voltage. The trick is that during the CL pulse, the current is virtually not limited by the diode or the capacitor, so it gets charged fast by the high inrush current, while the locomotive motor doesn't get enough power to move. Then during the tri state phase, the diode bridge blocks the discharge of the capacitor, so the capacitor acts as a low current source limited by the led resistors.

 

Using a constant current source over a resistor is only better that it uses less current, so the same capacitor can last longer and the fact that it can regulate the brightness over a large voltage range is only a side effect. For a constant current source, the two most important parameters are the current and the operating voltage range. The minimal voltage has to be just above the turn on voltage of the leds and preferably below the starting voltage of the motor, while the top should be way above maximal operating voltage.

Link to comment

It's the real problem, CL powerpacks are expensive, and no one seems to upload their DIY "CL powerpack" circuit in the internet.

 

Btw, does Tomix N1 powerpack use PWM? or just transistor as standard Kato's?

Edited by HantuBlauLOL
Link to comment

Tomix N-1 is just normal variable voltage - not CL.

 
I believe all the CL power packs have CL at the end of the part number:
N-WL10-CL
N-1000-CL
N-1001-CL
N-S2-CL
 
I think also the N-1 was only ever available in 100V versions.  At least, mine's 100V only.
Edited by mrp
Link to comment

 

It's the real problem, CL powerpacks are expensive, and no one seems to upload their DIY "CL powerpack" circuit in the internet.

Afaik i already uploaded mine on at least two forums. Have to check and maybe upload it here too. It's designed for Z scale, but it can run smaller N scale trains as well and needs only an L293D H bridge, a PIC12F510 microcontroller and a 7805 voltage regulator (and some caps and a potmeter). The source is also free for non commercial purposes.

 

But actually any high frequency, high inrush current PWM controller would work...

Link to comment

Like kvp said, it’s quite easy to design your own controller.  To duplicate the signal coming out of the Tomix CL controllers, you just need to produce a 21KHz PWM output.

 
For example, here’s one way to do it using a PIC16F1705 and an off-the-shelf motor driver board.  I guess the problem is that I'm using a PIC microcontroller, so unless you’ve got a PIC programmer and development tools it won’t be of much use.
 
post-2339-0-60611700-1424156670_thumb.png
 
post-2339-0-08003700-1424156666_thumb.jpg
 
 
 
 

simplepwm.pdf

Link to comment

pretty cool, thanks.

 

i mean PWM for motor driver, not CL driver..

 

btw somehow i failed to understand on some things:

 

how to program it?

if needed to connect to my pc, how?

should i connect the pwma, ain1, ain2, stby pins from both components together?

is the s1 a polarity changer?

where to connect the 78L05?

 

my bad, i'm a total noob when comes to chip programming..

Link to comment

pretty cool, thanks.

 

i mean PWM for motor driver, not CL driver..

 

btw somehow i failed to understand on some things:

 

how to program it?

if needed to connect to my pc, how?

should i connect the pwma, ain1, ain2, stby pins from both components together?

is the s1 a polarity changer?

where to connect the 78L05?

 

my bad, i'm a total noob when comes to chip programming..

 

 

 

Well, you mentioned earlier a DIY “CL powerpack” circuit.  That’s what the circuit is.  It will do exactly the same job as a Tomix N-1001-CL.

 
Basically, the Tomix CL powerpack outputs a 12V 21KHz PWM signal with duty cycle from 0% to 100%.  When you want to drive just the CL lights - without the train moving - you adjust the output to about 10% duty cycle.
 
The switch is just forward-off-reverse.  The 78L05 is a voltage regulator that takes the input from a 12VDC adapter and outputs the 5V needed for the logic circuits.  In the circuit diagram, all nets with the same name are connected.
 
Programming the PIC microcontroller is, of course, the problem.  Generally, most DIY circuits you’ll find on the internet these days - or at least, any ones worth building - will use some type of general pupose microcontroller.  I guess it’s just the way things are.  It’s a lot faster and less hassle building something with a $1 microcontroller than using a bunch of discrete components.
 
A lot of people - myself included - design using PIC microcontrollers from Microchip because they are cheap, flexible, easy to purchase and require minimal external components - in the simplest case, basically a single decoupling capacitor.  But to work with them, you need a programmer - such as the PICkit 3 - and development environment and compiler - which Microchip make available as a free download.  There’s more information here:
 
It continually amazes me how much you get in a $1 chip.  The PIC16F1705 gives you 14KB of Flash, 1KB of SRAM, 5 Timers, 2 Comparators, 2 Op Amps, 10-bit ADC, 4 x CCP/PWM, 1 x EUSART (serial), 1 x I2C/SPI.  Unbelievable.  Plus, these newest PICs have something called PPS that allows you to basically route any peripheral to any pin - so you no longer have to spend hours trying to work out how best to lay out other components.  A lot of this wasn’t even available a year ago!
 
I guess this complexity is one of the reasons why DIY electronics is becoming less popular as a hobby.  At the end of the day - if all you’re after is a single CL power pack - then it’s going to be a whole lot easier to buy one from Tomix.
Link to comment

 

I guess this complexity is one of the reasons why DIY electronics is becoming less popular as a hobby. At the end of the day - if all you’re after is a single CL power pack - then it’s going to be a whole lot easier to buy one from Tomix.

Imho it's always easier to buy something ready made. But if you are an engineer or at least have the same knowledge as one, you can make it yourself. There are very few problems in railroad modelling where you can't buy everything off the shelf, but designing it yourself is always more fun, if not really cheaper time/money wise. This is true for home made electronics and home made scenery or rolling stock. You can even go so far as to build your own steam locomotive or wind your own electric motors. Everything can be purchased ready made (even whole layouts), but it's less fun to do that. Designing a working model steam locomotive requires the skills of a mechanical engineer and designing a good PWM CL controller requires the skills of an electrical engineer.

 

Btw: Imho it would be great if someone actually made a breadboard-able CL controller, with instructions for setting it up and how to program it with a pickit or other cheap programmer. (i don't really have the time right now, but it should be great for those who want to build one) Although there is a chance that only those people would understand the instructions who could design and build one themselves.

  • Like 1
Link to comment

 

Well, you mentioned earlier a DIY “CL powerpack” circuit.  That’s what the circuit is.  It will do exactly the same job as a Tomix N-1001-CL.

 
Basically, the Tomix CL powerpack outputs a 12V 21KHz PWM signal with duty cycle from 0% to 100%.  When you want to drive just the CL lights - without the train moving - you adjust the output to about 10% duty cycle.
 
The switch is just forward-off-reverse.  The 78L05 is a voltage regulator that takes the input from a 12VDC adapter and outputs the 5V needed for the logic circuits.  In the circuit diagram, all nets with the same name are connected.
 
ok, understood..
 
Programming the PIC microcontroller is, of course, the problem.  Generally, most DIY circuits you’ll find on the internet these days - or at least, any ones worth building - will use some type of general pupose microcontroller.  I guess it’s just the way things are.  It’s a lot faster and less hassle building something with a $1 microcontroller than using a bunch of discrete components.
 
how to connect it to my PC? after i connect it what should i do?
 
A lot of people - myself included - design using PIC microcontrollers from Microchip because they are cheap, flexible, easy to purchase and require minimal external components - in the simplest case, basically a single decoupling capacitor.  But to work with them, you need a programmer - such as the PICkit 3 - and development environment and compiler - which Microchip make available as a free download.  There’s more information here:
 
It continually amazes me how much you get in a $1 chip.  The PIC16F1705 gives you 14KB of Flash, 1KB of SRAM, 5 Timers, 2 Comparators, 2 Op Amps, 10-bit ADC, 4 x CCP/PWM, 1 x EUSART (serial), 1 x I2C/SPI.  Unbelievable.  Plus, these newest PICs have something called PPS that allows you to basically route any peripheral to any pin - so you no longer have to spend hours trying to work out how best to lay out other components.  A lot of this wasn’t even available a year ago!
 
I guess this complexity is one of the reasons why DIY electronics is becoming less popular as a hobby.  At the end of the day - if all you’re after is a single CL power pack - then it’s going to be a whole lot easier to buy one from Tomix.

 

experience and less money to spend is way better for young guys like me, IMHO

Link to comment

You program a pic microcontroller with a chip programmer circuit. The easiest to get a pickit programmer and create a programming board that connects the programmer with the right pins. The pickits are usb connected. Then remove the freshly programmed controller and place it into the circuit of your own design.

 

Arduinos were created with the aim to be self contained and have the usb, programmer and voltage stabilizer on board and ready to use. It saves a lot of hassle, but cost more.

Link to comment

...

 

how to connect it to my PC? after i connect it what should i do?
...

 

If you are interested in learning about PIC microcontrollers, you could consider the PICkit 3 Starter Kit.

 
It comes with:
- the PICkit 3 Programmer
- a Low Pin Count Demo Board 
- a sample PIC16F1829
- a sample PIC18F14K22
 
The Low Pin Count Demo Board will let you plug in, program and run any 8-pin, 14-pin and 20-pin 8 bit PICs.  In fact, it’s what I used to program the PIC16F1705 when I made the circuit earlier.
 
Microchip also provides a series of Starter Kit lessons (and source code) you can download to introduce you to PIC programming.
 
As kvp pointed out, the Arduino is also a very popular platform - and may even be an easier way to get started - but I’m sorry I’ve never used it myself and don’t know much about it.
Link to comment

Kvp,

 

Yep I would be one of those folks who would love to try and build one from a kit like this! Can't design this level stuff, but can follow the basics of what you and mrp talk about in how these work and I love to fiddle.

 

I wonder if ardunio would be the way to go to simplify things some. As you say adds a little cost but if some at a non EE then it might be more straight forward and also something that the more adventurous could pick at to learn more than with pics! I've looked at playing with pics for a long time, but have never had the time to really think seriously, ardunios I've fiddled with some to do random on/off of building room lights and probably will play with as soon as life gives me more time here...

 

Cheers

 

Jeff

Link to comment

...

But if you are an engineer or at least have the same knowledge as one, you can make it yourself.

...

 

Hi kvp,
 
That’s another thing that’s recently changed for me.
 
Up until about six months ago I used to build everything on veroboard (stripboard), but then I came across Seeed Studio’s Fusion PCB prototyping service.  Basically, you send them a set of Gerber files and $9.90, and 4 days later they send you back 10 pieces of professional double-sided tinned PTH PCBs.  So now I just use that for everything.  Which also means it’s just as easy to use SMD components.
 
For example, I wanted to experiment with the nRF24L01+ for wireless feedback, so I just knocked up a test board:
post-2339-0-11676200-1424280456_thumb.jpg
 
Same with the new TMD2771 proximity sensor chip (which I’m testing in place of Tomix TCS sensors, and which is SMD only):
post-2339-0-55389200-1424280444_thumb.jpg
 
For both of those, I previously would have struggled along with stripboard for countless hours, and ended up with something full of stray capacitance and looking terrible.
 
I think DIY hobby electronics is currently going through some pretty major changes.

 

Link to comment

could i use this as the connector to PC?

 

http://www.instructables.com/id/Simple-JDM-PIC-Programmer/

 

i don't think i can learn much about programming now as i'm also studying to get into an university.

 

Honestly, something like that is more trouble than it’s worth.  It won’t work directly with any of the free Microchip software - you’d need to use a multi-step process to load your hex files.  It won’t support debugging.  And will only program a small range of antique PICs.  Certainly, it won’t work with any PIC that’s been released in the last few years (including the PIC16F1705 I used).

 
You really need to go with a PICkit3 - or a cheap PICkit3 knock-off from AliExpress (although don’t tell Microchip I said that…).
Link to comment

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
×
×
  • Create New...