Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Lynxmotion Smart Servos (LSS) are compact, modular and configurable actuators designed to be an evolution of the standard RC servo for use in multi-degree-of-freedom robotics. The servo lineup currently includes three “smart servos” which appear physically the same, sharing the same dimensions, mounting points and output spline, but differing in maximum torque and speed. 

...

The lynx motion has a simple serial protocol for controlling the motor, that is human-readable:

  1. Number sign #

  2. Servo ID number as an integer

  3. Action command (two to three letters, no spaces, capital or lower case)

  4. Configuration value in the correct units with no decimal

  5. End with a control / carriage return '<cr>'

Ex: #5PD1443<cr>

Additional Parts:

...

For controlling multiple servos, you will first need to give each motor a unique ID. You will need to attach each motor separately, and modify the code below to change it’s ID to a value between 0 and 253.

Code Block
languagec#
#include <LSS.h>
#include <SoftwareSerial.h>

SoftwareSerial servoSerial(8, 9);

// ID set to default LSS ID = 0
#define LSS_ID_old (254) // ID 254 to broadcast to every motor on bus
#define LSS_ID   (0) // the new ID 
#define LSS_BAUD	 (LSS_DefaultBaud)

// Create one LSS object
LSS myLSS = LSS(LSS_ID);

void setup()
{
   // set the data rate for the SoftwareSerial port
  servoSerial.begin(LSS_BAUD);
  // this is used to clear the serial buffer
  servoSerial.print("#0D1500\r");
  delay(1000);
  LSS::initBus(servoSerial, LSS_BAUD);
  // Uncomment next two line for factory resetchange ID 
    //servoSerial.print(String("#") + LSS_ID_old + String("DEFAULTCID") + LSS_ID + "\r");
  delay(2000);
}
void loop() {
}

Now you can control two motors at the same time:

Code Block
languagecpp
#include <LSS.h>
#include <SoftwareSerial.h>
SoftwareSerial servoSerial(8, 9);

#define LSS_ID1		(0) 
#define LSS_ID2		(1)
#define LSS_BAUD	(LSS_DefaultBaud)

// Create two LSS objects
LSS myLSS1 = LSS(LSS_ID1);
LSS myLSS2 = LSS(LSS_ID2);
int direction = -1

void setup() {
  servoSerial.begin(LSS_BAUD);
  // Initialize the LSS bus
  LSS::initBus(servoSerial, LSS_BAUD);
  Serial.begin(LSS_BAUD);
}

void loop() {
  // motor direction 
  myLSS1.wheelRPM(60*0-direction);
  myLSS2.wheelRPM(60*direction);
  delay(4000);
  // revers dierction 
  direction = -direction
}

Troubleshooting

A reset may sometimes be needed

Code Block
languagec#
#include <LSS.h>
#include <SoftwareSerial.h>

SoftwareSerial servoSerial(8, 9);

// ID set to default LSS ID = 0
#define LSS_ID_old (254) // ID 254 to broadcast to every motor on bus
#define LSS_BAUD	(LSS_DefaultBaud)

// Create one LSS object
LSS myLSS = LSS(LSS_ID);

void setup()
{

  // set the data rate for the SoftwareSerial port
  servoSerial.begin(LSS_BAUD);
  // this is used to clear the serial buffer
  servoSerial.print("#0D1500\r");
  delay(1000);
  LSS::initBus(servoSerial, LSS_BAUD);
  //  reset
  servoSerial.print(String("#") + LSS_ID_old + String("CONFIRMDEFAULT")+"\r");
  //change ID 
  servoSerial.print(String("#") + LSS_ID_old + String("CIDCONFIRM") + LSS_ID + "\r");
  delay(2000);
}
void loop() {
}

...