element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Dev Tools
  • Products
  • More
Dev Tools
Forum L298 current sensor pin, convert pulsed current signal to consumption flag
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Dev Tools to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 20 replies
  • Answers 2 answers
  • Subscribers 82 subscribers
  • Views 4258 views
  • Users 0 members are here
Related

L298 current sensor pin, convert pulsed current signal to consumption flag

modelrailwaycat
modelrailwaycat over 10 years ago

Hello,

 

I am designing a small, simple 12V motor controller fed by a L298 H-bridge driver. The H-bridge input pins are supplied by means of PWM at 40 Hz. The motor can be connected or disconnected from the output even with the input and enable on. For this reason, I am interested in adding additional circuitry in order to obtain a binary signal of consumption using the current sensor pins; that is obtain a permanent high level while some current is detected and a permanent low level when no current is detected (after at least 1 period, but this is flexible).

 

The idea is to use a 0.5 ohm resistor to connect the sense pin to ground, and then use the voltage across the resistor to obtain the signal. I consider that the voltage measured will be from 5 mV to 1V and the Duty Cycle can be down to 1%. Because the sensor signal is also pulsed, I need somehow to filter it and obtain an stable output while consumption is 'on'. The problem is that I had not success to set properly a low-pass filter plus op-amp buffer configuration from this signal working reliably with all the mentioned conditions. I also tried to pre-amplify the sensor signal with another op-amp, then output that into the low-pass filter plus buffer, but had no success too.

 

Any idea is appreciated. Thank you very much!

  • Sign in to reply
  • Cancel

Top Replies

  • D_Hersey
    D_Hersey over 10 years ago +2 suggested
    Can you draw it up? What op-amp are you using? Not all op amps have common mode input range all of the way to BoS.
  • D_Hersey
    D_Hersey over 10 years ago +2
    "If you are going to reverse the current, you will need to set up a different reference voltage as with everything referred to 0V you will not get a negative swing. And your comparator will have to work…
  • peterjcs23
    peterjcs23 over 10 years ago in reply to modelrailwaycat +1
    Hi John, is your motor turning ok? If you put a DVM across Rsense what voltage do you see when turning and when stationary? Do you have a scope to look at waveforms? Peter
Parents
  • modelrailwaycat
    0 modelrailwaycat over 10 years ago

    Hi again,

     

    Thank you very much to all of you for your support. I think I finally get it work using the concept proposed by Peter, and also changing the filter configuration and inverting the first comparator, so the consumption flag now is 'active low', which is OK. I don't need the reverse operation signal because I have the information from the signals inputed to the LM298.

     

    Attached is what I tried this time. As you can see, I also changed the voltage threshold to 5mV to avoid problems working near GND in the 1rs comparator. It limits minimum current detection to 10 mA but I think will be OK. With this configuration, the VFILTER voltage is below the reference voltage VREF in the 2nd comparator down to 0,4% PWM Duty Cycle, which is a 1/256 resolution, enough for me, during all the time while PWM action is 'on'. After PWM goes to low, the VFILTER voltage recovers and changes the consumption flag when it goes above 3,4v (VREF). This takes about 110 ms after the last pulse sent, enough for the intended application.

     

    image

    In the simulation below, the PWM signal starts at 50 ms (the flag goes low) and stops at 250ms. After 110 ms, the flag goes high.

    image

    Do you see any problems with this concept?

     

    I have to test it in the protoboard to confirm it is OK.

     

    Thank you very much again!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • pankaj671
    0 pankaj671 over 7 years ago in reply to modelrailwaycat

    HI john

    i need same ckt for my application .i need to use amplifier + comparator + plus shaping ckt to make sense signal to 5 V TTL compatible to feed it to FPGA.

    Can you help .

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • pankaj671
    0 pankaj671 over 7 years ago in reply to modelrailwaycat

    HI john

    i need same ckt for my application .i need to use amplifier + comparator + plus shaping ckt to make sense signal to 5 V TTL compatible to feed it to FPGA.

    Can you help .

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube