Go Down

Topic: Smoothing PWM for electromagnet (Read 1 time) previous topic - next topic


What was wrong with the default PWM frequency.
What is so special about this electromagnet that it needs better than 8-bit PWM, and what was wrong with Arduino's default ~500 or ~1000hz PWM frequency.
analogWrite (5, 128); // ~1khz50%PWM on pin5

@Wawa Will the heat at lethal degrees for Mosfet?Are you know a way to make this?
You could be looking at 1watt dissipation in the mosfet and a 60C temp rise above ambient if you don't use a heatsink. Analogue/voltage control is usually a poor solution.
As said, PWM is more effficient. You just need to use the right PWM frequency and resolution.
High frequency and high resolution might not go together though.


High frequency and high resolution might not go together though.
For a really large electromagnet, the limitation begins to be the inter- and intra-winding capacitance.


@Wawa I want bigger aperture to control electromagnets voltage.If i use analog write my aperture is 256.And if i use 250 hz pwm my aperture for voltage control is 4000.At 30 hz its 33333.But you said it is too slow, my limit is 250 hz, and i will do it.

@Wawa and Morgans
I know when i convert pwm to analogue voltage my torque will be reduced and the other loses will rise but i want to learn this.Do you think is 250Hz nice for converting anologue voltage?


By "aperture" you mean "number of steps between 0% and 100%"?

Specialized electromagnetic applications like these guys' ferrofluid don't need more than 256 steps. Think of every beautiful photo or video you have ever seen on your computer monitor: there are only 256 steps of red, blue and green in that image.

250Hz is awful. Even the default Arduino frequency of 480Hz is pretty bad. You should be in the kilo-hertz range for most PWM work.

Yes, if you can find a big analog amplifier then try it. But it will be a lot of work for negative benefit.

Another thing you might try is find out if your lab has an adjustable power supply of the appropriate current and voltage. Expensive ones can be controlled with an Arduino or PC with the right cable adapter.
"The problem is in the code you didn't post."

Go Up