Skip to main content

Or you can estimate motor Kv from datasheet - many suppliers even publish the nominal value.  There are many variants of the RS-365.  For example:

motor backemf from datasheet 

I assume this is an O-gauge engine motor application.  There are several issues to address with the external resistor sensing method.  With AC track voltage, the DC source voltage will not be stable like from a battery - or maybe you're talking about battery operation(?).   The rectified motor source voltage will fluctuate several volts in sync with 60 Hz.  The common use of hi-frequency (kilohertz) PWM pulsed motor drive can also confound voltage measurements.  So I suppose you could make a differential voltage measurement across your sense resistor - but that has issues of its own.  Then there is the fact that with a DC can motor like the RS-365, the back-emf voltage itself fluctuates as the motor commutates between the windings/poles - typically 3 or 5 per revolution.  So the measured back-emf voltage also fluctuates like a rectified sine wave but proportional to RPM rather than 60 Hz.  And so on.  All of these issues are well documented in DIY electronics forums. 

But to the original topic, I don't think it's practical to use the back-emf speed sensing method to achieve the level of accuracy/precision/repeatability required for DCS applications in general or to MUs specifically.  Yes, the HO/DCC guys have all kinds of programming methods to trim/calibrate back-emf engines for mix-and-match MU operation...though it tends to be a your-mileage-may-vary especially when Mu'ing different engine types.

 

Attachments

Images (1)
  • motor backemf from datasheet

This possibly should be a new thread if progress is made which happening very slowly. The funny thing about those mabuchi data sheets and the motors is its sticker appears to me to not completely identify it.  It's possible although this also seems unlikely they are custom variations. So I tried to test it myself with some ok results I think.  This all just for fun anyway. I haven't decide yet on using a tach input or not.  I may build one. There's also quite few motor controllers I can just buy and seems as though they could work... but what fun is that?

Here is a simple motor and circuit board stress test, where you can predict if damage may result, when lashing certain engines in an MU lash-up.  In addition to comparing speed differences while running the engines close together (without them being connected), is to make a record of the amps being drawn to the layout, while the engines are following each other around the track. Pay close attention to the reading you get when none of the engines are in a curve. Now create your multiple unit lash-up and run them again while paying close attention to the amp draw when none of the engines are in a curve. If there is a dramatic increase in draw, the engines will be telling you, "hay man, were not very happy working together and one of us is going to get hurt".  Any additional amps are a strain to the system as a whole and will be converted into heat. We all know heat is not good for motors or electronics. How much is too much will be a gamble and up to the engines to decide how much they can handle. I personally don't like to see more then a few milliamps.

stan2004 posted:

The common use of hi-frequency (kilohertz) PWM pulsed motor drive can also confound voltage measurements. 

Correct.  Most inexpensive microcontrollers have ADC's that are going to really limit the frequency of the PWM signal.  Something like an arduino (ATMEGA328 chip) is going to struggle to get a good reading above 9khz with standard program code. The max sample rate at max resolution (which we would need in this case)  is 15,000 samples per second, which would require ADC interrupt coding  in lieu of the simple analogRead() statement. 

While reading the back-emf has a certain "cool factor" to it, I dont think there's anyway to get two or more loco's synced to speed using this method. One might get somewhat "close enough" by adding a fudge factor to the ADC value of each microcontroller in each loco, but if we are willing to go thru the process of fudging each microcontroller, then reading a tach-tape, instead of back-emf, would get us as close to spot-on in each loco as possible. 

I have a chip for the adc, I can't remember which one but I think it samples much higher.  [Looked it up. A micro chip mcp 3008 or maybe its 3004  ] But I'm just experimenting and don't know what I'm talking about as far as this hw stuff goes... I'm learning... Slowly.

However I agree bemf seems like a problem for engines running in a synchronized way vs other control systems that use some kind of tach... But even there accuracy may very due to various factors....

Just thinking about it.

Last edited by Severn
Severn posted:

I have a chip for the adc, I can't remember which one but I think it samples much higher.  [Looked it up. A micro chip mcp 3008 or maybe its 3004  ] But I'm just experimenting and don't know what I'm talking about as far as this hw stuff goes... I'm learning... Slowly.

Yea, thats a much better chip to use.  Both of those chips have a max sample rate of 200K samples per second. 

This weekend I'm going to wire up a couple of arduinos to a dc motor and pulse it just to see the back-emf results from the adc, and to see how the results vary between two different arduinos. 

 

I'm actually using some motor boards from pololu and a raspberry pi. Which I recognize as (very surely) inappropriate for the pulse brake/coast bemf approach I've seen described many times  But my real problem is failing to design a proper circuit to get the bemf voltage itself and make that into rpm.  So I've simplified and backtracked and cut all that out to get some understanding and simple starting point kind of place. Maybe I'm there.  Btw it's very easy to get the motors to go with the pi and the board. I could I think tape them to a shell less engine... less it's innards but the motors and could make it go around the track but that's not quite what I want to do.

I've been primarily using application notes from precision micro drives website in this topic area. But I only understand half of it half the time, and its not always the same half.

Haven't been on the forum in a while, Life and what-not in the way, but seeing this pop up in my email, I thought I'd return to share some thoughts.  

For the level of accuracy needed for a model train engine, very low sample rates work just fine.  In the cruise I used for my LionChief cruise project, I sampled the speed only once every 20 milliseconds (50 times per second).  This worked out just fine for the most part.  the real limiting factor was the voltage of the BEMF at slow speeds being too low for a usable reading and the resolution of the Arduino's ADC being too low.  if I ever return to this project, I'd like to use a second analog input to read lower voltages.  

The main thing isn't really how often you can read the BEMF, but how soon you read it after cutting power to the motor, or even just reading it a consistent amount of time after removing supply voltage.  The simple Arduino controlled BEMF cruise I made kept a pretty solid speed over long test times.  Tuning the PID had a much greater effect than anything with reading BEMF.  

Severn posted:

However I agree bemf seems like a problem for engines running in a synchronized way vs other control systems that use some kind of tach... But even there accuracy may very due to various factors....

There shouldn't really be any difference between the reading from a tach strip or BEMF, so long as the ADC has enough resolution to read a difference in speeds and the drive train is directly geared to the motor. (a turn of the motor always moved the wheels the same distance.) The BEMF voltage is consistent.  it will always be the same on a given motor at a given speed, though manufacturing differences mean that it is not necessarily the same for two motors of the same model.  If we make an example locomotive that can move from 0 SMPH to 100 SMPH the Arduino's built in, 10 bit ADC could only give a resolution of about 0.1 MPH.  The ADC can't tell the difference between 25.51 and 25.6 MPH.  This is plenty good enough for my needs for an upgrade for a polar express Lion Chief engine, however if you want it better it's not hard or expensive.  a 16 bit ADC module for an Arduino costs about $2 and would increase the resolution significantly, fro 1024 steps to 65,536 steps, or from .1MPH to .0015 MPH.  If you're looking for a really accurate speed control, that will do the job pretty well.  With that level of accuracy an O gauge engine will be +/- 2 inches after an hour of running... Wheel slip and curves are likely to be a bigger factor than the BEMF at that point.  

Arduino ProMini running BEMF Cruise:  

JGL

Add Reply

Post
The DCS Forum is sponsored by

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×