Thank you for the detailed infos and your post!
In the current test code, which produced the above, I did not send any signal to the controllers at all. I just did what I described. After connecting two of the three motor controllers, the motors were stable and quiet, with all three connected, the back and forth movement started.
I also have a video of the phenomenon, it does not move microsteps, but several centimeters in this case.
I tried connecting the step pins to ground, but the phenomenon did not change.
By the way, I use the fastaccelstepper library in my original complete code. Since the motors need to hold, they need to be enabled after the movement is finished.
Here is my simplyfied code, for my test described above:
#include <TMCStepper.h>
#include <HardwareSerial.h>
// #define SLIDE_MOTOR_STEP_PIN 26
// #define SLIDE_MOTOR_DIRECTION_PIN 27
// #define PAN_MOTOR_STEP_PIN 22
// #define PAN_MOTOR_DIRECTION_PIN 23
// #define TILT_MOTOR_STEP_PIN 19
// #define TILT_MOTOR_DIRECTION_PIN 21
#define SLIDE_MAX_SPEED 700
#define SLIDE_MAX_ACCELERATION 8000
#define PAN_MAX_SPEED 500
#define PAN_MAX_ACCELERATION 8000
#define TILT_MAX_SPEED 250
#define TILT_MAX_ACCELERATION 8000
#define RXD2 16
#define TXD2 17
#define SERIAL_PORT_2 Serial2 // TMC2208/TMC2224 HardwareSerial port - pins 16 & 17
#define DRIVER_S_ADDRESS 0b00 // TMC2209 Driver address according to MS1 and MS2
#define DRIVER_P_ADDRESS 0b01 // TMC2209 Driver address according to MS1 and MS2
#define DRIVER_T_ADDRESS 0b10 // TMC2209 Driver address according to MS1 and MS2
#define R_SENSE 0.11f // E_SENSE for current calc, SilentStepStick series use 0.11
TMC2209Stepper driver_s(&SERIAL_PORT_2, R_SENSE, DRIVER_S_ADDRESS); // Create TMC driver
TMC2209Stepper driver_p(&SERIAL_PORT_2, R_SENSE, DRIVER_P_ADDRESS); // Create TMC driver
TMC2209Stepper driver_t(&SERIAL_PORT_2, R_SENSE, DRIVER_T_ADDRESS); // Create TMC driver
// RC Channel order and functions //
// CH1 Stepper 1 Axle S Slide (Only negative positions enabled, the ZERO is the limitswitch)
// CH2 Stepper 2 Axle P Pan
// CH3 Stepper 3 Axle T Tilt
// CH4 Speed Control for AutoMOve
// CH5 Set IN/OUT position if CH8 ENABLED, the In/Out block is selected in CH7 (1,2,3)
// CH6 Start / Stop / ReSet AUTO MOve according to CH7 setting (1,2,3), 3 sec long push resets all axles to ZERO
// CH7 Set IN/OUT SET (1,2,3)
// CH8 UP In/Out setting ENABLED, center nothing, LOW Move to In or OUT, selected by CH5 - CH8
// CH9 Reset board
//TMC2209 variables
int current = 1000;
int stall = 255;
int motor_microsteps = 4;
int motor_steps_per_rev = 200;
void setup() {
// pinMode(SLIDE_MOTOR_DIRECTION_PIN, OUTPUT);
// pinMode(SLIDE_MOTOR_STEP_PIN, OUTPUT);
// pinMode(PAN_MOTOR_DIRECTION_PIN, OUTPUT);
// pinMode(PAN_MOTOR_STEP_PIN, OUTPUT);
// pinMode(TILT_MOTOR_DIRECTION_PIN, OUTPUT);
// pinMode(TILT_MOTOR_STEP_PIN, OUTPUT);
Serial1.begin(115200, SERIAL_8N1, 33, -1);
// INITIALIZE SERIAL2 UART FOR TMC2209
SERIAL_PORT_2.begin(115200); // INITIALIZE UART TMC2209, SERIAL_8N1, 16, 17
Serial.println(F("UART2 interface for TMC2209 intitialized @ 115200"));
Serial.println(F("---------------------------------------------------"));
//************************************************************************************************************************//
//TMCSTEPPER SETTINGS
driver_s.begin();
driver_s.pdn_disable(true); // Use PDN/UART pin for communication
driver_s.toff(3); // [1..15] enable driver_s in software
driver_s.blank_time(24); // [16, 24, 36, 54]
driver_s.I_scale_analog(false); // Use internal voltage reference
driver_s.rms_current(current); // motor RMS current (mA) "rms_current will by default set ihold to 50% of irun but you can set your own ratio with additional second argument; rms_current(1000, 0.3)."
driver_s.mstep_reg_select(true);
driver_s.microsteps(motor_microsteps); //note that MicroPlyer will interpolate to 256
driver_s.seimin(1); // minimum current for smart current control 0: 1/2 of IRUN 1: 1/4 of IRUN
driver_s.semin(15); // [0... 15] If the StallGuard4 result falls below SEMIN*32, the motor current becomes increased to reduce motor load angle.
driver_s.semax(15); // [0... 15] If the StallGuard4 result is equal to or above (SEMIN+SEMAX+1)*32, the motor current becomes decreased to save energy.
driver_s.iholddelay(3); // 0 - 15 smooth current drop
driver_s.intpol(true); // interpolate to 256 microsteps
driver_s.SGTHRS(stall);
driver_s.pwm_autoscale(true); // Needed for stealthChop
driver_s.en_spreadCycle(false); // false = StealthChop / true = SpreadCycle, Spreadcycle can have higher RPM but is louder
driver_s.internal_Rsense(false);
driver_s.TCOOLTHRS(0);
driver_s.TPWMTHRS(0);
//************************************************************************************************************************//
//************************************************************************************************************************//
//TMCSTEPPER SETTINGS
driver_p.begin();
driver_p.pdn_disable(true); // Use PDN/UART pin for communication
driver_p.toff(3); // [1..15] enable driver_p in software
driver_p.blank_time(24); // [16, 24, 36, 54]
driver_p.I_scale_analog(false); // Use internal voltage reference
driver_p.rms_current(current); // motor RMS current (mA) "rms_current will by default set ihold to 50% of irun but you can set your own ratio with additional second argument; rms_current(1000, 0.3)."
driver_p.mstep_reg_select(true);
driver_p.microsteps(motor_microsteps); //note that MicroPlyer will interpolate to 256
driver_p.seimin(1); // minimum current for smart current control 0: 1/2 of IRUN 1: 1/4 of IRUN
driver_p.semin(15); // [0... 15] If the StallGuard4 result falls below SEMIN*32, the motor current becomes increased to reduce motor load angle.
driver_p.semax(15); // [0... 15] If the StallGuard4 result is equal to or above (SEMIN+SEMAX+1)*32, the motor current becomes decreased to save energy.
driver_p.iholddelay(3); // 0 - 15 smooth current drop
driver_p.intpol(true); // interpolate to 256 microsteps
driver_p.SGTHRS(stall);
driver_p.pwm_autoscale(true); // Needed for stealthChop
driver_p.en_spreadCycle(false); // false = StealthChop / true = SpreadCycle, Spreadcycle can have higher RPM but is louder
driver_p.internal_Rsense(false);
driver_p.TCOOLTHRS(0);
driver_p.TPWMTHRS(0);
//************************************************************************************************************************//
//************************************************************************************************************************//
//TMCSTEPPER SETTINGS
driver_t.begin();
driver_t.pdn_disable(true); // Use PDN/UART pin for communication
driver_t.toff(3); // [1..15] enable driver_t in software
driver_t.blank_time(24); // [16, 24, 36, 54]
driver_t.I_scale_analog(false); // Use internal voltage reference
driver_t.rms_current(current); // motor RMS current (mA) "rms_current will by default set ihold to 50% of irun but you can set your own ratio with additional second argument; rms_current(1000, 0.3)."
driver_t.mstep_reg_select(true);
driver_t.microsteps(motor_microsteps); //note that MicroPlyer will interpolate to 256
driver_t.seimin(1); // minimum current for smart current control 0: 1/2 of IRUN 1: 1/4 of IRUN
driver_t.semin(15); // [0... 15] If the StallGuard4 result falls below SEMIN*32, the motor current becomes increased to reduce motor load angle.
driver_t.semax(15); // [0... 15] If the StallGuard4 result is equal to or above (SEMIN+SEMAX+1)*32, the motor current becomes decreased to save energy.
driver_t.iholddelay(3); // 0 - 15 smooth current drop
driver_t.intpol(true); // interpolate to 256 microsteps
driver_t.SGTHRS(stall);
driver_t.pwm_autoscale(true); // Needed for stealthChop
driver_t.en_spreadCycle(false); // false = StealthChop / true = SpreadCycle, Spreadcycle can have higher RPM but is louder
driver_t.internal_Rsense(false);
driver_t.TCOOLTHRS(0);
driver_t.TPWMTHRS(0);
//************************************************************************************************************************//
}
void loop() {
vTaskDelete(NULL);
}