DC Motors, L298N, 16F877A resets at high currents.

Discussion in 'The Projects Forum' started by NioBium, May 5, 2010.

  1. NioBium

    Thread Starter New Member

    May 5, 2010
    6
    0
    Dear community!

    Please help me as I am stuck in theimplementation phase of my project. I am constructing a moving car, which is moved by means of two dc motors (12 V, 500 rpm). Motors are controlled by a 16F877A PIC. Even though microprocessor and the motor driver IC L298 are fed from different sources the microprocessor resets whenever sufficiently high current is drawn by the motors.

    J20 is on off switch (may be considered permamently closed)
    J18 is a 9V battery
    J19 is a reset switch (may be considered permemently open)
    J17 is 8x1.5 batteries
    U2s are voltage regulators (down to 5 volts)
    capacitor C1 is in real life two capacitors connected in parallel: electrolytic 470 uF and non-electrolytic 0.1uF
    R33, R34, R35, R36 are 470 ohms, though i tried 10 kohms as well but nothing changed

    Please help! What can be the reason of such an odd behavor??
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
    Hello,

    Do you have the decoupling capacitors at the stabelizers?
    Do you have decoupling capacitors accross the powerlines of the IC's ?

    Bertus
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You should be using the same Vdd/Vcc for the PIC and the logic side of the L298.

    The 7805 regulator should have a small 0.33uF cap on it's input.

    As Bertus mentioned, both the PIC and the L298 need 0.1uF/100nF bypass caps across their Vdd/Vcc and GND connections, as close to the pins as possible. The bypass caps should be metallized poly film or ceramic.

    Your Vs supply should have bypass caps to GND; one or two 0.1uF caps and a much larger (preferably low ESR) cap.

    I do not see any reverse-ESR protection diodes on the output, like are shown in the L298 datasheets. You must include them. Use diodes of the fast recovery type. FR303 diodes are suitable. 1N540x, 1N400x diodes are NOT suitable.

    This is not a "pick and choose" list. Unless you do all of the above, your circuit will function poorly.
     
  4. NioBium

    Thread Starter New Member

    May 5, 2010
    6
    0
    bertus, thank you, yes, i had them.

    SgtWookie, thanks you very much! after i have replaced 1N4007 diodes with FR303 equivalents (i have already forgotten the model i used :p) everything started working just perfect :)
     
  5. NioBium

    Thread Starter New Member

    May 5, 2010
    6
    0
    was having logical input of L298 coupled with the vcc of the uP really a necessity?? what is the reason?
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I'm glad you got it working. :)

    Yes - more specifically, the power for ALL of the logic functions should be from the same source; the power for the motors needs to be separate.
    It is to guarantee that the voltage supply to the logic portions is the same; that way you are more likely to have the logic levels properly interpreted by the IC's.

    Also, using two regulators was a waste of power in your situation, as there is a ~5.5mA "tax" current that flows through the GND terminal, but more significant is the power loss that occurs in the regulator itself. For example, if your voltage source is 10v and you are using a 5v linear regulator, more than half of the power used in the circuit will be dissipated in the regulator, no matter if the output current is 5mA or 1.5A.

    Your motors will be relatively insensitive to power fluctuations. However, you will get better performance from your batteries if you use caps from Vs to GND; both 0.1uF caps and larger electrolytic capacitors.
     
    Last edited: May 7, 2010
  7. NioBium

    Thread Starter New Member

    May 5, 2010
    6
    0
    yeah, power dissipation is a serious concern. thank you again! :)
     
Loading...