Jump to content
 

Yet another feedback controller


AndyID
 Share

Recommended Posts

The back EMF generated in the armature of a DC motor is proportional to the motor's speed. If the controller can determine the back EMF it can compensate for changes in load to prevent stalling or maintain almost constant speed by automatically increasing, or decreasing, the motor voltage. Some systems (DCC for example) briefly interrupt the motor current to sense the back EMF but it's also possible to determine the back EMF at a DC controller that's delivering smooth DC to the track.

 

Unfortunately the motor windings have some resistance (known as a motor's "internal resistance") and some of the voltage applied to a motor is "dropped" across this resistance. That results in the back EMF being less than the voltage applied to the motor. As the load on the motor increases the current drawn by the motor increases and the difference between the EMF and the applied voltage also increases which reduces the motor's speed. If the load increases to the point where the motor actually stalls the EMF drops to zero and the applied voltage is all dropped across the motor's internal resistance.

 

It's not difficult to make a DC controller that effectively "cancels out" much of the internal resistance by automatically adding a voltage to the motor supply that is proportional to the current supplied. The snag with this is that the actual compensating voltage has to be scaled depending on the motor's internal resistance and as we usually have lots of different types of motors with different internal resistances some sort of adjustment is required. I've done this in the past with a simple potentiometer but that's far from ideal.

 

These days an inexpensive micro-controller could be substituted for most of the analogue parts of the controller and it can easily measure a motor's internal resistance. As the operator moves the controller knob from zero and before the motor starts producing back EMF by rotating the micro-controller measures the current and voltage to determine the motor's internal resistance. Thereafter it takes that value into account as it compensates for variations in motor load until the controller is again returned to OFF. The micro-controller makes a new resistance measurement every time a train is started,

 

 

Link to post
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

The ATtiny44a does not have multiplication hardware, and software multiplication is a bit slow, so I've created a spreadsheet of lookup values for voltage compensation (attached). I drew the line at 5 volts maximum. These are tentative values that may have to be shifted a bit to match actual motor characteristics. They will also have to be converted into binary representations of the number of extra clock cycles required to drive the PWM voltage from the controller. The binary values will eventually be stored in flash memory.

FFctrl1.xlsx

Link to post
Share on other sites

8 hours ago, jamie92208 said:

Sounds an interesting topic Andy.  I run locos with all sorts of different motors.   What sort of currents would this deal with, I would be looking for about 3 amps.

 

Jamie

 

Hi Jamie,

 

There's no particular limit to the current that this method can deliver. The lookup table might have to be larger to support a wider range of motors but that's about it. Obviously the controller's output stage will have to be designed to deal with the maximum current.

 

What sort of resistance values do you measure between your loco's wheels? Are the motors all 12 volt max?

 

BTW the compensation method relies on low track resistance between the controller and the loco. Nickel silver rail has quite a bit of resistance so long runs might need droppers to copper power feeds and returns, but that's good practice even without compensation.

 

Andy

Link to post
Share on other sites

  • RMweb Premium

I'd have to do some measuring Andy.   I think that most of them are less than 1 ohm.   I do use droppers to every separate piece of rail as the layout is 12m by 6m so some of the copper wires feeding sections are quite long.   Quite a few of the motors are maxxon or escap coreless ones and a lot are Mashima 1833's  and I haven't a clue what the ex lima 4F' are.  I've even got some US outline stuff with big Pitmanns.   I'll have to do a survey.

 

Jamie

Link to post
Share on other sites

I think they should have a bit more resistance than that. The data I have on the Anchorage 1833 says the stall current is 1.56 A at (presumably) 12 volts. That would mean the internal resistance is 7.7 ohms which seems about right for a chunky 0 gauge motor.

 

The actual resistance measurement will vary slightly depending on the angle of the armature relative to the brushes but that's nothing to worry about. The compensation does not attempt to cancel all the internal resistance. It just cancels about 80% of it, so a motor will still slow down slightly under load. If we get greedy and try to cancel all the internal resistance we can exceed unity gain at which point things can go haywire. A bit like the old positive feedback microphone problem :o

 

As the micro-controller is aware of the current and voltage supplied to the track it can evaluate the "effective resistance" of the load. If that ever drops below the motor's resistance measured when the controller started a train it's safe to assume there is a short-circuit/overload somewhere. The controller will then go into low output mode until the short is removed.

 

Andy

 

 

  • Thanks 1
Link to post
Share on other sites

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
 Share

×
×
  • Create New...