Two stepper motors and arduino setup. Linear Actuators... Suggestions?

Thanks Robin! You been very helpful! I see that I need to connect a capacitor to the polulu once, but not to the easy driver. Thats seems to be the biggest practical difference...

eleison:
Thanks Robin! You been very helpful! I see that I need to connect a capacitor to the polulu once, but not to the easy driver. Thats seems to be the biggest practical difference...

I hadn't noticed it before but it seems the BED already includes the capacitor.

Are you aware that the BED defaults to micro-stepping and the Pololu A4988 to single stepping.

...R

Are you aware that the BED defaults to micro-stepping and the Pololu A4988 to single stepping

.

No, I didn't know. I guess it's changeable on both drivers?

eleison:
No, I didn't know. I guess it's changeable on both drivers?

Yes there are pins that you connect to GND or 5v (see the instructions) to select the different microstepping rates.

...R

Ok, now i've started working on my project again. I choosed to use the Big Easy Driver, I connected it with to my arduino as shown here: Big Easy Driver Tutorial. I'm driving the driver with 24V 5A power supply and my arduino with a (EDIT:) 12V supply.

I'm still using the nema 17 motor:
Frame size 42 x 42mm - NEMA 17
1.8 degree step angle
Length 47mm
Holding torque 44 N.cm (4.4kg.cm, 62oz.in)
Voltage 2.8V
Current/Phase 1.68A
Resistance/Phase 1.65ohm
Inductance/Phase 2.8mH
Inertia 68g.cm
Bipolar, 4-wire

So everything worked as suspected, I had the current potentiometer kinda low, so I thought I wanted to try turn the current up a little. I heard the motor stutter a little and then it just died. The BED power light is working and arudino power light is also working. The motor didn't get hot neither did the bord. I did'nt turn up the current much, i thought it was pretty low already. I tried with another motor with same model and nothing moves :confused:

Any idea what this means? :frowning:

eleison:
I had the current potentiometer kinda low, so I thought I wanted to try turn the current up a little.

What current was the pot originally set for, and what did you change it to?

What happens if you put it back to the original value?

Waggling things round without measuring is just a waste of time.

Do you have a second BED for comparison? I would be surprised if the motor was damaged. In fact I would be surprised if the BED was damaged as I think they have a high-temperature shutdown, and they normally work at a very high temperature anyway - hot enough to burn your finger.

...R

Atm I don't have any instrument to meassure the current. I put the BED at lowest value, the motor moved fine, then i increased a little and did hear the motor getting more current. Before i reached halfway the motor started to stutter and then it just stopped. The BED didn't get warm and the motor was just a little bit warm. Now I tried all different current values and nothing happens. The board power led is on, nothing more... Since the motor should be able to handle 1.68A and the BED outputs 1.4A/Phase Max I didn't think I could over current anything....

I guess I have to buy a multimeter to start meassure things :confused:

I have three BEDS but, didn't get the two first once working. One of them just puts drives one coil and the other is not moving. I thought it was either bad BEDS or me not doing proper soldering. With the third BED everything started as wanted atleast!

I feel like I have done everything as it should be done, but apparently i'm missing something...
Thanks for all the help!

eleison:
I put the BED at lowest value

How do you know you did not start at the highest value? From what you describe that seems more likely.

I guess I have to buy a multimeter to start meassure things

Most certainly. A cheap one will be fine.

not doing proper soldering.

Any brief disconnection of power between the driver and the motor can damage the driver - could easily happen with a dry joint due to poor soldering. But re-do the soldering before throwing the BED in the bin.

...R

eleison:
So i've been looking around for different stepper drivers. My steppers have "Current/Phase 1.68A" and when I look at different driver boards they can't go that high without overheating. What's your experience with this? Is it bad to give the motors for example 1.4A?

Thanks :slight_smile:

No single chip driver can take that current level without good heatsinking (or a fan).
That's the way of things - if you want to drive a stepper without heat issues you
have to use discrete MOSFETs in the driver (8 MOSFETs per stepper, note)...

If you give the stepper less current it will have less torque, basically.

MarkT:
... you
have to use discrete MOSFETs in the driver (8 MOSFETs per stepper, note)...

If you give the stepper less current it will have less torque, basically.

Ok! Could you explain this little more in detail?

