Go Down

Topic: Need Help Using Deek Robot L293 Stepper Driver (Read 3734 times) previous topic - next topic

TheFool

Jun 26, 2015, 08:43 pm Last Edit: Jun 26, 2015, 08:46 pm by TheFool
Hey all I recently bought this little L293 driver break out board for stepper motors. I've used stepper shields before but am having a hard time wiring this thing up to work with the AFMotor Library.

Here's what the board looks like: http://www.deek-robot.com/productShow.asp?id=17
Here's what the schematic is to the L293: http://www.deek-robot.com/admin/down/down/2013112818205273499.pdf

Here is what I've done so far -

So I mapped my stepper wires to the Motor A (1&2) inputs and B(1&2) inputs no problem.
I pried open the AFMotor library and found it uses pins 2&3 and 1&4 for stepper #1.
I hooked up those pins on the arduino to the break-out pins and gave a very simple test run. I get a clunk sound instead of any rotation.

What I see are an LED lighting up on the A & B sides (so two LEDs are lighting up). But not all four. When I power down the board and external supply and spin the motor by hand I see all four lighting up.

I'm not sure exactly where to go from here. I notice there are EN1 and EN2 pins on the break-out board, should I be calling those as pullup and writing to them before trying to drive the stepper? I do not understand why there are two pins per ENX outlet when the L293 only has one latch? Any help appreciated.


If you want to see my code here it is -
Code: [Select]

#include <AFMotor.h>

int stepType = SINGLE;

AF_Stepper xmotor(200, 1);

void setup() {
  // put your setup code here, to run once:
  //xmotor.setSpeed(40);
}
//Off by facot of 1.789???

void loop() {
  xmotor.step(150, BACKWARD, stepType);
   delay(2000);
  xmotor.step(150, FORWARD, stepType);
   delay(2000);
}

 


Robin2

Please post a link to the datasheet for your stepper motor.

How are you powering the motor?

An L293 is a poor choice for driving stepper motors. It is really intended for regular DC motors. See stepper motor basics.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

TheFool

#2
Jun 26, 2015, 09:45 pm Last Edit: Jun 26, 2015, 10:06 pm by TheFool
I do not have an official data-sheet but here is the ebay listing where I got the motor which displays its electrical properties - http://www.ebay.co.uk/itm/New-Brand-Professional42BYJ34-0604A-CNC-2-Phase-Hybrid-Stepper-Motor-Useful-/361167463490

I am powering the motor with a "wall-wart" which exceeds the phase current by about triple and is with-in the right range for voltage.

Robin2 I am aware of that, but I have used L293 IC's to drive steppers in the past and had no issues with "light" usage.

TheFool

#3
Jun 26, 2015, 10:19 pm Last Edit: Jun 26, 2015, 11:00 pm by TheFool
Think I destroyed my leonardo trying to do this :( :( :(.

In the AFMotor library it denotes digital pins 1,2,3, and 4 for communicating the the L293 driver.
Code: [Select]

#define MOTOR1_A 2
#define MOTOR1_B 3
#define MOTOR2_A 1
#define MOTOR2_B 4


Now when I supply power to the leonardo either via USB or external the RX & TX lights do not blink. They remain locked on. When I hit the reset button they turn off momentarily only to be stuck on again. USB doesn't recognize the board either.

Reading the Leonardo pin-out it says "Do Not Use" for digital Pin 1.

This is a huge disappointment. I still do not know how to solve the problem so I'm not sure what to do. Can anyone guide me on the following questions...

Did I hose the arduino?
What did I do wrong?
What is a cheap and reliable board/library to drive stepper motors using another arduino?

Robin2

Disconnect everything from the Leonardo and try uploading another program - for example the simple Blink program in the Arduino IDE

Quote
Reading the Leonardo pin-out it says "Do Not Use" for digital Pin 1.
Where did you see that? On the Leonardo pins 0 and 1 are Rx1 and Tx1


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

TheFool

I disconnected everything and no matter what the IDE and terminal does not recognize that the board is plugged in via USB.

Here is where I saw not to use the 0&1 digital pins - https://micro-manager.org/w/images/2/28/Micro-manager_bb.png


A little update. I plugged the motor and power supply into a different L293d shield using an uno and the motor worked completely fine. So it was not the connections from the shield to the motor, nor the power supply.

Something went wrong with how I had connected the Deek Robot shield to the board. Or the way I had the firmware/AFMotor library trying to drive the board. I have no idea which, either way I think my leonardo is toast :(.

Robin2

#6
Jun 28, 2015, 10:07 am Last Edit: Jun 28, 2015, 10:12 am by Robin2
Here is where I saw not to use the 0&1 digital pins - https://micro-manager.org/w/images/2/28/Micro-manager_bb.png
That just refers to something called "MicroManager". The footnote explains that it needs to use those pins.

Quote
A little update. I plugged the motor and power supply into a different L293d shield using an uno and the motor worked completely fine. So it was not the connections from the shield to the motor, nor the power supply.
It sounds like you changed two things - the shield and the Arduino. How can you tell where the problem was?

On an Uno pins 0 and 1 are Rx and Tx that communicate with the PC over USB, including when programs are uploaded. The Leonardo is different and its pins 0 and 1 have nothing to do with program uploading. Beyond that I do not know enough to have an opinion about whether you have damaged your Leonardo. But I would be surprised if using pins 0 and 1 were directly the cause of the damage.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

TheFool

Yea Robin like I said I have no way to figure out the problem. The leonardo is dead. However, that showed that the motor, powersupply, and code were working. The problem is that I have no idea. I thought I did everything correctly, it even sounded like the motor should have been working.

I'm beginning to wonder if the Deek Robot chip itself is flawed. The only other thread I could find on it on this website or anywhere was someone who stopped responding. It's possible they had the same issue. I did notice that the voltage regulator on the arduino board got very very hot at one point. I'm wondering if the 12V was getting dumped back onto the board somehow?

Robin2

I did notice that the voltage regulator on the arduino board got very very hot at one point.
Not a good sign.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

MarkT

Quote
When I power down the board and external supply and spin the motor by hand I see all four lighting up.
That's not a wise action - don't spin a connected stepper like this if the driver is powered down
unless you know the driver can take it.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up