Go Down

Topic: Accelstepper and Gecko Driver (Read 4425 times) previous topic - next topic

rvaindustrial

So I'm having a little trouble communicating with my gecko 203V via the Arduino Uno...
I've hooked everything up with the appropiate power supplies and so forth, I have a nema 23 400oz/in motor wired in parallel (checked, double checked, and triple checked that phases were properly connected), and using the Accelstepper library I have written a simple sketch just to verify that everything works before moving on with the project.

I assigned pins 8 and 9 as step and direction, I set the acceleration to 1000pps/s, and I've been (manually) ramping up the speed gradually to see how the motor performs throughout it's range and it won't go any faster than 5000pps regardless of the value I enter in the setSpeed and setMaxSpeed.  If I enter a value between 10khz and 20khz I can hear the speed fluctuating (while it is supposed to be running at a constant speed) and it is still turning at about 150 rpm, and if I enter a value above 20khz I get no movement at all and I can just hear a high pitch ring from the motor.  Any thoughts?

Here is the test code I've been using:
Code: [Select]

#include<AccelStepper.h>

AccelStepper stepper(1, 9, 8);

int target = 20000;

void setup()
{
  stepper.setMaxSpeed(5000);
  stepper.setAcceleration(1000);
  stepper.moveTo(target);
}
void loop()
{
  while (stepper.distanceToGo()!=0)
  {
    stepper.run();
   
   
  }
}

joemcder

Hi speed usually requires a high voltage. The stepper driver uses the high voltage to pulse high current to reverse the motor coils rapidly.    What voltage are you using?  Does varying the voltage have any effect?

Chagrin


Hi speed usually requires a high voltage. The stepper driver uses the high voltage to pulse high current to reverse the motor coils rapidly.    What voltage are you using?  Does varying the voltage have any effect?

...and are you using microstepping? Not using microstepping will make it spin much more quickly of course.

raacampbell

#3
Aug 11, 2013, 05:54 pm Last Edit: Aug 11, 2013, 06:21 pm by raacampbell Reason: 1

I assigned pins 8 and 9 as step and direction, I set the acceleration to 1000pps/s, and I've been (manually) ramping up the speed gradually to see how the motor performs throughout it's range and it won't go any faster than 5000pps regardless of the value I enter in the setSpeed and setMaxSpeed.  If I enter a value between 10khz and 20khz I can hear the speed fluctuating (while it is supposed to be running at a constant speed) and it is still


When implementing accelerations, etc, with the run() command the library is unable to produce pulses above about 4.3 kHz on a 16 MHz uC such as the Uno or the Mega. See the change log http://www.airspayce.com/mikem/arduino/AccelStepper/index.html (v 1.5). If you use full steps you will go faster for a given pulse rate.

I believe if you use runSpeed() you can go faster, but then there are no accelerations. http://www.airspayce.com/mikem/arduino/AccelStepper/ConstantSpeed_8pde-example.html Also, speed will decrease if you attach more than one motor.

You can run faster if you use a faster board. The developer responds to question at the Google Group for the library: https://groups.google.com/forum/#!forum/accelstepper

Your motor will have a maximum speed. If you cross it, it will stall. If there is not sufficient current to reach that speed, also it will stall. Finally, if the drive signal becomes choppy and you're driving the motor at high speed then also this is a situation where you might see a stall. Perhaps this last case is what you're seeing?

rvaindustrial

Thank you guys for the advice, it was the microstep resolution that was limiting my rpm.  I purchased an add on to my 203V that allows me to select the resolution with a series of jumpers --- Problem solved!!

MarkT

Rather off-topic, but:
Quote
I have a nema 23 400oz/in motor

oz/in is not a unit of torque - torque is radial distance times tangential force, so ozf-in would be a
better unit (ounce-force x inch), but you see this mistake all over datasheets and specifications of
motors, which is shocking really!

My preferred unit of torque is J/rad (joules per radian), which is numerically the same as newton-metres but emphasizes
the rotational aspect of torque (after all a newton-metre could mean a joule for linear geometry).  I think
SI should introduce a named unit for torque really, perhaps named after someone who would be spinning
in their grave at the thought!

power = torque x angular-velocity

So in my units   power = J/rad x rad/s = J/s = W, which is clear and simple.  My intuition is that a lot
of people are confused about torque because it is taught in perverse units.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Robin2

I have always understood a radian to be a measurement of angle and while I can see how J/rad might be mathematically equivalent to N-m to my mind it doesn't in any way convey the notion of a force acting at a distance from the centre. It is trivially easy to understand the conversion from N-m to N-cm or kg-m or oz-in or ft-lbs (even if some of those units are not precisely correct.) I can calculate what a Joule is but I can't imagine what it feels like - but 2 kg is a large bottle of Coke.

Often the best is the enemy of the good.

...R


Rather off-topic, but:
My preferred unit of torque is J/rad (joules per radian)

people are confused about torque because it is taught in perverse units.
Two or three hours spent thinking and reading documentation solves most programming problems.

rvaindustrial

"power = torque x angular-velocity

So in my units   power = J/rad x rad/s = J/s = W, which is clear and simple.  My intuition is that a lot
of people are confused about torque because it is taught in perverse units."

I must disagree that oz-in is an indiscrete unit in that it represents the maximum rated axial load at a distance of 1" from the shaft center and not ounces per inch of travel.  The ounce is indeed a unit of force in that it represents the gravitational **force** acting on a given mass.  What you are describing is the amount of work that the motor is capable of in terms of Watts which is a linear calculation of horsepower.  I think stepper motors are rated according to their maximum torque because they aren't intended to do a lot of "work" when compared to typical electric motors.  You wouldn't use a stepper motor to drive a pump or anything else that requires much horsepower whereas they are typically used in short increments to shift a load or something along those lines.  You could rate these motors in terms of power (not to be confused with torque) but I think it's a little impractical given their typical application.

Robin2

Perhaps it would be clearer if torques were specified as N@m or oz@in meaning a force of a Newton acting at a distance of a metre.

If one wanted to be really pedantic then work could be N>m (rather than Nm) to convey the idea of a Newton moving through a metre.

But if life was that simple we would use "nite" instead of "night" :)

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

Go Up