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 19 forks source link

low pwm #7

Closed Valdemir-DSW closed 1 year ago

Valdemir-DSW commented 1 year ago

The PWM is too low causing noise and excessive heating .If you can add a PWM regulation or just put it straight to 20KHz

luisllamasbinaburo commented 1 year ago

PWM regulation is not related to the use of the library. If necessary, it should be made by the user in their code (for example, not all processor have the same capabilities, or the same way to config pwm freq)

Valdemir-DSW commented 1 year ago

Thank you I was able to do this by changing the Registers void setup(){ TCCR1B &= ~(_BV(CS12) | _BV(CS11) | _BV(CS10)); // Clear existing prescaler bits TCCR1B |= _BV(CS10); // arduino leonardo

Valdemir-DSW commented 1 year ago

This solved 100% of my problem even here's the tip for you to put it in the description to be clear to avoid unnecessary noise and heating

luisllamasbinaburo commented 1 year ago

On my website i have this post https://www.luisllamas.es/como-cambiar-la-frecuencia-de-un-pwm-en-arduino/ Sorry, spanish only. but code is self-explain. Maybe it's usefull four you