Go Down

Topic: Increasing the torque on 4 12 volts. (Read 5508 times) previous topic - next topic

Skorb

Hey RuggedCircuits,

Thanks for being patient. Will there be an issue with the motorcontroller chip receiving too much power without a voltage regulator?

This is the sample code I've rigged up to test the motor rotation:

Code: [Select]



#include <Stepper.h>

#define STEPS 200

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper1(STEPS, 2, 3, 4, 5);
Stepper stepper2(STEPS, 6, 7, 8, 9);
Stepper stepper3(STEPS, 10, 11, 12, 13);
Stepper stepper4(STEPS, A0, A1, A2, A3);

const int analogWritePin = 4;

void setup()
{
  // set the speed of the motor to 30 RPMs
  stepper1.setSpeed(10);
  stepper2.setSpeed(10);
  stepper3.setSpeed(10);
  stepper4.setSpeed(10);
 
  //Where analogWritePin is connected to the en pins of each of the 4 hbridges.
  analogWrite(analogWritePin, 127);
 
  Serial.begin(9600);
}

void loop()
{
    stepper1.step(20);
    stepper2.step(20);
    stepper3.step(20);
    stepper4.step(20);
}

RuggedCircuits

The L293 drivers you are using are rated for operation up to 36V so 19V operation should be fine with them. Just keep an eye on the current -- those things are not internally thermal limited so if they get too hot they will be destroyed. I know they say they are rated for 0.6A/1A (depending on the L293/L293D variant) but really that's a marketing number. Read this. The L293 is probably a little underpowered for the kind of torque/current you're looking for.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

Skorb

Interesting read, so a L293 actually reduces the amount of current going through it in order to sustain itself.

Regarding current, a 3.5 amp current flow from the power source would likely be too much? Or will enabling PWM help mitigate that?

Also, is my code a viable implementation of PWM using analogWrite?

Cheers, Skorb.

RuggedCircuits

Quote
Interesting read, so a L293 actually reduces the amount of current going through it in order to sustain itself.


It doesn't really "steal" current to sustain itself. The power loss is just due to the nature of the transistors inside the L293 -- they dissipate power when current goes through them, typically more than more modern FET-based drivers. That's power that doesn't get to your motors.

Quote
Regarding current, a 3.5 amp current flow from the power source would likely be too much? Or will enabling PWM help mitigate that?


That depends on your power source. You say you've got a 19V 3.42A power supply, so it should be able to handle 4*2*0.33=2.64A of currents.

Quote
Also, is my code a viable implementation of PWM using analogWrite?


Yes, assuming you hook everything up right! (as your code says, pin D4 connected to the EN pin of all drivers). Though that can't be right because you instantiate your stepper1() instance of Stepper to use pins 2,3,4,5. So you're already using pin 4. You need to think about your wiring more.

--
Beat707: MIDI drum machine / sequencer / groove-box for Arduino

Skorb

Thanks RuggedCircuits,

If I changed the analogPin to:

const int analogWritePin = A4;

Would that work better?

The pin 4 in the stepper declaration is digital.

Cheers, Skorb.

RuggedCircuits

No, you want to stay away from "analog" pin numbers except for when you use analogRead(). Everything in your code works with digital pins. So "analog pin A0" is really D14, and "analog pin A5" is D19. So your instantiation of stepper4() is also incorrect.

You have to be careful and use analogWrite() on a digital pin that supports PWM: pins 3, 5, 6, 9, 10, and 11 on an Uno/Duemilanove.

--
The Quick Shield: breakout all 28 pins to quick-connect terminals

Skorb

Awesome, I understand now, I'll fix the instantiation.

Thanks a ton, I'll let you know how it goes tomorrow. Once it's done I'll try post a video so you can check it out.

Skorb

Just to clarify, if I'm using this circuit diagram: http://arduino.cc/en/uploads/Tutorial/bipolar_schem.jpeg

Then there will be an additional wire going from one of the pwm compatible digital pins to my breadboard, and from there 8 additional wires going to each of the 2 en pins on the motorcontrollers.

Go Up