2019-08-28, 07:52 PM
(2019-07-13, 04:14 PM)rmvdmrl Wrote: Hi Skeyedoc,Hi, Rob,
TMHO. You should connect a 1k resistor from the IBT2 IS to ground that should give a 8.5 ratio from current to Vis (BTS7960 datasheet). So with a current of 15 Amps there should be 1,764 volt (15/8,5) on that resistor (with a max of 7 volt in current limit mode but standard that should be with 43 Amps/8,5=5.05 Volt). Off course you want the Arduino to measure and give the right current. Just for an example According to ohm's law a shunt of 0.05Ohm (one of the options with the Arduino/Pypilot) should give a voltage of 0.75 volt at 15 Amps (that is also what the code in motor.ino measures (low current 20 Amps Max) (1024/1,1(refvolt)=931 x 0,75V = 698,2 x 275 /128 =1500) therefore you could (and should because of the possible 7 volt) use a voltage divider of 100Kohm and 74Kohm that will result in a voltage of 1,764V/174KOhm X 74Kohm=0,7502 volt. So Your measured current should be reasonably right. I hope this will put you in the right direction and off course I can’t give any guaranties as most off the time I have no idea what I’m thinking or doing.
Greetings Rob
I've read your notes time and again since you posted them, but I still need your help to wrap my head around this matter of current sensing/current over-protection. Let me explain exactly what I've got now, then if you (or anyone?) can straighten me out?
I've connected the IBT2 to the Uno as Beholder77 outlined:
IBT_2 ARDUINO
+5V 5v
GND GND
R_EN+L_EN D2
R_IS+L_IS A1 (with voltage divider)
L_PWM D9
R_PWM D10
Where he has combined R_IS with L_IS going into the voltage divider, I presently have those entering a 47kohm resistor tied to A1, and a 15kohm resistor from A1 to ground. (I chose these values just because I had them lying around and they approximated the need.) If I understand what you've suggested, these values might better be 100kohm and 74kohm, and the reason for that is to get a more accurate estimate of current sensed?
For these, beholder77 mentioned 50k and 10k. I've walked through your calculations above, and confess I get a bit lost. Sean mentioned something about Vref being a range from 0-1.1 v. I think beholder77's R values come closest to limiting a 7 volt input to that range, no? However, you seem to have a handle on this ratio to Vis business that no one else has brought up.
With your R values, should the voltage from IBT2 rise to 7 volts, the divider would hold it at 2.98 v. With beholder77's values, it's capped at 1.17 v. It shouldn't hurt the Uno either way, but I just don't know which logic to follow.
But either way, does this mean that with this particular MCU, there's no need for placing a shunt resistor in the circuit? Somewhere along the way, I got the notion that was necessary to obtain current sense.
And how exactly does voltage sense work here?
I'm so confused...
Elliott