Code snippet for two motors on 2 IBT-2’s using just two pwm pins.Ĭould you share the fritzing part for the IBT-2? Int mcpwr2=53 // power for motor control 2 Int mcgnd2=52 // ground for motor control 2 Int pwmdirection1l=51 // digital motor control direction 1 Int pwmdirection1r=50 // digital motor control direction 1
Int pwmdirection2l=49 // digital motor control direction 2 Int pwmdirection2r=48 // digital motor control direction 2 Int mcpwr1=47 // power for motor control 1 Int mcgnd1=46 // ground for motor control 1 Int pwmpin2=45 // 8-bit pwm 0-255 for motor 2 Int pwmpin1=44 // 8-bit pwm 0-255 timer 5 for motor 1
The following code is for the Mega-2560 and can control two IBT-2’s I also use some digital pins to power/ground the logic of the IBT-2’s (46,47,52, 53). I then used the LPWM and RPWM pins to set the direction. I “drove” both the enables with one PWM pin (Pin 44 goes to R_EN and L_EN). Thanks for the great info!! I thought I would share how I controlled this with one PWM pin.
So while it is possible, these motor drivers do not have the precise current control that would be needed but high power stepper motors. This method allows motors that when stationary have a winding voltage of 6V to operate at up to 60V To overcome this, a higher voltage is used and the current is then limited to prevent damage to the motor. This is because at higher frequencies of phase reversal, the impedance of the winding’s increases, reducing the current flow and motor torque will drop off rapidly. The voltage applied to the motor can be a lot higher than the nominal voltage of the winding’s. In most cases, dedicated stepper drivers will not only control the voltage to the stepper motors, but also limit the current. If you are using the IBT-2 I will assume you are planning to run a high power stepper. It is possible to drive a steeper motor with these bridges, however it is not recommended.įirst you will need two as there are two sets of winding’s in the stepper and this bridge will only handle 1 set of winding’s A 5k or 10k potentiometer is used to control the speed.Īuthor Dr Rainer Hessmer Posted on DecemOctoCategories Robotics Tags Arduino B+ and B- at the top of the diagram represent the power supply for the motor. The following Fritzing diagram illustrates the wiring. Int forwardPWM = (sensorValue - 512) / 2 Int reversePWM = -(sensorValue - 511) / 2 the lower half of it we use for reverse rotation the upper half for forward rotation sensor value is in the range 0 to 1023 Int sensorValue = analogRead(SENSOR_PIN) Int LPWM_Output = 6 // Arduino PWM output pin 6 connect to IBT-2 pin 2 (LPWM) Int RPWM_Output = 5 // Arduino PWM output pin 5 connect to IBT-2 pin 1 (RPWM) Int SENSOR_PIN = 0 // center pin of the potentiometer IBT-2 pins 5 (R_IS) and 6 (L_IS) not connected IBT-2 pins 3 (R_EN), 4 (L_EN), 7 (VCC) to Arduino 5V pin One side pin of the potentiometer (either one) to ground the other side pin to +5V Speed and direction controlled by a potentiometer attached to analog input 0. IBT-2 Motor Control Board driven by Arduino.
In this post I describe a slightly more complete solution that uses an Arduino controller with connected potentiometer to drive a motor via the IBT-2 module from full reverse speed to full forward speed.įor reference here is the description of the input ports and the two supported usage modes (image taken from one of the ebay postings). This thread on the Arduino forum was useful but the solution wastes a few pins and does not demonstrate bidirectional motor control.
I am not sure whether the heat sink is sufficient for handling 43A but even if one does not drive the unit to its limits the specifications are still impressive given the typical price point of this module (currently between $13 and $17 including free shipping from China). There is relatively little information available about how to hook up the module with an Arduino controller. The link provides more details but here are a few key parameters. The IBT-2 H-bridge module from wingxin is an inexpensive, high power motor driver based on two BTS7960 chips and is readily available from various ebay vendors see e.g.