Powering DC motor controller with arduino

Hi,

As part of a project, I am using an arduino uno to power a DC motor driver:

http://www.mouser.com/ds/2/427/sip2100-519775.pdf

The motor driver chip is externally powered by a 5V DC supply and the chip is connected to a magnetic torque rod as a load ( Just think of it as a solenoid with coils around it, with a resistance of 30 ohms) The InA and InB pins are connected to my arduino PWM pins 9 and 10. I intend to change the duty cycles of these two pins to supply bidirectional current. I am using a simple code to test this:

int pwmpin = 9;
int pwmpin2 = 10;
void setup() {
  pinMode(pwmpin,OUTPUT);
  pinMode(pwmpin2,OUTPUT);

}


void loop() {
   analogWrite(pwmpin,100);
   analogWrite(pwmpin2,0);
}

However, I notice the my motor driver chip draws an unusually low amount of current before the maximum duty cycle, when my duty cycle set for analogwrite increases from 0 to about 240, the current drawn is unusually low ( Much lower than I=V/R for the voltage) , and it sky rockets once I set the duty cycle value to 255.

I was just wondering if setting the duty cycle of one of the pins to 0 to serve as a ground is a bad idea?

Well, the Arduino does not "power" the driver, it controls it. To drive the motor in 1 direction digitalWrite(pin9,LOW),apply PWM to pin 10, for the other direction, digitalWrite(pin10,LOW), apply PWM to pin 9. To stop, digitalWrite both pins HIGH. Can you post a drawing of your wiring?
Sounds like inductive reactance from the coil is choking the PWM current, analogWrite(pin, 255) is the same as digitalWrite(pin,HIGH), so no PWM, straight DC, no choking, full current.

outsider:
Well, the Arduino does not "power" the driver, it controls it. To drive the motor in 1 direction digitalWrite(pin9,LOW),apply PWM to pin 10, for the other direction, digitalWrite(pin10,LOW), apply PWM to pin 9. To stop, digitalWrite both pins HIGH. Can you post a drawing of your wiring?
Sounds like inductive reactance from the coil is choking the PWM current, analogWrite(pin, 255) is the same as digitalWrite(pin,HIGH), so no PWM, straight DC, no choking, full current.

I think it's a pretty easy circuit, Pins 9 & 10 of my arduino go to the InA and InB pins on the chip, OutA and OutB are then connected to my coil. The rest of the pins of the chip ( apart from Vd) are grounded.

Also, what do you mean by "choking" the pwm current?

I think your main problem is with the high inductive reactance of your device, inductance presents a large impedance to an AC or pulsating DC current, thats why your current jumps when you get to digitalWrite(255), the current is no longer pulsating PWM but straight DC so inductance don't matter. I think you need an anolog input H bridge that takes 0 to 5 volts DC,not PWM. You can still use the Arduino for control by low pass filtering the PWM output to low ripple DC.
Keep checking back, hopefully one of the guys more knowledgeable than me (like MarkT) will answer.
Good luck.

Here's some lit on Xl (inductive reactance)

outsider:
I think your main problem is with the high inductive reactance of your device, inductance presents a large impedance to an AC or pulsating DC current, thats why your current jumps when you get to digitalWrite(255),

The DC component of current is not affected by the inductance, it should rise linearly with the average PWM
voltage in a synchronously rectified circuit, or non-linearly if using a decay mode.

the current is no longer pulsating PWM but straight DC so inductance don't matter. I think you need an anolog input H bridge that takes 0 to 5 volts DC,not PWM. You can still use the Arduino for control by low pass filtering the PWM output to low ripple DC.

An analog input H-bridge? What's one of those? An H-bridge is switched.

Keep checking back, hopefully one of the guys more knowledgeable than me (like MarkT) will answer.
Good luck.

The observed behaviour seems odd - as that H-bridge is straight-through you are doing synchronous
rectification so the current into a resistive and/or inductive load should vary linearly with the duty
cycle.
Can you put a 'scope onto the output pins to see what kind of waveforms are generated?

Are these magnetic torque rods at risk of saturating magnetically? If so their dynamic inductance will
drop like a stone and you would see odd effects.

I guess "analog H - bridge" was a poor choice of words, what I was thinking was:
image7.png

For forward, drive Q1 to full conduction and drive Q4 in the linear region, for reverse do the same with Q3 and Q2.

Not another bad H-bridge design please.... An H-bridge is 4 switches, and the linear region is
not used for switching because the devices overheat/explode and for low voltage designs
you waste a large proportion of your supply voltage going so.