Maslow Home Maslow Community Garden Newsletter

Need help with pins on alternate BTS7690 Motor Driver

Greetings!

In my journey to build a Maslow of my own, I had trouble sourcing the PC board for the 5206 drivers. I then came across these

Double BTS7960 43A H-bridge High-power Motor Drivers. The amp specs looked very good. I think I even read a reference to them in the forum. (Marcina Barbarzynca) has a Diagram of them being used, but I’m not clear.

https://easyeda.com/polaski/maslow-cnc-shield-v2

So now I have 3 of them and would really appreciate help in wiring them up. Figuring out which pin goes where.

Datasheet (https://www.handsontec.com/dataspecs/module/BTS7960%20Motor%20Driver.pdf)

So, The side with the screw terminals go to the motor and 24v psu. check.

There are 8 other pins. 5v and ground (I can do that). check

Then they list:

Control Input Pin Function:
1 RPWM Forward Levelor PWM signal, Active High
2 LPWM Reverse Levelor PWM signal, Active High
3 R_EN Forward Drive Enable Input, Active High/ Low Disable
4 L_EN Reverse Drive Enable Input, Active High/Low Disable
5 R_IS Forward Drive, Side current alarm output
6 L_IS Reverse Drive, Side current alarm output

I’ve read 2 of the pins are not required.

So, I could really use some direction which of these 6 pins (or 4 pins) to the Pins on the Mega? (obviously for all 3 motors.)

Thanks

Max

bts 3

So, What I have been able to deduce from that diagram:

Just need help to getting which pin over to the Driver boards.

ARDUINO PIN

LEFT

44 In5 (To Motor controller?)
43 In6
43 EnC

35 5A (Encoder)
34 6B (Encoder)

+5v
GRND

Z

41 In3 (To Motor controller?)
40 In4
39 EnB

31 5A (Encoder)
30 6B (Encoder)

+5v
GRND

RIGHT

38 In1 (To Motor controller?)
37 In2
36 EnA

29 5A (Encoder)
28 6B (Encoder)

+5v
GRND

I was just digging in the firmware for a different problem I’m having and was looking at what you are after in the System.cpp file.

There are 6 versions of shields out there (at least in my firmware - once I get the 5th shield working, it will be submitted as a pull request), each with a different pinout for encoders and control pwm output. What matters is that the outputs that require pwm are kept on pins that the clock can be set. This is a copy of version 1.1. your encoders don’t have to match exactly, but the (in)123456 pins need to be used for motor chip control input pwm where the pwm frequency divider can be changed to get the right clock speed for the pwm the motor control chip can handle. I’m messing with that right now, so I’m pasting this from that file with some edits

//PCB v1.7 Detected    --- yours would be 1.7
 //MP1 - Right Motor
    encoder1A = 20; // INPUT  --- from encoder movement
    encoder1B = 21; // INPUT  -- used with A to determine direction
    in1 = 6;        // OUTPUT  ---out from mega to motor control speed /direction input
    in2 = 4;        // OUTPUT  ---- same as in1
    enA = 5;        // PWM    ---- this is for feedback to the mega for errors most chips don't use it, but may need it for acceleration control when that becomes a thing  

   //MP2 - Z-axis
    encoder2A = 19; // INPUT
    encoder2B = 18; // INPUT
    in3 = 9;        // OUTPUT
    in4 = 7;        // OUTPUT
    enB = 8;        // PWM

    //MP3 - Left Motor
    encoder3A = 2;   // INPUT
    encoder3B = 3;   // INPUT
    in5 = 10;        // OUTPUT
    in6 = 11;        // OUTPUT
    enC = 12;        // PWM

    //AUX pins  ---- used for spindle power / speed, touch, laser, etc.
    aux1 = 17;
    aux2 = 16;
    aux3 = 15;
    aux4 = 14;
    aux5 = A7;
    aux6 = A6;
1 Like

Thank you, I just printed this out as a reference. I’m pretty familiar with stepper drivers, less with these DC motor drivers. I understand the drivers are getting PWM signals to drive the motors.

I was going to perfboard the 5206s, but after figuring out the extra cost for resistors, caps, connectors, heatsinks. These BTS7960 only cost $3-4 each on Aliexpress. I’m going to add some heat sinks to the chip tops. They have huge heat sinks underneath the board.

Yes!, I will have the first 1.7 Maslow Shield!!:slight_smile:

PS:

This was also very helpful. I Though the enA was the ENABLE pin. So it is feedback from the driver. If applicable. So, the enable pins on the motor controller would just be set HIGH.

" * *enA = 5; // PWM ---- this is for feedback to the mega for errors most chips don't use it, but may need it for acceleration control when that becomes a thing * *"

1 Like

use pins 22-26 to have the firmware autodetect your 1.7 shield so it will play nice with all the other ones and you don’t have to have custom firmware, just an updated version everyone can use.

1 Like

Will do!

Thanks

Just so I understand, pins 22-26 are only 5 pins? Would these be pins to drive the motor drivers?

you make a binary number with those pins to tell the mega what the board number is, so it loads the correct pin profile. Search all files for getPCBVersion() in system.cpp and it details the pins it looks at to determine the board version. Once the board version is detected (it announces it in the webcontrol/groundcontrol console) then it will load the correct motor movement pins based on that number coded by which of those pins are pulled to ground.

EDIT: after looking at the getPCBVersion, you will want to have it report as 1.8. TLE9201 is 1.7. 1.5 is easbay (1.5b) TB6643. 1.4 is TLE5206, 1.1-1.3 are L298’s

" * *enA = 5; // PWM ---- this is for feedback to the mega for errors most chips don't use it, but may need it for acceleration control when that becomes a thing * * "

I misled you on this one. For the L298, the enA was the pwm output as well. It needed 3 control pins. The only board that used those as a feedback was the one with the TLE9201 and it is very rare, but it was the one I was working with, so was true for that one. In most cases, the enA,B,C pins are pwm outputs.

Thank you very much! You have been very helpful.

Max

1 Like