Hi guys,
I would know if there a possibility with arduino to start a stepper motor with a preset acc,dec, velocity and when a interrupt input occours switch to control position in realtime.
Pratically I would change the function on fly.
thank's
Hi guys,
I would know if there a possibility with arduino to start a stepper motor with a preset acc,dec, velocity and when a interrupt input occours switch to control position in realtime.
Pratically I would change the function on fly.
thank's
thank's for the answer,
I understanding what you mean,
Normally I used industrial plc and HMI and with these components I can control stepper motor drives in various modes.
So I think is possible to create with Arduino ramps,speeds,positions etc... (I can create the recipes that I can recall in "setup".
But
The only thing that I don't know is there is some instruction that enable me to switch on fly the modality when I read an interupt hardware input of Arduino
than's for all replies.
raschemmel:
Speed is set by the PWM duty cycle of the stepper motor.
No it is not!!!
The speed of a stepping motor is defined by the frequency of pulses you give it not the duty cycle.
Stepper motors have no parameter such as Accel or Decel like the AC servo motors do.
It is not the motors that have those characteristics but the motor drivers.
Yes you can have acceleration with a stepping motor and yes you could change these parameters in an interrupt service routine.
The main problem is that the libraries that allow for these parameters are not designed for them to be changed on the fly, so they would be out of scope for the ISR. This can be remedied but you will have to either hack the library or write your own code.
thank's a lot Mike!!
All clear now!
Stepper motors have no parameter such as Accel or Decel like the AC servo motors do.
Yes you can have acceleration with a stepping motor
Thanks for correcting me Mike. I looked at the AccelStepper and it did have an accel parameter.
void setup(){
stepper.setMaxSpeed(motorSpeed);
stepper.setSpeed(motorSpeed);
stepper.setAcceleration(motorAccel);
stepper.moveTo(32000); //move 32000 steps (should be 10 rev)
}
one_stepper_example.ino (1014 Bytes)
thank you raschemmel...
your example was very useful!!!
see you
FYI, I forgot to mention , the parameters for the DNet-Based AC Servos were stored in the DNet driver. It had Accel,Decel, & Velocity. Using block moves you call a function that had the following arguments:
Target Position, Accel,Decel , & Velocity. By storing arrays of these, you could do block moves where it starts out accelerating
up to full speed and then decelerates to a crawl just before reaching the target and gently makes contact with the target ( a wafer in a chamber) and comes to a stop. This was necessary to avoid generating particles. The concept could be applied to other systems like a stepper motor but I don't think it has decel parameter so it wouldn't quite work the same. If you create variables for these parameters and store values from low to high (let's say 0 to 10 for simplicity) then the result would be a function that would
would move the motor at say Accel-2, Speed-4, to pos-5, etc.
where it starts out accelerating up to full speed and then decelerates to a crawl just before reaching the target and gently makes contact with the target ( a wafer in a chamber) and comes to a stop.
The technical name for this is an over damped servo system.
It has the advantage of no overshoot but is slow at getting to the point.
Next comes what is called critically damped where there is one overshoot and then it comes back on position.
An under damped has several under shoot / over shoot cycles.
See:-