PWM Motor Ringing??

Ok,

So I have a 90v DC motor.....

I have a 90v 1A power supply.

I have an N-channel mosfet connected to the ground to turn the motor on and off.

I have a resistor between the gate and the source to pull the gate low. (If I left it floating, the mosfet was on as it felt like it)

All of this is working correctly, I can speed the motor up and down based on pwm setting.

Unfortunately, there an extremely loud and annoying ringing from the motor?

What is causing this? And how can I make it stop. grins

Thanks for any help.
-Deviant

I think that is Harmonic related...

is there anyone on the forum with experience on building "Harmonic Trap Filters"?

:wink:

It's most likely a interaction of the inductance value of the motor winding and the basic PWM switching frequency being used by the PWM analogwrite function. There have been posts around here on how to change the PWM switching frequency by using different values in the timer registers.

So you might experiment with raising the PWM switching frequency to see if you can improve on the situation.

Here is one thread that might help get you started:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235060559

Lefty

And how can I make it stop.

This is an Arduino forum. So the real question is, "And how can I make it play a tune?" :slight_smile: :slight_smile:

If it was my motor, the question would be how to connect it to the adeath spewing robot of doom.

Unfortunately, it's connected to my wifes sewing machine. So she says it needs to be quiet and well behaved.

So now the question, if it's a matter of frequency. Is there some mystical number/setting that I'm suspose to use.

I have it plugged into pin 6 for pwm and everything else is stock settings.

Thanks.

Is there some mystical number/setting that I'm suspose to use.

Yes just follow the link retrolefty posted:-
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235060559

reply 4 has them.

This is an Arduino forum. So the real question is, "And how can I make it play a tune?" Smiley Smiley

hahahahaha thats so true!

Now my question is.

The post states that other items in the micro will be effected by changing the frequency.

Is there a pin that is better than others for this change. I.e. if I make pin 6 match x setting. Will it have less effect on the overall chip than pin 3...

Also, for the ultimate code. I am currently using the mstimer2 hex file for a more exact interupt based delay.

What kind of havok am I looking at causing. When I make these changes.

Thanks.

What kind of havok am I looking at causing. When I make these changes.

Well why don't you just try a quick test with your changing as see if it solves the motor ringing problem? If it helps then you can move on with integration.

Lets us know one way or another about the ringing.

Lefty

using Pin9 for pwm

I made the following change.

TCCR1B = TCCR1B & 0b11111000 | 0x01;

At the initial look, there doesn't appear to be any ringing.

I'm going to use a slower increment pwm loot to see if anything rings along the way.

So now the question is. What all does that change effect?

Thanks.

What all does that change effect?

Modifying timer 1 should, I think, only effect analogwrite and servo commands that utilize timer 1, pins 9 and 10. I don't think it effects any other Arduino core software like millis() as they stick to using timer 0. However any user contributed software library you might use would have to be checked out to see if it utilizes timer 1.

Perhaps more knowledgeable software gurus around here can verify that?

Lefty

http://www.arduino.cc/playground/Main/MsTimer2

My current code is making use of the mstimer2 for it's timeslicing.

i.e. look at this for a little bit, then switch to this...

I'm sorry, but when it gets into the weeds. I don't know how all of this really works. Random hex numbers/settings was never my forte'

The mstimer2 function is utilizing timer 2, so should not be effected by your changing things on timer 1.

Lefty

I hope your right, cause that would be great.

One less worry to deal with.

mumbles