Needs Python support for LSS Adapter and Servos

Hey all,

My friends and I have been working on a BeagleBone Blue project(a spider robot with quadcopter features). We’v been planning and putting everything together and recently began making python modules that work with SSC32U. We were thinking about using UART on BBB to send servo commands to SSC32U which in turn sends PWM pulses to 24 KRS-2552 motors(which are also smart motors that work with PWM/Serial, but are made by a Japanese company and barely have any community support online). So we decided to give the new LSS motors and the LSS adapter a try. Since BeagleBone Blue has 3.3V logic level UART, we are using a logic level shifter to connect it to the LSS adapter’s Arduino Serial pins. I have looked through the whole Lynxmotion Wiki page and here are some questions I have:

  1. I know that that neither the Arduino nor the Python libraries are out yet. But our project is kinda short on time(due on May 17th). Our plan today is to program a python module that does the basic communication with the servos, such as sending position command and query. I just wanna make sure that the official python library is not gonna published any time soon so I won’t be putting in useless work.
  2. I was thinking if the LSS Communication for the motors are the same for TTL UART to the LSS adapters. The only LSS communication manual published on the Wiki seems to be for the motors, yet the motors are said to be “not used independently, must use a LSS adapter for communication”. I’m wondering if the BBB UART can successfully (and directly) communicate with the daisy-chained motors. (Since there is no user guide to communicate with the LSS adapter at all.)

We would really appreciate if any one can help us or provide us with enough info to potentially create a basic python library to communicate with LSS adapter or servos through TTL UART.

2 Likes

Hi,

Happy you’re going to give the LSS actuators a try! We’ll be here for you pre and post-sale.

  1. We won’t have the official Phython library ready in the next two or so weeks. We recommend that you have a look at these two examples created in Python for the SSC-32U:
    https://github.com/Lynxmotion/Arms/tree/master/Code%20examples/Python%20(RPi)
    Since the LSS protocol is heavily inspired by the SSC-32 / 32U protocol, it is compatible. You may want to switch to (tenths of) degrees though, by replacing all “P” comamnds with “D” and changing the values accordingly.

  2. There is no microcontroller onboard, so no separate commands or communication protocol. The LSS Adapter is effectively a UART TLL to USB pass-through for either an Arduino shield-compatible board, Bee module or other serial device. As such, there is only one “LSS Communication Protocol” and no guide needed for communicating with the LSS Adapter. As you indicated, the only change would be 3.3V to 5V.

For your application, based on what you’ve described, communicating with the LSS motors via BB Blue won’t necessarily require the LSS Adapter: an option would be to use the LSS Power Hub and connect the pins to the 3.3V to 5V board you’re using, ensuring common ground. Power could be supplied via barrel connector. Triple-check your connections, as well as the jumper to ensure there are no conflicts in power or something might burn.

Note that the LSS motors can be used as configurable RC (PWM) servos as well, and as such are compatible with the SSC-32U and each include an RC cable in the box.

3 Likes

Thank you so much for such informative response! It really resolves all our problems for now!

We will test out the servos when they arrive tomorrow and hopefully get the communication to work so we may start designing stl files for the robot.

We were using PWM control at first with SSC32U but we decided to switch to Serial because it allows position feedback. We want the BBBlue to obtain all servo positions at startup so it can stand up smoothly like a real spider.

We’ll definitely let you know if we have more questions.

3 Likes

Hey,

Looking forward to that! Please post some pics! :slight_smile:

Probably one of the best reasons to do so!

Plus, with a smart servo you’ll get to use other advance features, such as controlling maximum speed, angular range (with soft limits). Also, things like reading the current use to determine if a motor is producing little/no torque, some torque or a lot of torque. In a spider robot that can translate to something like “I just moved a limb, is there ground below my leg?” so you can adjust a gait live as you move.

Good luck with your project!

1 Like

Thank you for the suggestion! The current use feedback would definitely save us from installing touch sensors on each leg. I will post some pictures through out the project. Our website page for this project is here, which will be regularly updated til the project is done

2 Likes

No problem!

That’s the idea. It can also tell you other things based on the current measurement of all six legs, such as if you are on level ground (as if not, the weight will be distributed unevenly, leading to different torque requirements… in theory :stuck_out_tongue: ).

Thanks for the link, I’ll check it out later when home!

1 Like

Hello,

I’ve managed to send command from Beaglebone UART to LSS servos and they WORK like a charm! Thank you for ur help!

Rn I’m coding the position query stuff. Just one quick question: When I power off and on the servo and reconnect it to the LSS Config app on Windows, I notice that the position would sometimes come up as negative(-1230) or as positive(2370)(they change sign only when repowered and reconnected). The two numbers combine up to 3600 which makes sense. But I’m wondering if it’s normal for servos to return either of these values inconsistently after re-powering, so I may take safety measures in my program.

Thanks again!

1 Like

Glad to hear. Looking forward to see what you’ll be up to with them.

You will also notice the same situation if you send a reset command to the LSS, too.
While powered, the LSS can keep track of a large number of turns (a few hundred thousands… :smiley: ).

That being said, whenever it powers up (or does a soft reset), the “current position” will always be a value between -1800 and +1800. The reason is the magnetic encoder only offers an absolute position in a full circle. Any other position data is not be kept between power cycles.

Yes, quite normal (as mentioned above). And yes, you should be aware of this in your application code that makes use of the LSS.

I hope this helps clarify some of the details. Let me know if you have any other questions.

Hi,

I am trying to get the smart servo to move smoothly to a desired position, which I update every 0.015 seconds or so. I’ve played around, but I’m not exactly sure how to configure angular stiffness, motion control, etc. so that it moves smoothly. The servo jitters/the change is too abrupt, especially when it moves up against gravity. When it moves down, it is much smoother but still jitters a little.

Thanks!

@terrylu7121 Sébastien is out of the office today so I’ll answer in his absence. One of the many “smart” aspects of the servo is that it can handle the acceleration, deceleration and constant velocity for a motion path quite well. If you send it a small position update every 0.015s, it needs to calculate the motion profile for that “micro path”. You can deactivate that motion profile by sending an EM0 command. Ideally though if you have a desired end position, you’d send that position and either a speed or time modifier.

Angular stiffness is a measure of the servo’s rigidity around an end position, which translates to the “sag” / “damping”. Lowering the value (best between 0 and 4 in most cases) makes it less rigid.When going down, modifying the angular deceleration a bit might help.

@cbenson , @scharette
Hi, I think I posted my response in the wrong post, but here it is if you’re still interested: https://community.robotshop.com/forum/t/lss-python-libraries/45618/2?u=terrylu7121
Thank you for all your help during the project :slight_smile:

1 Like