Robin2:
How do you know you did not start at the highest value? From what you describe that seems more likely.

Since the motor worked and sounded OK, when I increased the current the motor sound was making a "higher" sound.

Thanks for the advices!

I just bought another driver: DM420A.
Hopefully I can get it working, otherwise I will switch out the motors... When I get time I will take a look at the BEDS to see if they're broken.

eleison:
Since the motor worked and sounded OK,

That is exactly what leads me to think you started at the highest current setting.
The only way to know is by following the BED instructions which probably means measuring something with a multimeter.

...R

Ok, so now I'm trying a new driver. The DM420a microstep driver... But i'm little bit confused how to connect it with the arduino. There is this guide: Guide

But my stepper doesnt have PUL + and PUL -, or DIR + and DIR -. Instead just PUL, DIR AND +5V.

Right now I have connected PUL to arduino PIN13 and DIR to PIN12. I connected the +5V to 5V on the arduino. And the DC+ and DC- on the driver to a power supplt. I connected the motor to the two coils inputs on the driver, following the motor diagram.

I found this: Image But don't know how to read it..

I assume I'm doing something wrong, I need to connect ground to arduino somehow?

This is my third driver attempt so I don't want to try and ruin something...

I want to use the accelstepp library, can someone give an example I can use to get started testing the motor with this driver?

Thanks :slight_smile:

So I got it to work with the wiring as described above! :slight_smile:

Now I got another problem...

If I run the driver with this code:

void setup() {                
  pinMode(12, OUTPUT);     //direction pin
  pinMode(13, OUTPUT); //step pin
  digitalWrite(12, LOW);
  digitalWrite(13, LOW);
}

void loop() {
  digitalWrite(13, HIGH);
  delayMicroseconds(300);          
  digitalWrite(13, LOW); 
  delayMicroseconds(300);
 }

It moves nice in one direction, sounds good too...
But if I use this code:

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper(1, 13, 12);

int pos = 3600;

void setup()
{  
  stepper.setMaxSpeed(1000);
  stepper.setAcceleration(3000);
}

void loop()
{
  if (stepper.distanceToGo() == 0)
  {
    delay(500);
    pos = -pos;
    stepper.moveTo(pos);
  }
  stepper.run();
}

It moves forward and back, but there is a high pitch annoying sound from the motor. I want to use the accelstepper library but the sound doesn't seem right... :frowning:

Lose the delay() - stepper.run() needs to be called as frequently as possible.

And you just have to tell it to move to a position. The library takes care of getting it there and then stopping.

Put stepper,moveTo(pos); into setup() and have nothing except stepper,run() in loop()

...R

Robin2:
Lose the delay() - stepper.run() needs to be called as frequently as possible.

And you just have to tell it to move to a position. The library takes care of getting it there and then stopping.

Put stepper,moveTo(pos); into setup() and have nothing except stepper,run() in loop()

...R

Like this?

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper(1, 13, 12);

int pos = 1000;

void setup()
{
stepper.setMaxSpeed(2000);
stepper.setAcceleration(8000);
moveTo(pos);
}

void loop()
{
stepper.run();
}

I get error: 'moveTo' was not declared in this scope

eleison:
I get error: 'moveTo' was not declared in this scope

I suspect if you think a bit harder and compare the present code with the previous version (and with my earlier suggestion) you will figure it out. What mistake have you made?

...R

Robin2:
I suspect if you think a bit harder and compare the present code with the previous version (and with my earlier suggestion) you will figure it out. What mistake have you made?

...R

Hehe, i was in a hurry :confused: sometimes the obvious is hard to see... I will try it out tomorrow! Thanks

eleison:
Hehe, i was in a hurry :confused: sometimes the obvious is hard to see...

Been there.
Done that.

...R

Ok, so now I tried with a more basic code for the accelstepp library, and it's still the same results. I feels like when I just stepp manually it feels like there is less frequency in the stepps. I took two videos, one with the accelstepper and one with basic stepper code. The basic stepper code also have a higher speed in movement, that I can't achieve with the library. I can also make more smoother motions with the basic stepper code...

Accelstepper video

Basic code video (I can tweak this to move even smoother, more quiet).

I tried all different kinds of maxmovementspeeds, currents, stepper revolutions (200,400,800...,25600) etc and can't get it smooth, low sound and fast as the basic stepper code...