I did the first field tests with a HO scale locomotive today with limited success. The locomotive speed was controllable by using PWM but the whine from the motor is not acceptable for operational use.
In 1871 Prussian Field Marshal Helmuth von Moltke the Elder wrote an essay about military strategy. The following is an English translation, "No plan of operations extends with any certainty beyond the first encounter with the main enemy forces. Only the layman believes that in the course of a campaign he sees the consistent implementation of an original thought that has been considered in advance in every detail and retained to the end."
It appears I am the layman in Moltke's quote. The motor used for bench testing was not a locomotive motor but rather a 12VDC surplus motor. It did produce a whine during testing but only at a lower speed. I never gave it much thought. The locomotive motor when powered from PWM whines at all speeds. In addition, the maximum speed is slower with PWM than with the train power supply. Looking online, there are some examples of PWM producing a whine when used to power a motor.
My first thought was the PWM frequency. Could a higher PWM frequency eliminate the whine?
The default PWM frequency for pin 3 ( pin used for PWM) is 490 Hz. Pin 4 has a default frequency of 980Hz. Using the PWM signal from pin 4 eliminated the whine with a loss of speed control. Using a speed code value of 127 the locomotive didn't move. At a value of 128, the locomotive moved at maximum speed. On the lower PWM frequency, (I can't recall the speed values) there was a greater range of control. I could get a slow speed as well as a top speed but with the whine.
This first contact's poor success has given me cause to make some changes. For any further bench testing, I will be using a locomotive motor and not my bench surplus motor. Initial google search suggests PWM frequency changes from defaults are possible but don't appear to support a frequency between 490Hz and 980Hz. I have yet to garner an understanding of why using the 980Hz frequency results in a loss of speed control.
I thought my plan was sound but it appears to need some tuning. Maybe a different motor driver module is required? Would a filter cap on the module output help? I'm not sure at the moment. I'm open to suggestions as I bandage my wounds and prepare for another attempt.
Top Comments