I have 2 T249’s that are seemingly randomly setting their safe start violation bits. In the control center I am not seeing any Vin, Serial, etc. errors that are expected if it’s power or data problems. The Tic Control Center only shows counts coming from safe start violations and ERR line High from the other Tic. The Tic does not seem to be resetting, as the up time exceeds multiple hours.
Tic Settings:
tic_settings_for_forum.txt (1.4 KB)
I am using the sample arduino code I2C Multi, with the only changes to comment out all movements, add exit safe start to the timeout command call, and change tic numbering from 14/15 to 13/14. Here is a copy of the code:
Admittedly, my I2C bus is ridiculously long, but I’d expect if this was causing the error, that I would see serial errors as well. I plan to add pull-up resistors per the I2C manual tech note, but having trouble finding a good way to estimate bus capacitance. Please let me know if my assumption is flawed and I should do this right away.
Note: I know that I can disable the safe start, but I like the safety feature it adds and would prefer to have it work than disable it.
// This example shows how to send I2C commands to two Tic Stepper
// Motor Controllers on the same I2C bus.
//
// Each Tic's control mode must be set to "Serial/I2C/USB". The
// serial device number of one Tic must be set to its default
// value of 14, and the serial device number of another Tic must
// be set to 15.
//
// The GND, SCL, and SDA pins of the Arduino must each be
// connected to the corresponding pins on each Tic. You might
// consider connecting the ERR lines of both Tics so that if
// either one experiences an error, both of them will shut down
// until you reset the Arduino.
//
// See the comments and instructions in I2CSpeedControl.ino for
// more information.
#include <Tic.h>
TicI2C tic1(13);
TicI2C tic2(14);
void setup()
{
Wire.begin();
delay(20);
tic1.exitSafeStart();
tic2.exitSafeStart();
}
void resetCommandTimeout()
{
tic1.resetCommandTimeout();
tic2.resetCommandTimeout();
tic1.exitSafeStart();
tic2.exitSafeStart();
}
void delayWhileResettingCommandTimeout(uint32_t ms)
{
uint32_t start = millis();
do
{
resetCommandTimeout();
} while ((uint32_t)(millis() - start) <= ms);
}
void loop()
{
// tic1.setTargetVelocity(2000000);
// tic2.setTargetVelocity(0);
delayWhileResettingCommandTimeout(1000);
// tic1.setTargetVelocity(0);
// tic2.setTargetVelocity(1000000);
delayWhileResettingCommandTimeout(1000);
// tic1.setTargetVelocity(-1000000);
// tic2.setTargetVelocity(0);
delayWhileResettingCommandTimeout(1000);
// tic1.setTargetVelocity(0);
// tic2.setTargetVelocity(-2000000);
delayWhileResettingCommandTimeout(1000);
}