Go Down

Topic: Arduino 48V PWM Motor Speed Controller Questions (Read 4387 times) previous topic - next topic

MarkT

Humming is the PWM.  What PWM frequency are you using?  Do you want it to be ultrasonic
so its inadible?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

jessey

#16
Feb 23, 2016, 02:19 am Last Edit: Feb 23, 2016, 02:39 am by jessey Reason: schematics change
Hi MarkT,

Thanks for getting back to me. The frequency I'm using on pin 9 of my ATmega2560 is the default frequency which is 490 Hz. I did some searching and found this thread which sounds good if I am understanding it correctly.  

This URL is where I found the information below: http://forum.arduino.cc/index.php?topic=72092.0

According to what I read the PWM default frequency for the ATmega2560 is 490 Hz for all pins, with the exception of pins 13 and 4 which is 980 Hz.

According to valerio_sperati, I can change the prescaller for pins 10 and 9 to change to the different frequencies that are available. First I have to clear the 3 bits in the prescaller using:

int myEraser = 7;          
TCCR2B &= ~myEraser;  

now that the prescaller is cleared I can include these two lines of code below to write a new value:


int myPrescaler = 3;  // 3 = 490 Hz (default value)
TCCR2B |= myPrescaler;

changing myPrescaler value above from 1 to 6 will change the frequencies to the ones listed below:

prescaler = 1 ---> PWM frequency is 31000 Hz
prescaler = 2 ---> PWM frequency is 4000 Hz
prescaler = 3 ---> PWM frequency is 490 Hz (default value)
prescaler = 4 ---> PWM frequency is 120 Hz
prescaler = 5 ---> PWM frequency is 30 Hz
prescaler = 6 ---> PWM frequency is <20 Hz

So am I correct in thinking that all I have to do is put these 4 lines of code above into the void setup() portion of my sketch and set to whatever frequency I want to try? I'm at home today but will be going to the shop tomorrow to try this new code. I should try it as you suggested at 31000 Hz which would be an ultrasonic frequency and above the frequency humans hear at and hopefully that'll fix my noise problem. Any insights you have on this subject will be very appreciated especially to hear that I got the code deciphered right.

Also could you have a quick look at the schematics I just uploaded here to see what you think. If you have the time I'd really appreciate it if you could advise me of what optoisolator you would consider to be compatible to isolate the mosfet in the schematics? You had advised me in a previous post that I quoted below:

-48V is 48 volts below ground.  You meant 0V, GND or 48V(-)

You can get opto-isolated gate drivers, standard opto-isolators may be too slow and weedy to switch
a MOSFET gate for high power use (the switch off time is dominated by the photo-transistor
charge-storage delay).  Are you wanting PWM or just on/off?

How much power are you controlling BTW?   In particular can vast currents flow in stall conditions
and risk popping the MOSFET?  In those circumstances you would want more protection circuitry
(probably a gate driver chip with resitor/zener clamp on its logic input, or opto-isolated)
In that Post you suggested that I possibly needed a gate driver chip with resistor/zener clamp on its logic input, or opto-isolated. I managed to find a fairly inexpensive MOSFET gate drive optocoupler part #IX3180 and digikey has some in stock and they are fairly inexpensive. There are a lot of these opto isolators with specs I don't understand out there and I'd really appreciate it if you could recommend a chip if this one I found isn't suitable.


Thanks
jessey

JohnLincoln

#17
Feb 23, 2016, 07:02 am Last Edit: Feb 23, 2016, 07:37 am by JohnLincoln
You might find that your MOSFET will get hot if you if you increase the frequency to 31kHz.


When a MOSFET is turned hard on, it doesn't dissipate much power.  (low voltage x high current).
When it is off, it doesn't dissipate much power either.  (high voltage x low current).


However as the MOSFET switches between these two states, it goes through a high power state.  (high voltage x high current).


Increasing the frequency causes the MOSFET the heat up more as it spends more time in this high dissipation state, hence the average dissipation increases.


You can overcome this by using a MOSFET driver such as Microchip's TC4422A.  (Datasheet here.)


There is lots of useful information in this application note.

jessey

#18
Feb 23, 2016, 10:37 am Last Edit: Feb 23, 2016, 11:23 am by jessey Reason: reload schematics
Thanks JohnLincoln,

I really appreciate your help with this. I re-did my schematics again to show the mosfet driver wiring I added. I wasn't sure how to properly wire in the mosfet driver IC but I took a stab at it anyway using the data sheet schematics as a reference. If you could have a look to see what has to be changed in my schematics it would be very much appreciated.

Do you think I should have an optoisolator to feed the 2n3904 transistor as well? I couldn't find a 5 volt relay with a suitable amp rating but I did have a couple of 12 volt ones with hefty points laying around so I used one.

Thanks Again
jessey

kmimax

I have the same problem. If you use jessey's circuit, then the advice in front of MARKT is valid. That is, when the TC4422 is used between the MOSFET and the computer input, can a device such as a 150 ohm resistor be useful for the MOSFET? Is jessey's circuit fully implemented without problems?

kmimax

-48V is 48 volts below ground.  You meant 0V, GND or 48V(-)

You can get opto-isolated gate drivers, standard opto-isolators may be too slow and weedy to switch
a MOSFET gate for high power use (the switch off time is dominated by the photo-transistor
charge-storage delay).  Are you wanting PWM or just on/off?

How much power are you controlling BTW?   In particular can vast currents flow in stall conditions
and risk popping the MOSFET?  In those circumstances you would want more protection circuitry
(probably a gate driver chip with resitor/zener clamp on its logic input, or opto-isolated)


Hello Again MarkT,Could you recommend a circuit?

Go Up