PWM frequency ?

Drive a 4-wire bipolar stepper motor or a pair of DC motors from your Arduino. [Product page]
Post Reply
kert
Posts: 3
Joined: Sat Oct 12, 2013 5:59 pm

PWM frequency ?

Post by kert » Sat Oct 12, 2013 6:09 pm

Hi,

Whats a reasonable peak PWM frequency that A495x can be driven at ? Hopefully i should be able to switch it above 20Khz without too many problems ?

Obviously the switching losses will be higher with higher frequency. Unfortunately the datasheet doesnt even mention typical values at say 500hz, 1khz, 10khz.

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: PWM frequency ?

Post by andrew » Sun Oct 13, 2013 1:03 am

kert wrote:Hi,

Whats a reasonable peak PWM frequency that A495x can be driven at ? Hopefully i should be able to switch it above 20Khz without too many problems ?

Obviously the switching losses will be higher with higher frequency. Unfortunately the datasheet doesnt even mention typical values at say 500hz, 1khz, 10khz.
The data sheet is a bit thin on that topic, the only hint it gives is that the it's <30 kHz when referring to load supply current.

kert
Posts: 3
Joined: Sat Oct 12, 2013 5:59 pm

Re: PWM frequency ?

Post by kert » Mon Oct 14, 2013 7:07 am

So can the shield be safely driven at 20khz ?

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: PWM frequency ?

Post by andrew » Mon Oct 14, 2013 9:41 pm

kert wrote:So can the shield be safely driven at 20khz ?
We don't see any reason why not. If you want to supply your sketch we can test it for you on our gear first.

kert
Posts: 3
Joined: Sat Oct 12, 2013 5:59 pm

Re: PWM frequency ?

Post by kert » Sun Nov 03, 2013 5:20 pm

I'll be trying it out today, will update on results here.

Couple other small EE questions on the shield
- the A4954 inputs are driven by 7408 gate, any particular reason why it couldnt be driven MCU outputs directly ?
- it bugs me not to know - i have seen a few circuits with a nF cap (C4) across the LEDs, what does it really do ?

EDIT: Tested with 62khz, works just fine. As i was doing this on Atmega ADK, just do this in setup()
int divider = 0x01;
TCCR3B = TCCR3B & 0b11111000 | divider;
TCCR4B = TCCR4B & 0b11111000 | divider;

As per http://playground.arduino.cc/Main/TimerPWMCheatsheet

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: PWM frequency ?

Post by andrew » Mon Nov 04, 2013 10:02 pm

kert wrote:I'll be trying it out today, will update on results here.

Couple other small EE questions on the shield
- the A4954 inputs are driven by 7408 gate, any particular reason why it couldnt be driven MCU outputs directly ?
- it bugs me not to know - i have seen a few circuits with a nF cap (C4) across the LEDs, what does it really do ?

EDIT: Tested with 62khz, works just fine. As i was doing this on Atmega ADK, just do this in setup()
int divider = 0x01;
TCCR3B = TCCR3B & 0b11111000 | divider;
TCCR4B = TCCR4B & 0b11111000 | divider;

As per http://playground.arduino.cc/Main/TimerPWMCheatsheet
Nice one. The capacitor is for decoupling.
Using the AND gates (74HC08) allows speed control via one PWM output per DC motor. So when the PWM signal is HIGH, the logic input to the A4954 also goes HIGH. Without the AND gates there wouldn't be any speed control unless both logic inputs were from a PWM output on the MCU. This method saves PWM outputs, only need one per DC motor instead of two.

Post Reply