I don't understand how connect HS1 servo motor to arduino uno

Code get’s quite intricate and we cannot really troubleshoot it.
But if you claim that it works without the Gripper, I would investigate on the differences With and Without.

  1. When does it stop functioning, when you introduce code for the gripper OR when you physically connect your gripper ? (If it’s when you connect the gripper, even without any code for it, that might be an electrical problem)
  2. Maybe do a debug output of the code that send serial commands to the servo and monitor if the commands are really sent to them.
  3. Mixing libraries and functions might create incompatibility, you may want to command the LSS directly instead of using the library. (Serial.println() is a great function for that)

:slight_smile:

1 Like

When I introudce the gripper in the code it doesn’t function properly. When the gripper is connected physically even though its not introudced in the code the code works perfectly.

I use move function to send a sepcific postion to the LSS motors but I’m not sure how the serial command can be shown in Arduino when we have a serial communication between the Arduino and the LSS adapter.

do you mean using Serial.println() for moving the motor or for what exaclty?

1 Like

What are you using to control your gripper exactly ? (code / functions)
It’s clear to me that you have an interaction in your code.

The gripper is a normal servo and I am using a write function to give the open and close angles to the servo. I want to emphasize that the gripper is working in the integration of the project but the issue is with motor actuation and measurments

Maybe I don’t understand your problem then.

You claim that the LSS are working before adding your code for the gripper, this means for me that your added code has interaction with the code that control the LSS.

What are you using to control your RC servo ? (any other hardware and or libraries)

image

First, I wrote a code to test whether the LSS motors correctly follow inverse kinematics calculations. This code also measures the positions of the LSS servos, and it works well. (Note: While the gripper is physically connected to the Arduino, it is not activated in this code since it is not included.)

Then, I modified the code to include the gripper. The inverse kinematics calculations are still correct (i.e., the desired angles for the LSS motors are calculated accurately). However, the motors do not always move to the correct positions as commanded. For example, as shown in the attached picture, when θ1 is expected to be 90°, the motor instead moves to 0°. Additionally, the position measurements always return 0, regardless of the actual angle. Despite this issue, the gripper operates as expected, opening and closing as needed.

For the gripper, I am using the Servo.h library and the write() function to control it. The servo’s power (V+ and V-) is connected to an external power supply, while the control signal pin is connected to the Arduino. The ground of the power supply and the Arduino are connected to ensure a common ground.

The codes are quite long but here are they
Rory_Codes.zip (3.9 KB)

The first thing I would do is spit out your .move on the Serial port to see what’s been sent to the LSS servos.
It could be something with the SoftwareSerial as well.

I have just replaced the normal servo gripper with the LSS gripper, and for some reason, the system now works well. Could the normal servo have been affecting the LSS motors in some way?
I switched to using a normal servo gripper because the LSS gripper wasn’t performing as expected. I had specified open and close angles, but it failed to hold objects securely. Additionally, if an object was larger than the specified close angle, the LSS gripper would stop functioning immediately.

As I pointed out it is probably an interaction between the libraries.
The LSS use a library as well as the normal Servo so they could be interacting each other. If you only use the LSS library with the LSS gripper then you might overcome this issue.

For the LSS Gripper you will need the Current Hold function, this will stop and hold the servo.
The command for this would be [moveCH(int16_t value, int16_t ch_value)] where the ch_value is in mA of current. (Current Halt & Hold)

2 Likes