2
\$\begingroup\$

I connected STM32 F334R8 microcontroller to L298 H-bridge. I made some measurements. The problem is output signal on L298 has quite slow slopes and is not as sharp as input signal. I do not understand why the distortion occurs. As you can see the frequency is very low - only 10 Hz.

  • Pink color = L298 output signal,

  • Yellow color = L298's Enable pin (STM32's PWM output),

  • Green color = L298's Input 1 (STM32's output),

  • Blue color = L298's Input 2 (STM32's output),

Input 1 and Input 2 determine direction of output current.

Oscilloscope measurements low freq

Also when we increase the frequency of PWM to 25 kHz and change duty cycle dynamically to achieve stepped sinusoidal signal, then output not always follows the input: Oscilloscope measurements high freq

Not sure are the distortions showed on 1 and 2 related.

Note 1: Oscilloscope waveform acquire is in Hi-Res to average signals.

Note 2: On PWM output (yellow) I am generating abs(stepped_sin(x)). Then to make stepped_sin() on the L298 output I am changing Input 1 and Input 2 (just inverting current direction).

I'm just curious what's the reason of such strange behavior.

L298 logic supply voltage is 5 V, power supply voltage is 8 V. Output load is 4Ω power resistor.

I have already checked L298 datasheet and typical PWM switching frequency is 25 kHz. Also input's logical high starts with 2.3 V. My microcontroller uses 3.3 V logic so it should be sufficient, isn't it?

\$\endgroup\$
6
  • \$\begingroup\$ Why do you fiddle with the enable pin during normal operation? \$\endgroup\$ Commented Jan 20, 2018 at 14:59
  • \$\begingroup\$ Because enable pin usually used for PWM, what is wrong with it? \$\endgroup\$
    – Madras
    Commented Jan 20, 2018 at 15:15
  • \$\begingroup\$ Do you have low ESR Cap across IC? Since the ESR of each driver is close to 1 Ohm and the total drop is >3V @ 1A and >4V @ 2A the L298 is not a good candidate at low supply voltage<12V A better candidate is a MOSFET bridge \$\endgroup\$ Commented Jan 20, 2018 at 16:06
  • \$\begingroup\$ The L298 is a horrible, antiquated, lossy part. If you want firm drive use an FET solution. \$\endgroup\$ Commented Jan 20, 2018 at 17:05
  • \$\begingroup\$ Why do you have channel 4 (pink) on 50 ohms mode? \$\endgroup\$
    – τεκ
    Commented Jan 27, 2018 at 17:46

0

Browse other questions tagged or ask your own question.