Hi, I was trying to study the Accelstepper library to control a reaction wheel stabilizer. I have strong doubts about reading some library commands such as:
1-maxspeed
2-acceleration
3-moveto
4-setmaxspeed
being a stepper motor I don't have maximum speed and acceleration values, how do I choose these values?
after a PID that measures the angular velocity from an IMU sensor generates a PID to adjust the speed of the structure to zero by imposing an acceleration on the motor, but he specifically formulates this PID as a speed to be imposed on the motor and also this function:
// Set the current speed and direction of the motor
void setSpeedStepper(double targetSpeed){
if(targetSpeed > 0)
myStepper.moveTo(1000000);
else
myStepper.moveTo(-1000000);
myStepper.setMaxSpeed(fabs(targetSpeed));
}
Could someone explain to me why it doesn't directly control the acceleration? why does it impose such a high moveto()?
Sure you do. The maximum practically obtainable speed and acceleration depend on the motor, the driver and the motor power supply, and can be estimated by experiment.
why does it impose such a high moveto()
Those values are essentially infinity, and can be changed by subsequent commands.
Yes, you can do everything you want, but a stepper doesn’t sound like the right type of motor for the application.
You may be better off with a dc motor (possibly geared down to the speed and torque figures you need)
Then add some feedback to inform the position of the moving parts to the control algorithm.
I know but for particular reasons I have to use a stepper motor. I would at least like to bring it to the maximum possible performance by controlling it in speed or acceleration