I don't understand the issue with homing. Can you do a quick sketch showing the problem?
See this diagram: my limit switches are marked red. I have to manually shunt the slide in this area with quite a lot of small movements (marked green) to arrange the winding wires or to thread in filaments etc., so I can't put the limit switch to a location like the one marked blue.

can you add some typical numbers to the speed profile (time and velocities)?
A typical winding process has a duration of 20 seconds and motor speeds around 30kHz for motor1 and 5kHz for motor2. Maximal speeds are 56kHz for motor1 and 52kHz for motor2, motor1 being the rotation and motor2 being the linear rail for feeding the winding wires.
all controllers keep track of position. You do not need to stick with one controller and can switch to another after a move. Position Will be correct.
I was able to pass pre-calculated target positions to the controller, but the motor wouldn't stop spinning. Using a step controller setTargetRel() works, but then again I can't use the override commands:
Code:
#include "TeensyStep.h"
Stepper motor(22, 41);
RotateControl r_controller(5, 1000);
StepControl s_controller(5, 1000);
void setup() {
rotate_mode();
step_mode();
}
void rotate_mode() {
motor.setTargetRel(300); // does not work
r_controller.rotateAsync(motor); delay(2000);
r_controller.overrideSpeed(2); delay(2000);
r_controller.stop();
}
void step_mode() {
motor.setTargetRel(2000);
s_controller.moveAsync(motor); delay(500);
s_controller.overrideSpeed(2); delay(500); // does not compile
s_controller.stop();
}
void loop() {}
Here some other observations I would like to share:
Code:
#include "TeensyStep.h"
Stepper motor(22, 41);
RotateControl controller(5, 1000); // does work
RotateControl controller2(); // does not work
void setup() {
motor
.setMaxSpeed(30000)
.setAcceleration(60000);
controller.rotateAsync(motor);
delay(200);
controller.emergencyStop(); // does not work
}
void loop() {
int pos = motor.getPosition(); // does compile
int vel = motor.getCurrentSpeed(); // does not compile
while (1);
}