Hi -
Looking for some feedback from folks. I'm using AccelStepper with a Nano clone to work with some linear guides. I want to emphasize, these linear guides were going to go in the garbage at work, and I took them home because they looked to be in good shape, but I don't know all their history etc. It's possible they got thrown around while in storage.
Here are two videos, in both videos you can see the stepper motor start turning and then something gets jammed. I'm not too experienced in working with these, but I brought them home to learn so here I am.
If I lower the speed from 4000 to 2000, here is a video where it doesn't outright jam but you can hear it clicking as i moves between two positions:
My feeling is it isn't the stepper itself, but wondering what others think. Here is my code:
Briefly - the code moves the cart/platform back and forth between the 0 position and the 15000 steps position. The stepper motor driver is the DM542 configured with 400 pulse/rev.
Curious to hear what others think. Do I need to disassemble the cart and clean/replace the bearings?
#include <AccelStepper.h>
#include <elapsedMillis.h>
//Defining pins
int Stepper1Pulse = 5; // Pulse or step pin
int Stepper1Direction = 6; // Direction pin
int speedmax = 4000; //pulses per second
AccelStepper step1(1, Stepper1Pulse, Stepper1Direction);
elapsedMillis printTime;
long pos = 15000;
void setup() {
Serial.begin(9600);
pinMode(Stepper1Pulse, OUTPUT);
pinMode(Stepper1Direction, OUTPUT);
digitalWrite(Stepper1Pulse, LOW);
digitalWrite(Stepper1Direction, LOW);
int pulses = calc_steps_for_distance(10);
step1.setMaxSpeed (speedmax);
step1.setAcceleration(2000);
step1.moveTo(pos);
}
void loop() {
if (printTime > 500) {
printTime = 0;
float mSpeed = step1.speed();
int mDir = digitalRead(Stepper1Direction);
Serial.print(mDir);
Serial.print(" ");
Serial.print(mSpeed);
Serial.print(" ");
Serial.println(step1.currentPosition());
}
if (step1.distanceToGo() == 0){
if (step1.currentPosition() == pos){
step1.moveTo(0);
}
else if (step1.currentPosition() == 0){
step1.moveTo(pos);
}
}
step1.run();
}
For testing, 10 to 100 steps/second is reasonable.
You may actually be inflicting additional damage on that expensive linear actuator mechanism. That is, if it is not already so trashed as to be worthless.
I would remove the screw and run the trolly along the bearing by hand, force it Clockwise then CCW then up then down. See if it binds somewhere.
Are there adjustments in the trolly?
Got it, ok I lowered it to 100, then increased it to 500 steps/sec. Around 500 I start to hear a little bit knocking like in the 3rd video. I can't quite figure though, is that knocking noise coming from the stepper or from the ball screw?
I would very closely examine the lead screws, the second video seems to have a slight imperfection on one thread near where the jam occurs. Turn it manually by hand and see if you can find exactly where the problem occurs.
/// \par Performance
/// The fastest motor speed that can be reliably supported is about 4000 steps per
/// second at a clock frequency of 16 MHz on Arduino such as Uno etc.
Have you got a current limit on the driver?
If so is it setup correctly?
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
The max speed can depend greatly on loading, power and acceleration. If you accelerate the signals faster than the motor can physically keep up, they get out of step and you start losing steps. If you underpower it, it is hard for the motor to accelerate. If you overload it it also makes it hard to accelerate. If you disconnect the motor from the loading, does the motor make it to your full 8000 steps/sec? (4000 steps/sec on an Uno/Nano?)
Your code prints a line of text every 500ms, which seems a similar period to period of the ticks on the video. If the serial reporting at the relatively slow 9600baud is causing a periodic pause, increasing the baud rate could reduce the pause. Maybe before fiddling with the baud rate, I should have suggested checking if the printing is actually causing the pause by changing the period between printing or disabling it.
Hi @zwieblum,
The stepper driver is 20V to 50V, so my assumption is that with a good enough power supply it will drive the current I need as long as my voltage is in that range. What makes you say I need atleast 36V? I do agree, the symptom does seem to be under current but I'm not sure how to get it more current. The benchtop power supply is set to supply 2A, but the stepper is only drawing .3-.5A in the video (this can be seen in the power draw on the benchtop supply in the videos).
@TopGeorge
I have set the limit on the driver to be "full current". Here's a pic I did really quickly this morning before heading to work.
Still skeptical this is the issue, as it doesn't quite seem to be an issue at the lower speeds or accelerations, however thanks for point this out as a potential culprit. Will report back in the evening.
That video shows that it isn't the guide rail jamming up.
That's a bad assumption. The stepper drivers limit average current with a PWM chopper, but can take a high voltage to deliver high torque at high speeds. Set your driver switches to limit to 2A and crank up the voltage on your bench supply. You'll see your 20.00V & 0.5A current go proportionally down as the supply voltage goes up while the driver's chopper kicks in, and the top speeds increase.
At 4000 steps/sec there's only 0.25ms/step to deliver the energy needed to torque the motor. The driver needs higher voltages to deliver the energy to the motor.