killacycle
Member
I am moving up to a 4.1 from a 3.6 with an existing program that uses the RotateControl in TeensyStep library (which works mavelously using the 3.6, BTW.)
Of course, the compiler chokes on RotateControl as the structure of the TeensyStep4 library is quite different than the old TeensyStep.
The existing program uses these lines:
#define Y_STEP_PIN 23 // Spool on Y-axis stepper
#define Y_DIR_PIN 18 // Spool direction
float SpoolPPR = (360.0 / 1.8) * 16.0; // (360° / angle per steps°) * microsteps
float SpoolPPS = SpoolPPR / 60.0; // 1.0 RPM base speed for Spool
Stepper motor_1(Y_STEP_PIN,Y_DIR_PIN );
RotateControl Spool;
motor_1
.setMaxSpeed(SpoolPPS) // steps/s
.setAcceleration(20000); // steps/s^2
Spool.rotateAsync(motor_1);
Spool.overrideSpeed(SpoolRPM); // Sets the spool speed as the program is running and is called as the spool RPM needs to change
This asynchronously runs the the stepper quite nicely with a 3.6 under the old TeensyStep library.
A simple example snippet, translated into the the new format would be enormously helpful. Enormously.
Bill D.
Of course, the compiler chokes on RotateControl as the structure of the TeensyStep4 library is quite different than the old TeensyStep.
The existing program uses these lines:
#define Y_STEP_PIN 23 // Spool on Y-axis stepper
#define Y_DIR_PIN 18 // Spool direction
float SpoolPPR = (360.0 / 1.8) * 16.0; // (360° / angle per steps°) * microsteps
float SpoolPPS = SpoolPPR / 60.0; // 1.0 RPM base speed for Spool
Stepper motor_1(Y_STEP_PIN,Y_DIR_PIN );
RotateControl Spool;
motor_1
.setMaxSpeed(SpoolPPS) // steps/s
.setAcceleration(20000); // steps/s^2
Spool.rotateAsync(motor_1);
Spool.overrideSpeed(SpoolRPM); // Sets the spool speed as the program is running and is called as the spool RPM needs to change
This asynchronously runs the the stepper quite nicely with a 3.6 under the old TeensyStep library.
A simple example snippet, translated into the the new format would be enormously helpful. Enormously.
Bill D.