Thumbnail

Lewansoul Servo

by LewanSoul

Control LewanSoul digital smart servos from the EZ-B UART or PC COM Serial Port

How to add the Lewansoul Servo robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Servo category tab.
  5. Press the Lewansoul Servo icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Lewansoul Servo robot skill.


How to use the Lewansoul Servo robot skill

Control the LewanSoul Digital smart Servos (i.e., LX-16A) with ARC. The servos must be powered appropriately and connected to the EZ-B v4 or IoTiny with the respective port. Visit the Config menu of this plugin to view the port configuration. This plugin will only operate on EZB Index #0.

Demonstrated with IoTiny using Software UART

Details

ARC's Virtual Ports (V1..V99) can be assigned to the LewanSoul servos.

  • This plugin requires the RX signal wire of the servo to be connected to the TX of the selected UART or digital port (if Software UART is selected) using a Dynamixel servo Cable provided by one of our hardware partners.

  • Hardware UART is available on the EZ-B v4 only and is recommended if using an EZ-B v4 with a Dynamixel servo Cable. View the EZ-B v4 datasheet to identify the UART ports (0, 1, or 2).

  • Software UART is available on both the EZ-B v4 and IoTiny. We only recommend using software UART on IoTiny and hardware UART on EZ-B v4.

  • The configuration menu also provides an option to select the Virtual Ports, which correspond with the ID's of the UBTech servos. If the LewanSoul servo ID #0 is connected, select V0. #1 = V1, #2 = V2, etc..

  • Default baudrate of LewanSoul servos is 115,200

Specify servo Port By servo ID

The servos are addressable, meaning they each have a unique address ID. The address ID is related to ARC's Vx servo (virtual servo). This means servo ID #1 is V1 in ARC. servo ID #5 is V5 in ARC. Etc. Specify the Vx ports to bind to using the configuration screen of this plugin. ID #1 (V1) is selected in the example image below. Any servo commands sent to V1 will move LewanSoul servo ID #1. You can choose as many Vx ports as necessary to bind in this plugin.

User-inserted image

Use USB/TTL Debug Board This option in the configuration is if you are using the optional TTL/USB debug board, which changes the communication to the servo. With this unchecked, the packet length includes the sent packet because the Rx & Tx are crossed. When checked (using the ttl board), the Rx & Tx will only include the return values. Keep this unchecked if you are not using a USB/TTL Debug Board.

Continuous Rotation (Motor) Mode

The servos can be configured for Continuous Rotation (i.e., Motor Mode) using the EZ-Script ControlCommand()...

ControlCommand("LewanSoul Servo", SetToContinuousMode, v1)

You can change the port (v1 in the above example) to whatever port you wish to be in continuous rotation mode. Once you do that, the servos will respond as regular, continuous rotation servos, where position 90 stops, 180 is fast in one direction, and 1 is fast in the other. The values further from 90 in either direction change the speed. This allows these servos to be used with the Continuous Rotation Movement Panel.

Servo Mode

If you switched the servo into Continuous rotation mode, you can use the ControlCommand() to change back to servo mode. This can be done with the following command...

ControlCommand("LewanSoul Servo", SetToServoMode, v1)

Reading servo Positions

If the servo is connected to the RX and TX of the selected hardware UART, the servo position can be read. This feature is available in both EZ-Script and Auto Position control. In EZ-Script, the GetServoRealtime() function will query the specified servo. Otherwise, the servos can be queried in the Auto Position config screen using the Realtime query button in the frame editor.

Servo Speed

The servo speed can be adjusted using any scripting servo Speed command or in any robot skill servo selection Advanced settings option. Check the servo section of your desired ARC scripting language in the support section for the servo Speed syntax. The value of the servo speed is between 0 and 30,000 in milliseconds. Setting the servo speed to 1000 will take 1 second to transition to the new position. Selecting the servo speed to 10,000 will take 10 seconds to transition to the new position.


