# Train motor needs replacing?



## theinteresthunter (Jan 30, 2016)

I'm running a Williams SD45 locomotive and am controlling DC voltage to the track via Arduino on a point-to-point setup.

The resolution of the train speed seems low. I have to give it about 170pwm in order to get it moving. It's only pulling 4 cars. I understand coal can be heavy, but it's fake coal in the cars.
Every once in awhile it gets stuck even when going from a stop and accelerating to the max 255pwm.

I think it's the front motor. The back motor seems like she's ready to go and is just waiting for the front motor. I took the top off the locomotive and when I "help along" the front motor by gently spinning the top black disk of the front motor, it begins to go.

Other notes:
1. I bought this locomotive in used condition and do not know it's history other than it was sold to me in working order.
2. I look at the voltmeter and it's at about 5-6v when it starts to move.
3. I was hoping to have a higher resolution where the engine would start moving at 75pwm and really go slow.
4. And it seems to favor going forward vs reverse.
5. When "stuck" and doing the audible electric whine, the light nearest the front motor seems to be brighter than the rear motor.
6. When I flip over the locomotive on my desk and connect power to it, the motors seem to move with little problem. The front one, if I remember, may seem to be less willing to move than the back one.

Any thoughts?

My goal is to have the train go real slow, but right now I have to get the voltage cranked up just to get her to take off.


----------



## Lehigh74 (Sep 25, 2015)

I don't know anything about arduino, but I do know that Williams engines don't go real slow. They typically have jackrabbit starts.


----------



## DonR (Oct 18, 2012)

I have never seen the inside of a William locomotive.

However, I assume that one motor is mounted on or
drives the front truck and the other motor the rear.
That being the case, have you tried cleaning the gear
box of the troubled motor? Often lubes gel over time
and cause undue strain on the motor. 

You might also want to relube both trucks after
cleaning and put a tiny drop of plastic friendly
oil on the motor shafts.

If these suggestions don't help you may want to
disconnect the two motors. Using ONLY DC, not
the arduino, use a multimeter set to amps. One
side of the DC goes to the motor. The other side
goes THROUGH the meter to the motor. Note
the amperage at various voltages of the 'good'
motor. Then do the same with the other and
compare. If you are seeing an increase in the
amp on the 'bad' motor it may, in fact be 
defective.

Don


----------



## Shdwdrgn (Dec 23, 2014)

My own experience put the arduino inside the loco and assumed a constant voltage across the track. That said, my 0-4-0 gets up to about 40 before it starts crawling. (I assume when you said 170, you were talking about the overall pwm value which is between 0-255.)

So this is getting a bit advanced, and I have not done this myself, but I have read that different models of the arduino used different settings for pwm, and in some cases the cycle speed was way too fast to properly run a motor. I can't recall the exact details, but there were two different settings you could use, and the difference between them was something like 1Khz or 100Khz. At the faster cycle, the 'on' time was simply too fast of a pulse to actually get any current to the motor, so they suggested using the slower speeds. Note this is NOT related to the clock speed of the CPU itself, the PWM circuit uses its own clock.

Alternatively if you have a really stubborn motor, you may have to write your own PWM in software. Basically what you would need is a loop that is on for X cycles, and off for Y cycles. Compare this to the normal circuit where X is always 1, and Y is your value between 0-255, only in this case Y would be inverted. The advantage of doing it yourself is in that X cycle -- you could may need to have the current on for 2 cycles to get good response from your motor, or you may need to leave it on for 10 cycles. The point is you can more finely tune the on-off cycles to match your motors.


----------



## theinteresthunter (Jan 30, 2016)

Good ideas everyone. I'm going to try out what you've suggested.


----------



## theinteresthunter (Jan 30, 2016)

So the issue I have found is the rear wheel truck. Very odd: the wheels and gears spin freely, very nicely... and then every once in awhile they'll seize up, and unpredictably so. There is no repeatable timing or direction to recreate the seizing. It does not happen "every 1/8th of a turn", for example. It happens at random times. I cleaned them as best I could, then oiled them, then dried them, blow-torched them, banged them lightly, oiled them... to no avail. They spun even better after all that but the random seizing still existed. So instead of buying a wheel puller to clean the axles, I decided to buy a new set of trucks. I replaced the rear truck and it was like I got a new train, able to operate at lower voltage levels. Works great now!


----------

