Welcome, Guest
Username Password: Remember me
Messages posted to this category need to be reviewed by the moderator before it gets posted.
  • Page:
  • 1

TOPIC: Programmatically Initializing Smart Motors on Power Up

Programmatically Initializing Smart Motors on Power Up 10 months, 2 weeks ago #2193

  • diglesia
  • Duncan
  • Posts: 4
  • Karma: 0
I currently have seven SMI motors daisy chained, all of which are communicating on RS232 and am looking for help on how to automate the initialization task programmatically. Functionally everything works as intended, however, on power up the motors all display the red LED. So far the only way to resolve this to green is to open the SmartMotor PlayGround and manually perform the following steps:

  • Connect Motor
  • Clear Flags
  • Disable Software Limits
  • Disable Hardware Limits (Left/Right)
  • Disconnect Motor
  • Connect Motor

At this point the LED is green and the motors function fine. I have tried globally addressing the motors and resetting the errors and disabling the software limits using several permutations/combinations of
which works only if the motors seize (LED = red) during an operation. It does not work on initial power up. I would like to emulate what the SmartMotor Playground is sending to the motors without having to manually repeat this process each time. I am masters student and am passing my work on to the next generation of students, so I need to make it robust.

This post is similar to that posted by bknittel titled "RS232 Communication Lockup" three weeks ago. Using a 'serial sniffer' to catch the commands being sent to the motors. However, this doesn't seem like the right approach.

Any help would be much appreciated.


Re: Programmatically Initializing Smart Motors on Power Up 10 months, 2 weeks ago #2196

  • csearcy
  • Posts: 480
  • Karma: 23
The only other thing I can think of that the Playground and SMI do is the ECHO command. The default on power-up is ECHO_OFF.
The following user(s) said Thank You: diglesia

Re: Programmatically Initializing Smart Motors on Power Up 9 months, 2 weeks ago #2199

I use an Arduino Mega to do this, which has a function to initialize the motor on startup. The Mega uses Serial port # 1, which is connected to a standard MAX232A type RS-232 interface chip, which is in turn connetced to the motor. Not sure if this will be of any help, but here's the code.

void initMotor() {                         
    Serial1.print(128);                 // global warning
    Serial1.println("WAKE Z");           // wake up gearhead
    Serial1.println("OCHN (RS2,0,N,9600,1,8,C)");    // just in case, open the RS232 control port
    Serial1.println("BAUD9600 TALK OFF ");         // set baud, talk, turn off servo
    Serial1.println("UCI UDI");                  //Confiugure limit switch inputs
    Serial1.println("MP");                      // set to position mode "MP"
    Serial1.println("AMPS=1000");               // limit motor to 100% current capacity 
    Serial.println("finished initializing motor...");
    delay(100);                        // wait a bit
Last Edit: 9 months, 2 weeks ago by terminalcity. Reason: typo
The following user(s) said Thank You: csearcy
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.41 seconds