Hi again, (replying to my own post)
Does this relate to Phase/Enable mode braking during the low-time in the PWM cycle? Is the intuitive explanation that during the low-time the motor is braking so continually slowing up and speeding up, consuming more current than if it’s just staying at full speed?
I tested also with In/In with Brake, and In/In with Coast. The In/In with Brake performs identically with the Phase/Enable, which makes sense.
I found the results from In/In with Coast surprising too: the voltage increase and current increase with duty cycle wasn’t linear, but much steeper than linear. Why is that? However plotting Current vs Voltage was roughly linear. Charts below.
At 30%-70% PWM duty cycle, the current draw using Coast is approx half that with Brake. I notice that many of the motor drivers don’t even offer the Coast mode, though it seems much more efficient.
Would be interested in expert comments on this.
Also could I please confirm something from this forum topic:
since it seems that with Phase/Enable (or In/In with Brake) that the current involved will actually be considerably higher than at 6V, and considerably higher than even a steady 9V.
Thanks,
Dan
In this chart the Phase/Enable line is exactly under the In/In Brake



For anyone that’s interested, the measurements I got were:

The program I used for In/In timing is below.
Regards,
Dan
const int modePin = 12;
const int in1Pin = 9;
const int in2Pin = 10;
void setup() {
Serial.begin(9600);
pinMode(modePin, OUTPUT);
pinMode(in1Pin, OUTPUT);
pinMode(in2Pin, OUTPUT);
digitalWrite(modePin, 0); // Set in/in mode
}
int direction = 0;
int brake = 0; // 0==coast, 1==brake
void loop() {
int pwmPin = direction ? in1Pin : in2Pin;
int otherPin = direction ? in2Pin : in1Pin;
digitalWrite(otherPin, brake);
for (int speed = 0; speed <= 256; speed += 32) {
int pwmValue = brake ? max(0, (255 - speed)) : min(255, speed);
analogWrite(pwmPin, pwmValue);
Serial.print("brake="); Serial.print(brake);
Serial.print("\t direction="); Serial.print(direction);
Serial.print("\t speed="); Serial.print(speed);
Serial.print("\t pwmValue="); Serial.println(pwmValue);
delay(10000);
}
direction = 1 - direction; // toggle direction
if (direction == 0) // Toggle brake mode after going in both directions
brake = 1 - brake;
}
