Thumbnail

Lewansoul Servo

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

+ How To Add This Control To Your Project (Click to Expand)
  1. Make sure you have the latest version of ARC installed.
  2. Select the Get button in this page to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to ARC.
  5. Load ARC and press the Project -> Add Control button from the menu.
  6. Choose the Servo category tab.
  7. Press the Lewansoul Servo icon to add the control to your project.

Manual

Control the LewanSoul Digital 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.

*Note: This plugin in compatible with ARC 2019.06.25.00 or newer. 



Demonstrated with IoTiny using Software UART


Cable Accessory
This plugin requires a cable accessory to easily connect your servo to the EZ-B v4 or IoTiny. You can find the cable accessory in our store by clicking here


Details
The Virtual Ports (V1..V99) in ARC can be assigned to the LewanSoul servos.

- This plugin requires the RX signal wire of the servo be connected to TX of the selected UART or digital port (if Software UART is selected) using the Dynamixel servo Cable.

- Hardware UART is available on the EZ-B v4 only, and is recommended if using an EZ-B v4 with Dynamixel servo Cable. View the EZ-B v4 datasheet to identify the UART ports (0, 1, or 2). Datasheet can be found here: http://www.ez-robot.com/Tutorials/Lesson/18

- 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

- Discussion on these servos is here: https://www.Synthiam.com/Community/Forum/Thread?threadId=10643

Specify servo Port By servo ID
The servos are addressable, meaning they each have an unique address ID. The address ID is related to the Vx servo (virtual servo) in ARC. Meaning, 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. The example image below, the ID #1 (V1) is selected. This means any servo commands sent to V1 will move LewanSoul servo ID #1. You can select as many Vx ports to bind in this plugin as necessary.
User-inserted image



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

Code:

ControlCommand("LewanSoul Servo", SetToContinuousMode, v1)

You can change the port (which is v1 in the above example) to what ever port you wish to be in continuous rotation mode. Once you do that, the servos will now respond as regular continuous rotation servos, where position 90 is stop, 180 is fast one direction and 1 is fast in the other direction. The values further from 90 in either direction are 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 switch back to servo mode. This can be done with the following command...

Code:

ControlCommand("LewanSoul Servo", SetToServoMode, v1)


Reading servo Positions
If the servo is connected to both 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, in the Auto Position config screen, the servos can be queried using the Realtime query button in the frame editor.

Netherlands
#60  
DJ  it looks like the servo input read is working ok now with the latest update.
like to test more but need to sleep too sorry. and thanks.
#61  
Hey there...it seems like the problem still persists...I am trying to connect to the EZBPi server and get the following error message...

2019.06.28 11:21:23 +02:00 - Attempting connection on 192.168.178.73:23
2019.06.28 11:21:24 +02:00 - Connected to 192.168.178.73:23
2019.06.28 11:21:24 +02:00 - Reports CapabilityController
2019.06.28 11:21:24 +02:00 - Firmware 'Raspberry EZBPi v1' on 'Raspberry Pi (A, B, B+, Zero)' supports the following capabilities:
- Reports CPU temperature
- Read/Write Digital I/O Ports
- Hardware UART TX/RX with DMA buffer and adjustable baud rate
- Can stream video v4 codec
- Native WiFi Connectivity from ARC

2019.06.28 11:21:24 +02:00 - EZ-B temperature is 53.34149752948088100C
2019.06.28 11:21:24 +02:00 - Connection Failed: System.ArgumentException: Der PortName darf nicht leer sein.
Parametername: PortName
bei System.IO.Ports.SerialPort.set_PortName(String value)
bei LewanSoul_Servos.FormMain.initUART() in C:\My Documents\SVN\Developer - Windows\ARC skill plugins\Behavior_Control_LewanSoul_Servos\Kondo KRS Servo\FormMain.cs:Zeile 92.
bei LewanSoul_Servos.FormMain.FormMain_OnConnectionChange(Boolean isConnected) in C:\My Documents\SVN\Developer - Windows\ARC skill plugins\Behavior_Control_LewanSoul_Servos\Kondo KRS Servo\FormMain.cs:Zeile 34.
bei EZ_B.EZB.OnConnectionChangeHandler.Invoke(Boolean isConnected)
bei EZ_B.EZB.PWBq7NxRL1()
bei EZ_B.EZB.Connect(String hostname, Int32 baudRate)
2019.06.28 11:21:24 +02:00 - Disconnected
#64  
It all works now...I guess the problem was that I had an Error Message about the LewanSoul plugin on startup, ARC removed the plugin instance and I added a new one. So whatever this problem was, it will probably not happen ever again to anyone just updating to the new version and running the plugin!

Thank you so much for resolving this!!! This is great!!!:D
Netherlands
#66  
great work thanks mickey and dj.
Netherlands
#67   — Edited
i found a new problem 2 servo`s testing divert positions no problem after saving but when i use 3 or more servo`s the save data will not work anymore.
i think we need more time to get all the servo data ???
test this with Auto Position menu.
#68  
Thanks for the compliment but I did not do anything!:)

Thanks for helping to find bugs in this beta build @michelpet
Netherlands
#69  
i disconnect the d6 data from the servo and save the data from the screen this will work ok.
data read with d6 connected is not stable.
i am too new with this software to under stand how it works.
#70  
I did not try this yet...but maybe you can use a little script and put a timer, so there is a little pause after each servo position has been read?
But if you already found a way to save your positional data, you can also stick with your method I guess!
#71  
Trying to get this to work but getting the following. Any ideas?

User-inserted image
Synthiam
#72  
Try the latest update for this plugin. It seems the issue was with IoTiny. The IoTiny doesn't have hardware uart, but the default setting for the plugin is hardware uart so it gave an error. The plugin won't throw that error now. However, to use this on the IoTiny, you'll have to use one of the Software UART ports and deselect hardware Uart from the settings.
#73  
I'll give it a try DJ, thanks for the help.
#74  
Still having a bit of trouble here. I can not get it to recognize my servo.
-Using IOTiny
-I have my adapter plugged into port D0.
-Selected D0 for the software UART
-Assigned it to V1 (my servo identifier is #1)

Am I doing something wrong?

User-inserted image
Synthiam
#75  
Says not connected to ez-b in your screen shot. Is that just because it’s a screenshot or did you forget to connect to the ezb?

if not, that all should work. I can test tomorrow with an iotiny and see if there’s any trouble.
#76  
Yes, I was connected to the ez-b. All good there.
Synthiam
#77  
Works great with IoTiny. Check your wiring and power to ensure it meets the minimum requirements. Here's a video..

#78  
Well I have success, thanks for the tip DJ. I made my own cable and had the polarity reversed on the ground and signal traces. Luckily it did not damage anything. 
Once the cable was fixed it took a bit of playing to get it to work. I kept waiting for the control to say connected to ezb. On a whim, I added a horizontal servo control and when I moved it everything jumped to life. The Lewansoul control never does say connected to the ezb even though it works.
Synthiam
#79  
I updated the plugin and removed the "not connected to ezb" message - because it was confusing. That was there for debug when I was making it. So it's not relevant anymore. Thanks!