Hello,
First off, if this is in the wrong forum, please move this post. I have a SM23165D that I'm working with, my use case demands that when the shaft is not in motion the torque brakes on the motor should not be engaged and the user should be backdrive the load attached to the motor. That is, MTB should not be engaged by default. If my understanding is correct, following G TWAIT with OFF should allow the shaft to be backdriven, but I find that is not the case in testing.
I've begun development on a C++ library that wraps some of the commands available through SMI. Below is a sample method in the SmartMotor class that moves the shaft to a position using position mode (MP.) Note that backdrive_ is set to true by default and the writeOut method writes the command to the motor via RS-232. I've confirmed that when the brk_str is left off from the cmd_str, the shaft will rotate and then stop, but the drive status indicator (LED0) will remain lit (solid green, AKA drive on) and the shaft will be locked in position. When brk_str is left on the cmd_str and brk_str=="OFF", motion never begins and thus the shaft remains unlocked, but the Trajectory Status Indicator (LED1) flashes on briefly.
Any suggestions would be greatly appreciated! I feel like I'm missing something painfully obvious.
Best,
Trevor
void SmartMotor::moveToPos (int pos, int acc, int vel, bool dir)
{
std::string dir_str;
std::string brk_str;
std::string acc_str = "ADT=" + std::to_string(acc);
std::string vel_str = "VT=" + std::to_string(vel);
std::string pos_str = "PT=" + std::to_string(pos);
// Set direction of shaft rotation
if(dir == true) {dir_str = "MINV(0)";} // Clockwise
else {dir_str = "MINV(1)";} // Counter-Clockwise
// Enable or disable torque brake based on backdrive_ member flag
if(backdrive_ == true) {brk_str = "OFF";}
else {brk_str = "MTB";}
std::string cmd_str = dir_str + " " + acc_str + " " + vel_str + " " + pos_str + " G TWAIT " + brk_str;
// Try to write out on an open comms channel
try
{
setMode(OpMode::POSITION);
writeOut(CMD + cmd_str + RTN);
}
catch(communication::CommsException &e)
{
std::cerr << "ERROR: " << e.what() << std::endl;
}
}