Hey everyone,
So I have this big jack motor that is rated at 90 W, and 36 V. We're using it to drive two solar thermal collectors (PTC) for tracking.
Now the problem here is that we used the famous L298N to try and drive it and we fried three of those h-bridges. The first time we used it, it worked for a few hours, driving the motor with the sun's position, only it changed its position A LOT and went back and forth, maybe because the tolerance value that we defined in the arduino's code (I think it was 50) was too low (or too high?) and the starting current that the motor needed was too much for the L298N, anyways it stopped working completely.
The second one wasn't working for some reason, and the third h-bridge got fried after 15 seconds of connecting the power.
Keep in mind we gave the H-Bridge 24 Volts (even though the motor says it needs 36 volts), and 5 volts for the logic circuit, with the jumper removed.
Now we decided to use BTS7960 h-bridge driver as we think it'll solve the problem of the motor draining too much current for the previous driver to handle, and my question is as follows:
- Does it work exactly as the L298N driver? Do we just connect the pins where IN1 and IN2 were connected to LPWM and RPWM?
- What exactly do the pins that are R_EN, L_EN, R_IS and L_IS do? I read in a control sheet that we should just connect the first two pins with 5 volts from the arduino and the last two pins are unneeded.
I don't have a schematic, but the connections will be as follows:
- 24 volts supplied to B+, and B- going to a ground rail on a breadboard.
- The positive and negative wires of the jack motor connected to M+ and M- of the BTS7690 driver.
- The LPWM and RPWM connected to pins 8 and 9 on an arduino mega 2560, respectively.
- 12 Volts supplied to Vin into the arduino.
- 3.3 volts supplied to a positive rail on the breadboard from the arduino's 3.3 volt pin, where the LDRs that are going to track the sun's position will be connected to.
- 5 volts supplied to another positive rail on the breadboard from the arduino's 5 volt pin, where the pins Vcc, L_EN and R_EN are going to be connected to.
And here's the code:
int LDR_reading1 = A0;
int LDR_reading2 = A1;
int in1 = 8;
int in2 = 9;
int tol = 10;
void setup() {
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
}
void loop() {
int x1 = analogRead(LDR_reading1);
int x2 = analogRead(LDR_reading2);
int xd = x1 - x2;
if(abs(x1 - x2) <= tol) {
TurnMotorOFF();
} else {
if(x1<x2) {
TurnMotorCW();
}
if(x2<x1) {
TurnMotorCCW();
}
}
delay(1000);
}
void TurnMotorCW () {
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
}
void TurnMotorCCW() {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
}
void TurnMotorOFF() {
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
}
I doubt the name of the variables have any effect here right?
Will this connection work? Or is the h-bridge driver also going to fry?
Please if someone has any clue if there's something wrong with the code that'll affect the functionality of the driver and the motor (make it move a lot or make it move back and forth), like maybe the tolerance value or the way the functions are written and laid out in that if statement, then please tell me about it so that I can fix it.
Thanks!