Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Using OFF to allow for backdrivability

Using OFF to allow for backdrivability 5 months, 1 week ago #2245

  • tsands
  • OFFLINE
  • Posts: 3
  • Karma: 0
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;
    }
  }

Re: Using OFF to allow for backdrivability 5 months, 1 week ago #2246

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
To get the motor to free wheel, you have to get MTB to turn off. Issuing the OFF command by itself will take the shaft out of servo lock, but MTB will still be active (as you have experienced).
To get the motor to truly free wheel without resistance, you must issue BRKRLS (even though you may not have a brake on the system) before issuing the OFF command. This will allow MTB to turn off allowing the motor shaft to rotate without resistance.
The following user(s) said Thank You: tsands

Re: Using OFF to allow for backdrivability 5 months, 1 week ago #2248

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
The TWAIT command only works when it is in a program that is downloaded to the motor. It will not work coming in as a serial command on the RS232 or RS485. The preferred workaround is to write a subroutine in the motor that you can pass values to from your host program and then call the subroutine with the GOSUB command (thus allowing the TWAIT command to operate in the motor).
If the shaft is still not free wheeling, try swapping the order of the OFF and BRKRLS commands.
Last Edit: 5 months, 1 week ago by csearcy.
The following user(s) said Thank You: tsands

Re: Using OFF to allow for backdrivability 5 months ago #2250

  • tsands
  • OFFLINE
  • Posts: 3
  • Karma: 0
csearcy wrote:
The TWAIT command only works when it is in a program that is downloaded to the motor.


Ah-ha! That was what was getting me hung up. I've since implemented subroutines to handle calls to execute motor motion with TWAIT and followed them up with brake commands. Everything's working as intended now.

Thanks!
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.43 seconds