ARC Pro

Upgrade to ARC Pro

Subscribe to ARC Pro, and your robot will become a canvas for your imagination, limited only by your creativity.

PRO
Canada
#9  

Project Looks Awesome, Thanks for the Bracket I am sure I will find some mounting use cases for it.

PRO
Synthiam
#10  

Oh boy - that mars rover is really really great. Heattroks, are you making one of those?!

#11   — Edited

Yes I am making one, I actually have 2 of my students helping me to build it, which is great because they are learning 3D printing, solidworks and how to program I'll post oocpictu once it's done, maybe even a video!

PRO
Synthiam
#12  

Oh yes! That'll be great to see. Ive been watching a lot of NASA documentaries on YouTube this past 2 weeks. Curious Droid's channel has been my go-to for space videos lately - he's very informative. Have you seen?

#13  

Not as much as a I used to anymore with work and everything else feels like I almost don't have enough time anymore, but I do try to keep up with what is going on. Yesterday actually, after 15 years the opportunity rover mission is over..:(

Canada
#14   — Edited

@Heattroks: Hello, I think we're working on the same project. Mechanically and electrically I finished a first testable version today.

User-inserted image

I am still a newcomer on the EZ-Robot platform. That's why my current solution for forward and reverse driving is as follows:

  1. insert the Costum Movement Panel
  2. forward command:
#Set continuous mode
ControlCommand("LewanSoul servo", SetToContinuousMode, v5)
ControlCommand("LewanSoul servo", SetToContinuousMode, v6)
ControlCommand("LewanSoul servo", SetToContinuousMode, v7)
ControlCommand("LewanSoul servo", SetToContinuousMode, v8)
ControlCommand("LewanSoul servo", SetToContinuousMode, v9)
ControlCommand("LewanSoul servo", SetToContinuousMode, v10)

#Read current global speed and save it in two variables 
#for right and left rotation respectively
$vor = (GetSpeed()/255*90)+90
$rueck = 90-(GetSpeed()/255*90)

#Assigning speed to servos
servo(V5, $vor)
servo(V6, $rueck)
servo(V7, $rueck)
servo(V8, $vor)
servo(V9, $vor)
servo(V10, $rueck)

#Aim steering at 0
servo(V1, 90)
servo(V2, 90)
servo(V3, 90)
servo(V4, 90)
  1. reverse command:
#Set continuous mode
ControlCommand("LewanSoul servo", SetToContinuousMode, v5)
ControlCommand("LewanSoul servo", SetToContinuousMode, v6)
ControlCommand("LewanSoul servo", SetToContinuousMode, v7)
ControlCommand("LewanSoul servo", SetToContinuousMode, v8)
ControlCommand("LewanSoul servo", SetToContinuousMode, v9)
ControlCommand("LewanSoul servo", SetToContinuousMode, v10)

#Read current global speed and save it in two variables 
#for right and left rotation respectively
$vor = (GetSpeed()/255*90)+90
$rueck = 90-(GetSpeed()/255*90)

#Assigning speed to servos
servo(V5, $rueck)
servo(V6, $vor)
servo(V7, $vor)
servo(V8, $rueck)
servo(V9, $rueck)
servo(V10, $vor)

#Aim steering at 0
servo(V1, 90)
servo(V2, 90)
servo(V3, 90)
servo(V4, 90)
#15  

This is really good!! thank you for the code, we are using a joystick to control it which makes it a lot easier. I am actually also making a CAD file to the EZB, once i have ill pass it over for your EZB. how did you make your shafts, or did you had someone else do them for you? also, where did you get the jumper cables to connect all of the servos?

Canada
#16   — Edited

The shafts are made of aluminum rods. This was cut to length. Then I drilled most of the holes for the screws (3.2 mm diameter). With some extinguishers I cut M3 threads.

I made the extension cables myself. These extend the original cables. In the next phase they have to be installed cleanly. (example)

Which joystick do you use?