Author Topic: Need help with project involving arduino and H bridge + motor  (Read 1091 times)

0 Members and 1 Guest are viewing this topic.

Offline paulhm81Topic starter

  • Regular Contributor
  • *
  • Posts: 72
  • Country: ro
Hello.

        I plan on using a car wiper dc motor with a car jack to open a big trap door that leads to my basement where I have my workshop and to control the bridge using an arduino uno and two swithches to initiate the movement. I'm thinking on building an H bridge to control the motor and contact switches to limit the movement but I have a concern. What if a contact switch doesn't work after a wile given that it will be outside ( not in the rain). I was thinking about the car windows and how it detects when something is stuck. I thought about using a shunt to measure the current provided to the motor and program the arduino to stop if it exceeds a certain current but i'm unsure how to do it and wonder if there's a simpler method that I haven't thought of!? I researched the net and found out about  ad623 to translate the voltage drop to something usable and I also read about using a bjt to make the arduino compatible with the 12 v H bridge P channel part.
       Do any of you have an idea of a  simpler way to do  this?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Need help with project involving arduino and H bridge + motor
« Reply #1 on: June 04, 2018, 12:57:48 pm »
I would consider a High Side Current Sense Amplifier along with a shunt resistor in the + supply to the H bridge.

http://www.st.com/content/ccc/resource/technical/document/datasheet/group2/df/85/34/d4/87/18/46/87/CD00153725/files/CD00153725.pdf/jcr:content/translations/en.CD00153725.pdf

Google for 'high side current sense amplifier'
 

Offline paulhm81Topic starter

  • Regular Contributor
  • *
  • Posts: 72
  • Country: ro
Re: Need help with project involving arduino and H bridge + motor
« Reply #2 on: June 04, 2018, 03:24:12 pm »
I would consider a High Side Current Sense Amplifier along with a shunt resistor in the + supply to the H bridge.

http://www.st.com/content/ccc/resource/technical/document/datasheet/group2/df/85/34/d4/87/18/46/87/CD00153725/files/CD00153725.pdf/jcr:content/translations/en.CD00153725.pdf

Google for 'high side current sense amplifier'

That sounds interesting. I will search for a dip equivalent because I prefer through hole. What I don't get from the datasheet is what resistance should I use for the shunt but I presume the output to the microcontroler will determine what I need!
 

Offline FL0WL0W

  • Contributor
  • Posts: 23
  • Country: us
Re: Need help with project involving arduino and H bridge + motor
« Reply #3 on: June 04, 2018, 03:33:29 pm »
As an alternative simpler solution. A relay and fuse should work.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Need help with project involving arduino and H bridge + motor
« Reply #4 on: June 04, 2018, 03:48:10 pm »
I'm not actually designing your circuit but if you look at Figure 16 in the datasheet, the sweet spot of accuracy occurs with Vsense = 50 mV.  So, size your shunt resistor to drop 50 mV at full current.

Then look at Figure 17 for 50 mV and a gain of 100 (TS101C) to see where you will have a 5V output.

You may want to design away from these values to allow for overcurrent or you may want to adjust the offset and range with another op amp.  Maybe you want to get to 50 mV with stall current, and so on.

You could also cut back on the gain with a TS101B so you would have 5V output at 100 mV Vsense.  This way full load current could be at 50 mV and overload at 100 mV.

You might still want to protect the AD inputs with zener diodes to prevent overvoltage.  In doing this, you may need some series resistance at the sensor output so that you can clamp the voltage without melting the sensor.  Keep the value as low as possible to avoid source impedance problems with the AD input.

And so on...

 

Offline paulhm81Topic starter

  • Regular Contributor
  • *
  • Posts: 72
  • Country: ro
Re: Need help with project involving arduino and H bridge + motor
« Reply #5 on: June 04, 2018, 04:20:42 pm »
I'm not actually designing your circuit but if you look at Figure 16 in the datasheet, the sweet spot of accuracy occurs with Vsense = 50 mV.  So, size your shunt resistor to drop 50 mV at full current.

Then look at Figure 17 for 50 mV and a gain of 100 (TS101C) to see where you will have a 5V output.

You may want to design away from these values to allow for overcurrent or you may want to adjust the offset and range with another op amp.  Maybe you want to get to 50 mV with stall current, and so on.

You could also cut back on the gain with a TS101B so you would have 5V output at 100 mV Vsense.  This way full load current could be at 50 mV and overload at 100 mV.

You might still want to protect the AD inputs with zener diodes to prevent overvoltage.  In doing this, you may need some series resistance at the sensor output so that you can clamp the voltage without melting the sensor.  Keep the value as low as possible to avoid source impedance problems with the AD input.

And so on...

Ok! That makes sense! Thank you!
Can't wait to build this...it should be fun  |O
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Need help with project involving arduino and H bridge + motor
« Reply #6 on: June 04, 2018, 05:32:44 pm »
There are many of these sensors.  One spec on the linked version that bothers me is the limitation on reverse sense voltage.  I don't recall which sensor I used way back when but it was bidirectional.  It could have the same sense voltage in each direction.

Ordinarily, sense voltage will be well under a volt but under fault conditions, this might not be true.  It may be worth the time to think about this apparent limitation and what it means.  Don't forget, DC motors work as generators when they are braking.  Obviously, we don't want a high sense voltage because that voltage drop is no longer available for driving the motor.

It should be interesting to search through datasheets and app notes to see which sensor is more appropriate.  My application was measuring current through a 1 HP DC motor running at 24V.  I used a conventional 50 mV shunt.  These shunts are 'industrial' and intended to drop 50 mV at whatever their nameplate current suggests.  200A:50mV, 100A:50mV etc.

https://www.allelectronics.com/item/snt-50/50-amp-shunt-50mv-50a/1.html

Notice how the sensor sweet spot is at 50 mV.  This isn't happenstance!  It is because industrial shunt resistors are rated for 50 mV at full load.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf