Building a layout from scratch

Ezequiel Sep 6, 2020

  1. logging loco

    logging loco TrainBoard Member

    467
    576
    18
    I recently had the same issue with one of my No.4 turnouts. I think it is an older one produced in the late 90's.
    IIRC the physical screw positions were the same, but the labeling was opposite.
    The frog on the same turnout was low at one end. The difference in height between the frog and rail was enough to stop a locomotive at switching speeds.
     
    sams likes this.
  2. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    I had an awful realization today... I believe I should be using PWM for speed control instead of DC voltage regulation.
    I had asked for input in the electronics forum. But I'm fairly sure I will have to redo all my electronics.

    This would take the project a step back, but I was already thinking on using Arduino to control everything else (turnouts, scenery lights, anything else that may come later), so I don't think it would matter if I throw speed and direction control in there too.
     
    sams likes this.
  3. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    Well, I'm definitely going for PWM to control the speed of the train. I've been doing some reading and that's definitely the right way to go. I still don't know how I missed this when I started the project.
    The prototype I've already made will serve as a good variable power supply for all my electronic projects, which is something I should have done ages ago so it's not wasted time at all.
    I already ordered all the components I think I need for the new circuit. Some of the programming is already taking shape in my head, so the trains will be protected against sudden speed/direction changes, and there will be some level of intellingence in the crossover for switching from one line to the other, so that it does not allow different settings when the crossover is thrown.
     
    sams likes this.
  4. S t e f a n

    S t e f a n TrainBoard Member

    165
    77
    4
    Ezequiel, since you are already thinking about Arduinos, and about doing your own pulse width modulation modules, why don't you have a look at the DCC++EX code and see whether it can be modified for PWM? That way you could use JMRI for throttle attachment, and standard Arduinos+motor shield for the PWM power.
     
    sams likes this.
  5. Massey

    Massey TrainBoard Member

    828
    1,526
    25

    The only issue with this is PWM is really hard and most of the time fatal to coreless motors. Unless the circuitry that manages the motor is designed for PWM you will fry it. Larger DCC ready locos should be fine, as the decoders are PWM but things like the Kato Unitram and Centram models will not be happy. Just a heads up on that.
     
    sams and S t e f a n like this.
  6. NtheBasement

    NtheBasement TrainBoard Member

    246
    189
    14
    Not that I did it very often, but back when I had a DC transformer throwing the direction switch while an engine (Kato or Atlas) was speeding didn't cause any problems.

    Not sure if you need something in the meantime to run your trains. Simplest and cheapest thing to do just is get used DC transformer. I still use mine as a power supply when messing with circuits.
     
    sams likes this.
  7. S t e f a n

    S t e f a n TrainBoard Member

    165
    77
    4
    But there are decoders using PWM frequencies suitable for coreless motors, aren't there? So it should be possible to build a PWM DC controller that doesn't fry the motor.
    https://dccwiki.com/Coreless_Motor
     
    Last edited: Oct 8, 2020
    sams likes this.
  8. Massey

    Massey TrainBoard Member

    828
    1,526
    25

    While you may get away with this for a while I’m afraid unless your circuit is really precise and keeps a high frequency you will be eating motors. I would imagine a good quality transformer with quality rectifier and regulator would not only be simpler but also provide the resolution you want with the safety for any type of motor.
     
    sams likes this.
  9. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    If I understand correctly, DCC++EX is for running DCC trains. I am using DC for now.
    I just prototyped a controller using an Arduino and a motor shield and it works fine. Although it does make an audible noise specially when running at slow speeds. From what I understand, this is due to the Arduino using 490Hz for PWM which is well within the audible range.

    This is what I'm really worried about. But I'd like to stay with PWM if possible.

    Advantages:
    - Much better performance at low speeds.
    - No heat dissipation necessary.
    - Easy to implement with Arduino.

    Disadvantages:
    - Audible noise when using Arduino built in frequency.
    - Motor will burn if it is coreless.

    So... Can I find out if my train has a coreless motor without dissasembling it completely? It is a Kato 10-397.

    I measured the current of the circuit when driving with PWM and I never saw values above the rated current (rated current is 0.42A, and measured current never exceeded 0.15A). But since I have a regular tester and not an oscilloscope, there could be some peak currents I'm not detecting...

    Any advice? I feel stuck.
     
    sams likes this.
  10. S t e f a n

    S t e f a n TrainBoard Member

    165
    77
    4
    I'm not sure there is an easy way to measure motor inductance without a signal generator and and oscilloscope.
    If you can rotate the motor by hand, and feel cogging (fluctuating resistance), then that could be an indication that it has a core (is not coreless).

    But I think it makes a lot more sense to simply not use PWM with a frequency below 20 kHz. The Arduino can generate the DCC PWM signals (of 5 - 8 KHz equivalent frequency, 58 and >100 microsecond duration for 1s and 0s, respectively), so it should be able to generate a reasonably fast non-DCC PWM signal as well.
     
    sams likes this.
  11. Massey

    Massey TrainBoard Member

    828
    1,526
    25
    If you look up the specs on the device or call Kato you will be able to find out. The specs usually will say 5 pole skew wound motor or coreless when they describe the mechanics of the train.

    Kato's DC Throttles use a pulsed waveform over a steady DC current but they look more like a sawtooth pattern which a coreless motor is happy with. Those throttles also work very well at slow speeds.
     
    sams likes this.
  12. BigJake

    BigJake TrainBoard Member

    305
    226
    10
    Why not just put an LC filter on the PWM and call it good? It's not like you need to get rid of the AC completely, just knock most of it down. What's left of the PWM will work better at very low speeds anyway.
     
    sams and S t e f a n like this.
  13. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    Well, I did a quick investigation and I could change the frequency of the Arduino PWM to 31KHz. So I got rid of the noise.
    So the only concern I still have is finding out if I will burn it by running it with PWM.

    The instructions state the following:
    運転はDC(直流)12V以下で行ってください。なお、AC(交流)を走行用には絶対に使用しないでください。
    Which google translates to:
    "Operate at DC (direct current) 12V or less. Never use AC (alternating current) for driving."

    AFAIK, from an electrical point of view, PWM is not AC. But it does not say it is safe to use PWM either, so... I might just have to open it and see if it is a coreless motor or not.
    However, as I have zero experience, I'm scared of opening it and breaking something or not being able to put it back together.

    That sounds like a PWM signal with an RC filter.
     
    sams likes this.
  14. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    Exactly my thoughts. It seems you replied while I was still editing my previous response.
    Thanks!
     
    sams likes this.
  15. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    Well, I finally built up the courage to open up the locomotive and I'm glad to find that it does not have a coreless motor. So PWM with Arduino it is...
    [​IMG]
    [​IMG]
     
    sams, MK and S t e f a n like this.
  16. Massey

    Massey TrainBoard Member

    828
    1,526
    25
    Looks just like my Orange TGV, 3 pole motor and no flywheels.
     
    sams likes this.
  17. BigJake

    BigJake TrainBoard Member

    305
    226
    10
    A sawtooth output is indicative of the analog approach to generating PWM. A ramp generator (often a fixed current signal charging a capacitor) is reset by a comparator that compares the ramp's output to a control voltage (likely from a potentiometer, i.e. the throttle control.) Every time the ramp generator is reset, it starts over, ramping up until it is reset again.

    When the sawtooth is riding on a (usually bigger) DC voltage level, it is likely generated by a variable output, Switch-Mode Power Supply, with just enough filtering to do the job for driving a motor (i.e. not very much). Ramp generated PWM circuits are integral to most analog SMPS control schemes.

    Motors are not very picky about AC riding on top of their DC supply, and like I said earlier, they actually respond better to low DC voltages if there is some AC on top (kinda like I respond to a little ice cream on top of a piece of warm pecan pie).
     
    sams and Ezequiel like this.
  18. Ezequiel

    Ezequiel TrainBoard Member

    28
    70
    2
    It's been a couple of weeks since my last update. The project has not advanced as much as I wanted, but it is still moving forward.
    Having figured out how to proceed with the electronics, it was time to start working on something else.

    The entire room where the layout is going to be was a complete mess. So my wife and I took an entire weekend to clean, sort, tidy up and make room so that we can work on the project comfortably.
    We ordered some pieces of wood and foam:
    madera_telgopor.jpeg

    And we made three beautiful pieces of furniture to hold the baseboard:
    mueble1.jpeg

    Ok, objectively speaking, it may not be beautiful, but it is functional and sturdy... and that's beautiful to me :love:

    Now on to the difficult part of the layout, where neither my wife nor I have any experience at all: Creating the terrain. We will start on the left side, where there will be a city, so it will be mostly flat. However, the tracks will be elevated because that is the case of most (if not all) train tracks in Tokyo. We will use a plaster of sorts (don't know the name in English for it) to cover the foam so then we can start drawing placeholders for the tracks and buildings, and then we can paint on it.
    But more to the right, we want to create some soft hills and a more countryside landscape. So we will add some additional layers of foam before we move on.
     
    MK and sams like this.
  19. sams

    sams TrainBoard Member

    145
    230
    7
  20. Massey

    Massey TrainBoard Member

    828
    1,526
    25
    I would lay the tracks and build the scenery around where you want the tracks to be. The main reason is if adjustments need to be made it is much easier to do so before any scenery is built. If you need to "dig" a tunnel for a wire or control rod for a switch, it's much easier than having to ruin a few inches of layout and then try to make it look like nothing happened. Get your risers and contours of the layout in, lay track, get a train and cars out and make sure everything is happy. Once that is done, secure the track, get the wiring in order and then build the scenery. That's how I have been taught and it has worked pretty good.
     
    Onizukachan and sams like this.

Share This Page