Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brushless define #64

Open
slide97 opened this issue Apr 10, 2022 · 1 comment
Open

Brushless define #64

slide97 opened this issue Apr 10, 2022 · 1 comment

Comments

@slide97
Copy link

slide97 commented Apr 10, 2022

Hi,
In case of JYQD driver, the enable is HIGH level.
in this function with the brushless define the enable is LOW

void AmMotorDriver::begin(){
#ifdef MOTOR_DRIVER_BRUSHLESS
// logic for brushless drivers
CONSOLE.println("MOTOR_DRIVER_BRUSHLESS: yes");
faultActive = LOW;
enableActive = LOW;

If some other driver needs a LOW level, does it make sense to have an additional new define for the JYQD driver? Something like that ?
#ifdef MOTOR_DRIVER_JYQD
enableActive = HIGH
#else
enableActive = LOW;
#endif
thanks

@MarkKuhmann
Copy link

? sorry, these options are included in 1.0.230 or i do not understand.

for the JYQD driver you need to disable the "heartbeat" and that´s it:

here is how i did it:

use: #define MOTOR_DRIVER_BRUSHLESS 1 //in config .h line 146

add line in config.h ( for me its line 151)
//#define MOTOR_DRIVER_BRUSHLESS_HEARTBEAT 1 // uncomment if brushless driver requires heartbeat

change the function "AmMotorDriver::setBrushless" in file AmRobotDriver.cpp to this:

void AmMotorDriver::setBrushless(int pinDir, int pinPWM, int speed) {
//DEBUGLN(speed);
if (speed < 0) {
digitalWrite(pinDir, HIGH) ;
#ifdef MOTOR_DRIVER_BRUSHLESS_HEARTBEAT
if (speed >= -2) speed = -2;
#endif
pinMan.analogWrite(pinPWM, ((byte)abs(speed)));
} else {
digitalWrite(pinDir, LOW) ;
#ifdef MOTOR_DRIVER_BRUSHLESS_HEARTBEAT
if (speed <= 2) speed = 2;
#endif
pinMan.analogWrite(pinPWM, ((byte)abs(speed)));
}
}

best regards - Mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants