Code Monkey home page Code Monkey logo

Comments (23)

ccourson avatar ccourson commented on September 27, 2024

Hello, Maxime,

I would have gotten to you sooner but have been quite busy.

BusServoInfoWrite affects all servos attached. I found out the hard way too. I just updated the README documentation on GitHub to warn about this. Each servo must be programmed individually with the BusServoInfoWrite command. Reading info from the servos must also be performed individually.

Temperature range 50C to 100C in 1C increments. Default is 85C. The 16-bit field value is expressed in Centigrade.
Voltage range 4.5V to 12V in 0.1V increments. Default is 4.5V(min) and 12V(max). The 16-bit field value is expressed in millivolts, 4500mV(min) and 12000mV(max).

I do not know if the servo will reset on its own once temperature or voltage return to normal. I'll have to test that.

I have not tested it but I believe the ServoOff command will toggle the servo on and off and any servo movement command will turn it on if it was off.

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

Thanks for getting back to me!

Other questions that I have would be:

  • I seem to have bricked a servo by doing a BusServoInfoWrite with id==0. Do you know any way around this?
  • Do you know how to turn the LEDs off? By default they seem to cycle through random colors
  • How robust do you feel the servos are? Any comments on durability, how easy it is for them to damage themselves if the arm tries to move past its limits?

from lewansoul-xarm.

ccourson avatar ccourson commented on September 27, 2024

Great questions.

Bricked?
Let's hope the servo isn't really bricked. When in doubt, perform a configuration of a servo using the Lewan-Soul xArm application. The configuration is performed from the Servo Test tab. As the pop-up warning will remind, connect only one servo at a time. I use the white serial cable between the controller board and bottom servo (ID:6) by disconnecting it from the servo and routing it back up to the PC side of the base. then remove all serial connections from the servo in question. Adjust the arm so that the free end of the serial cable going to the controller board can plug into the target servo. Either serial connector on the servo is fine. Use the xArm app to set the ID of the one servo you are configuring. Remember, all attached servos will be programmed. The BusServoInfoWrite command is a broadcast; which may be fine if one is configuring a number of these things simultaneously.

LEDs?
Configurable from the Servo Test tab of the Lewan-Soul xArm application. Clicking the LED control light icon will toggle all LEDs on and off. The Led warning properties box enables toggling of LED indications for over-heat, over-voltage and over-position. There is no control of the decorative activity of the LEDs aside from disabling LEDs altogether.

Robust?
Overall the xArm is very sturdy. It would be very suitable for a high-school robotics program. I'm glad you asked this question because I am beginning an article on the servos. Having not yet opened them, I cannot give an opinion. Soon. [If your servo is indeed bricked, I'd be interested in looking at it. I'd fix it for free if it is repairable.]

There's a stickiness to them. Could be a servo control feedback dead-zone thing. It may be that I have the U-joints too tight against the servo's rotor. This is one of my primary motivators to explore them.

I imagine them being analog with some tiny controller calculating position. They seem strong. The LX-15D servo is spec'd at 17kg/cm stall torque, I assume at 4.8VDC. That's pretty strong. It is spec'd at 240 degrees of rotation but when placed in motor mode, it will rotate continuously. A factor of a high-quality servo is that it has full metal gears and ball bearings, and it has them.

I think the biggest hazard for the servo is being manually turned too quickly. Not likely to happen but a fall from a table may strip a gear.

Since the limits are not really hard limits there's no issue with breaking at limits, however, the serial wires may be cut if caught between the U-joint frame and the servo body.

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

Fortunately the servos weren't bricked. The PC app brought them back to life as you suggested. The arm does seem sturdy and I'm generally pleased with the build quality.

The main issue I'm having at the moment is that I would like to soft limit the speed of the arm's movement. We're using the arm for deep learning research, and neural networks can send random commands to the arm. We can use inverse kinematics to block commands that would have the arm colliding with itself, but that still leaves us with commands that can be quite jerky and can make the arm make very fast movements with no speed limit. I'm afraid that will cause damage.

The command to move servos takes a time limit as argument, but what I really want is to specify the maximum rotation speed. The time limit isn't very useful when you don't know the current position of the arm. I could say "you have 100ms to move to this position", but I don't know whether that position is very close to the current one, or a full 180-degree turn away (which would cause the arm to swing very fast).

from lewansoul-xarm.

kretch avatar kretch commented on September 27, 2024

@maximecb , could you share some python examples for controlling the xarm? I'm still struggling to make mine work, even though the PC program seems to work well.

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

Sure thing @kretch. Here is the code I wrote. It reliably controls the arm position. Values are in the [-1, 1] range, and there is a SafeXArm class to constrain the allowed movement range a bit: https://gist.github.com/maximecb/7fd42439e8a28b9a74a4f7db68281071

from lewansoul-xarm.

kretch avatar kretch commented on September 27, 2024

Fantastic, @maximecb !
I was able to build the HID libraries on windows and use your script to control. Thanks a lot!

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

Happy to help :)

from lewansoul-xarm.

belliott-11 avatar belliott-11 commented on September 27, 2024

Hi @maximecb, I'm currently trying to implement facetracking using the xArm, raspberry pi, and a camera. I had a couple of questions:
How are you running your python program, through a microcontroller?
Is it possible to to tell the arm to rotate to a specific degree? For example, if a person standing in front of the arm moves 5inches to the right, now we want the arm to rotate "x" degrees to be centered with the persons face.

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

@belliott-11 the Python program is running on a laptop or desktop computer. The xArm is connected through a USB port. You could probably run it on a raspberry pi or Jetson Nano as well.

Yes, you can definitely rotate the arm to a specific angle. You just have to set the direction angle of the servo corresponding to the lowest joint. The angles are in degrees.

from lewansoul-xarm.

belliott-11 avatar belliott-11 commented on September 27, 2024

@maximecb Thank you for your reply. I can accomplish this with the move_all() function in your python code? What would the arguments look like: arm.move_all(?)

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

@belliott-11 See this line here for an example. I think the values are in the range from 0 to 1000, with 500 being in the middle.

from lewansoul-xarm.

belliott-11 avatar belliott-11 commented on September 27, 2024

@maximecb Ok thanks! I have another question about the installations. I ran "choco install libhidapi-hidraw0 libhidapi-libusb0" (using chocolatey since I am running windows) and I received an error that said :

"libhidapi-hidraw0 - libhidapi-hidraw0 not installed. The package was not found with the source(s) listed.
Source(s): 'https://chocolatey.org/api/v2/'"

Do you know how I can install? Thanks again for the help!

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

I don't know. I'm on Ubuntu Linux. I haven't really touched windows in years ;)

from lewansoul-xarm.

AndresRoc avatar AndresRoc commented on September 27, 2024

Fortunately the servos weren't bricked. The PC app brought them back to life as you suggested. The arm does seem sturdy and I'm generally pleased with the build quality.

The main issue I'm having at the moment is that I would like to soft limit the speed of the arm's movement. We're using the arm for deep learning research, and neural networks can send random commands to the arm. We can use inverse kinematics to block commands that would have the arm colliding with itself, but that still leaves us with commands that can be quite jerky and can make the arm make very fast movements with no speed limit. I'm afraid that will cause damage.

The command to move servos takes a time limit as argument, but what I really want is to specify the maximum rotation speed. The time limit isn't very useful when you don't know the current position of the arm. I could say "you have 100ms to move to this position", but I don't know whether that position is very close to the current one, or a full 180-degree turn away (which would cause the arm to swing very fast).

Hello Maximecb,
Were you able to get real-time feedback? from these servos? I've bought a kit of these for my self-designed 6DOF robot, I want to use it for some deep learning as well. And for me 100ms for feedback is a bit slow. What would you recommend?
Best n stay safe,

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

I got position feedback but there's an issue that makes the feedback not always come at a regular interval. Unfortunately it wasn't usable. I think that the issue is likely with the controller board for the xArm... So you could conceivably make your own with an arduino or ESP32 to interface with the servos serial bus directly and avoid that problem.

from lewansoul-xarm.

igmemb0 avatar igmemb0 commented on September 27, 2024

@maximecb Hey I appreciate the service your giving here! I have a few questions

  1. Is it possible to use the same code you gave here through a UART on the Pi, I'm trying to implement hand tracking and maybe that will be easier? Have no clue to be honest lol

  2. I'm getting an error that says "easyhid.easyhid.HIDException: Failed to open device" i have the usb connected but its giving me this error. Maybe the usb is in the wrong spot. It is a usb to micro usb connector with the micro usb going inside the xArm

Thanks for your service
Greg

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

@igmemb0 I'm going to guess the easyhid package doesn't support the raspberry pi properly. Otherwise, it could be that your USB cable isn't working. I would start by testing the USB cable with the xArm on a mac/PC to make sure that works. Some cheap USB cables are only good for charging, they can't transmit data.

If the easyhid package doesn't work on the raspi, you could implement the protocol used by the servos using i2c I think. LewanSoul provides some documentation on how to interface with the servos, without the controller board the xArm uses. That will be extra work though. Another alternative would be to use a serial connection to the board.

from lewansoul-xarm.

igmemb0 avatar igmemb0 commented on September 27, 2024

@maximecb yeah i'm guessing that. I found some code that is supposed to interface with the UART of the pi, and currently i'm trying to use the code you provided here and the other script to get the xArm functioning with the protocols given by LewanSoul. I'm kinda lost though. Do you mind looking over the code? A forum on the raspberry pi site said its functioning code, but its not functioning for me. Even with my UART enabled haha. I'm reaching here, but any help is always appreciated.

from lewansoul-xarm.

maximecb avatar maximecb commented on September 27, 2024

Hm I can look but it's been a while since I played with the xArm.

If the UART on your rpi is not working, you can get USB to TTL adapters on ebay or aliexpress for a few dollars. That's another option too.

from lewansoul-xarm.

ccourson avatar ccourson commented on September 27, 2024

Just a point of interest, I've started building an Arduino library at https://github.com/ccourson/xArmServoController.

from lewansoul-xarm.

ccourson avatar ccourson commented on September 27, 2024

For NodeMCU and RPi, be sure to use level shifters between them and the xArm.
https://www.adafruit.com/category/864

from lewansoul-xarm.

ccourson avatar ccourson commented on September 27, 2024

I'm going to close this issue and ask that you continue this discussion at https://github.com/ccourson/xArmServoController. This repository will eventually close and the new xArmServoController repository is where the latest code is.

from lewansoul-xarm.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.