# Finding transfer function of DC motor

I am trying to find the transfer function of a DC motor experimentally using the step response method, for that I am using the following circuit:

Hooking up to Fin a transmissive photosensor that is placed appropriately to do it's job together with a perforated disc connected straight to the motor's axle, thus generating a pulse train with a frequency proportional to the motor's speed to feed the F to V converter. Vout is hooked up to a scope. For the experiment I have a little switch connected to the motor's power cable, so I can start feeding a constant +15V whenever I want to, generating a step for the motor. Now the problem is that when the experiment starts, instead of getting an exponential as the motor speeds up I get this weird kind of pulse:

Adjusting the time scale of the scope to watch this in more detail I get:

Which is really odd, since it shows an overshoot, seems to never reach stationary regime, and decays exponentially all of a sudden, which implies the speed of the motor decays to zero or near zero when I clearly see the motor never slowing down considerably!

Can anyone spot a mistake in my experiment? Is there a reason this happens? Thanks for your help!

You've badly misunderstood the 331. What you are seeing is a single pulse from the current source, rather than a filtered voltage level. The biggest clue is the fact that your pulse is about 100 usec wide. Do you really think a motor shaft will get up to speed in 0.1 msec?

If you look at the data sheet, Figure 19 (which I think you've done to get the circuit), you'll notice that you've omitted a leaky integrator on the voltage output, and replaced it by a simple RC filter. Problem is, a 100 pF cap and a 100k resistor have a time constant of 10 usec, which is roughly what you're seeing on the exponential decay.

So what you need to do is examine your encoder and figure out the frequency you expect to be seeing when the motor is running at its expected speed. You can do this the easy way by applying voltage and looking at the encoder output on your scope.

Then set the RC product of your output filter (R4/C2) at about 1/10 the period of your expected frequency.

With a simple F/V converter like the LM331, you may have a problem making a tradeoff of the output filter, between it being fast enough to accurately show the rise in speed vs. being slow enough to properly filter the current pulses coming out of the converter.

At any rate, your scope should be looking at a time scale on the order of 0.1 to 1 seconds, rather than 0.1 msec. Motors just don't accelerate all that fast.

You should also (unless you're running the motor at really amazing speeds) put as many holes in your encoder disk as possible, so as to get the encoder frequency as high as possible and make your filter's job easier. For instance, if your motor rpm is 1000, and you have 10 holes in your disk, you'll only have an encoder frequency of $$f = \frac{(10\times 1000)}{60} = 167 \text{Hz}$$ and even at maximum speed your update rate for the F/V converter will be about 6 msec for a perfect converter. With an LM331 the effective update rate will be much worse, since the output filter will need to be at least 10 times slower in order to properly smooth the current pulses. This means settling times of the filter on the order of 60 msec.

• Yes, somehow I totally ommited the integrator!Tto get this straight I either need to include the integrator as in the datasheet, or change the filter to an appropriate time constant, or do them both? Oct 22, 2015 at 12:40
• @HCalderon - The integrator will give better results than the filter, so it's recommended, but using just the filter (with the appropriate time constant) is possible. Oct 22, 2015 at 15:40
• I have Opamps lying around so I shall give the Integrator a try, will post results soon-ish, thanks for your help Oct 22, 2015 at 16:53

I did add the integrator as specified in fig. 19 of teh datasheet, then I added an inverter opamp with unity gain, and I was able to perform the eperiment normally.