forward/reverse L293D andPWM

Asimov

Member
Just trying to make sense of a post from 2008 regarding the use of a L293D with one motor attached and one PWM out from a 08M2.

From page 13 of the interfacing circuit manual, if I connect 08M2 pins to inp1 and inp2 and also the relevant PWM pin to inp1 of the L293D, by alternating high/low on inp1 and inp2 respectively, and applying PWM to inp1 only, can I control forward and reverse in this way?
 

Technical

Technical Support
Staff member
Yes, you can do speed/direction in two different ways:

1) requires 2 picaxe outputs - one L293D input pin high/low and the other input pin pulsing, L293D enable pin tied high
2) requires 3 picaxe outputs - two L293D input pins high/low, enable pin pulsing

The advantage of 2) is that the speed and direction functions are separated onto different PICAXE outputs.
 

Asimov

Member
Many thanks for the reply.

Just for clarity, the direction is determined by alternating input pins 1 and 2 between high and low, and the speed by varying the duty cycle on pin 1(5v supply)?

I've just had a look at the L293D data sheet and it mentions that it is suitable for switching applications at frequencies 5kHz, does that mean the PWM frequency is limited to 5kHz? I was hoping to use 10 plus...
 

westaust55

Moderator
As the L293D Datasheet indicates "suitable for switching application frequencies up to 5kHz" that is the nominal limit.
The internal logic takes a finite time to perform a state change as do the output transistors.
Ton + Toff alone is about 1 usec but add a little more to achieve full level change between high and low.
Then there is the min time for your output pulses.

You could try for higher frequencies as the times in the Datasheet are typical and the manufacturer will be pessimistic to guarantee operation so okay if you do better for personal use but don't try to use it commercially at higher freq with a guarantee.
 

westaust55

Moderator
As the L293D Datasheet indicates "suitable for switching application frequencies up to 5kHz" that is the nominal limit.
The internal logic takes a finite time to perform a state change as do the output transistors.
Ton + Toff alone is about 1 usec but add a little more to achieve full level change between high and low.
Then there is the min time for your output pulses.

You could try for higher frequencies as the times in the Datasheet are typical and the manufacturer will be pessimistic to guarantee operation so okay if you do better for personal use but don't try to use it commercially at higher freq with a guarantee.
 

westaust55

Moderator
As the L293D Datasheet indicates "suitable for switching application frequencies up to 5kHz" that is the nominal limit.
The internal logic takes a finite time to perform a state change as do the output transistors.
Ton + Toff alone is about 1 usec but add a little more to achieve full level change between high and low.
Then there is the min time for your output pulses.

You could try for higher frequencies as the times in the Datasheet are typical and the manufacturer will be pessimistic to guarantee operation so okay if you do better for personal use but don't try to use it commercially at higher freq with a guarantee.
 

inglewoodpete

Senior Member
The reason for keeping the PWM frequency low is that most of the heat in the H-Bridge chip is created during Low-High and High-Low transitions. If you double the PWM frequency then the amount of heat generated by the transitions increase proportionately. The L293D does not have provision for an efficient heatsink, so keeping the PWM frequency down makes sense.

I have only used the L298 H-Bridge (dozens of them in fact), admittedly for larger motors. With a good heatsink attached to the L298, I have used 10kHz PWM without any problems.
 
Top