luisllamasbinaburo / Arduino-BTS7960

Arduino library to control the BTS7960 Dual H-Bridge, that can drive DC-Motor up to 43A
https://github.com/luisllamasbinaburo/Arduino-BTS7960
Apache License 2.0
29 stars 20 forks source link

QUESTION #5

Closed douw closed 2 years ago

douw commented 2 years ago

Not an issue. Why does the TurnRight and TurnLeft methods include a line that writes 0 to the output, and the microsecond delay? Won't that slow the motor down on repeated calls to change the speed?

jnm commented 2 years ago

I think the delay is there as an attempt to guard against "shoot through", which essentially creates a short circuit that destroys the motor controller very quickly. Here's an example of people discussing it when designing their own H-bridge:

It is important to ensure that the two mosfets on the same half-bridge are never on at the same time. This condition called “shoot through”, shorts the power supply and will likely damage the mosfets. The IR2109 half bridge driver chip contains logic to prevent this condition from occurring. It outputs the PWM signal to the high mosfet gate while sending an inverted version of the signal to the low mosfet gate. To be certain that shoot through does not occur during the transient, it also adds a 540ns dead time where both signals are low.

douw commented 2 years ago

Understood, thanks.

eirinnm commented 2 years ago

The BTS7960 chip already has a dead-time feature built in (section 4.4.2 of the datasheet) so the delay here isn't needed.

jnm commented 2 years ago

That's interesting. Do you know from experience that it works? The datasheet also claims over-current and over-temperature protection, and yet these devices cook quite easily while being operated within their voltage and current specifications.