How to control M100RAK via a PC :)

Hi everybody, :slight_smile:

I would like to know if it’s possible to send commands via my own program (python)
to the robot/servo to move, rotate the motor, etc …? And if yes, how does it work, how send commands, is there a manual, API?

I am a beginner with robots, so anything you can tell me would be welcome! :smiley:

Regards
R2D2

Hi Cbenson and thank you for your answers.

Ok for the SSC-32, but I am a developer, and I don’t know much about electronics…
Is it difficult to plug the servos to the controller? What do we have to now? Just plug the 4 servos to the 0,1,2,3 controller connectors?

And does the servo provide itself output shaft movement? Or is it to me to program it in my software?

Thank you

Thank you again,

Ok, I saw in the manual about VL=VS :

This jumper allows powering the microcontroller and support circuitry from
the servo power supply. This requires at least 6vdc to operate correctly. If
the microcontroller resets when many servos are moving it may be
necessary to power the microcontroller separately using the VL input. A
9vdc battery works nicely for this

So can i use a wall adapter 9VDC for both?
(so plug the jumper VL=VS, and plug the adapter to VS1) Even if my servos should not have more than 6VDC?

Ok thank you for these details. Ok so power supply (6V) for both is ok? Or it is dangerous, cause if power supply accuracy is not good… for example 6.1V or 5.9V…
cause microcontroller need 6V-9V and servos need 4.8V-6V.

I have read SSC-32 and M100RAK manuals, and I have some questions :

  • SSC-Man-page4 :
    The SSC-32 lets you use this extra range. A position value of 500
    corresponds to 0.50mS pulse, and a position value of 2500 corresponds to a 2.50mS
    pulse. A one unit change in position value produces a 1uS (microsecond) change in
    pulse width. The positioning resolution is 0.09°/unit (180°/2000).
  1. In the M100RAK case, it is said that the HS-785HB servo can rotate 252° because the arm cannot mechanically allow the joints to rotate 360 degrees because of aluminum tube which block the rotation. But in the HS-785HB servo specification, it is said that they can rotate 1260°.

So how can we calculate the rotation per unit?
252°/2000 so 0.126°/unit?
or
1260°/2000 so 0.63°/unit?

  1. Same question about position, still in HS-785HB servo specifications : only pulses between 600us
    to 2400us correspond to a position
    .

2400us correspond to 252° or 1260°?

Thank you again for your help.
Sorry for these questions, but I need to know how it works, before to tell my company to order several robots.

Is it possible to change this ratio on the servos (to allow more than 252°)? is there any setting, adjustment on the servos?

Ok so MIN:100uS and MAX:2000uS?

  • If we command P2000 then P1000 then P1500 then P500, The servos knows in which direction of rotation he has to go? to the right, then to the left, then to the right…

  • And just to know, I don’t understand what “Digital Inputs” are…

Ok perfect,

Ok, but for the bottom servos can rotate 1260° initially, so it’s his support which blocks the rotation to 252°? Why it is impossible to rotate the bottom servos to 360°? (the aluminum axis doesn’t block the movement)

Ok, and if you send a signal/command to go to a position higher than 252° (5:1 case) for example #0 P2501 …” does it hurt the servos?

Ok, and for the command syntax, what range for S parameter?
"#5 P1600 S400 " ?
"#5 P1600 S750 " ?
"#5 P1600 S2400 " ?

Ok perfect,

I think I know enough to controlled the robot for basic movements!
Thank you, I will order one, I hope I will not have other questions :slight_smile:

note : for the 3:1, if I need it in the future, I will order later

Thank you very much for your time.
Sylvain

Hi,

I have received and mounted my M100RAK and I’m using it for more than a month.
It’s really easy to send commands and to use it thanks to your help!

Just one thing, the arm make some noise on certain position/movement.
Not servo motor noise, but little crunches from axis, it depends on inclinaison and speed.
It’s not from the servo motors but i think from the articulation, metal axis, bearings,…

So, is there something that you advise to stop this crunches, and to have smoother motion?
I thought grease or oil on bearing, aluminium axis… ?

Regards

In addition to the arm, we suggest an SSC-32 servo controller, a USB to serial adapter and a computer power supply. The SSC-32 takes normal serial commands, so you can use whatever programming language you want. You can see the manual under “Useful Links”.

Not at all - just ensure you have the correct orientation (red wire to VS, black to GND and yellow to “Pulse”.

  1. Assemble the arm according to the video
  2. Plug the computer power supply (5V output and GND) to the SSC-32’s VS1 screw terminal.
  3. Plug a 9V battery to the VL screw terminal, and remove the VL=VS1 jumper.
  4. Note that when you finally attach the last gear, you need to position the servo via the computer / SSC-32.

It’s up to you to program the motion. You can start with Lynxterm, a free software to operate the SSC-32. Note that you will need to read the user guide for the SSC-32 entirely (ask questions here if needed), as well as the user guide for the M100RAK. It’s better to be safe than to burn the electronics.

No. Servos need to be powered at between 4.8V and 6V. A 9V supply would burn all the servos within a few seconds. You can get away with using a 6V power supply, which is the lowest voltage the microcontroller can handle, however most standard 6V wall adapters cannot provide the necessary 20A required by all four servos simultaneously in operation, which is why we suggest a computer power supply.

A regulated 6V supply is fine. Lynxmotion uses 4xAA NiMh battery packs which can have a charged voltage of ~6.3V and it does not seem to damage Hitec servos. A 7.4V LiPo pack would burn them. When the voltage drops to about 5.8V, the microcontroller might lose power. The issue is that the on-board voltage regulator has a dropout voltage, so you need to feed it about 1V higher than 5V.

252°/2000 so 0.126°/unit? - for the servo mounted in the arm using the 5:1 gear ratio
1260°/2000 so 0.63°/unit? - for the servo on its own (not in the arm).

The SPG785 is a power gearbox. The normal 785HB servo can rotate 1260 degrees, and the arm uses a 5:1 gear ratio, reducing the total angle to 252 degrees. A pulse of 600ms corresponds to 0 degrees and a pulse of 2400ms corresponds to 252 degrees. Note that pulses of between 500 and 600ms and 2400 to 2500 corresponds to continuous rotation. The 785HB is very unique in that is can rotate to specific angles between 0 and 1260 degrees but also rotate continuously.

When mounted on the arm (using the 5:1 gear ratio), it would correspond to 252 degrees. If you operate the servo on its own, it corresponds to 1260 degrees.

Happy to help.

You are correct. the base servo is not physically restricted and can (in theory) rotate 360 degrees. However, if you want position feedback, you are limited to 252 degrees because of the 5:1 gear down. (there is no signal you can send to get it to move to 360 degrees). Note that wires will also tangle eventually.

Yes, it will damage most servos.

Its just a speed value and corresponds to the servo’s maximum speed. “A speed value of 100uS per second means the
servo will take 10 seconds to move 90°. Alternately a speed value of 2000uS per second equates to 500mS (half a second) to move 90°.”

The 785HB can rotate at up to 1.38 seconds per 60 degrees.

We included 5:1 gears to produce the greatest torque possible. You would need a 3:1 gear ratio in order to get over 360 degrees of rotation. We may be able to special order this for you, but unfortunately we cannot swap it out in the kit, so it would need to be ordered separately.

Max is 2.07 seconds per 90 degrees of servo rotation (which is 5 times less when mounted in the arm). Min is not specifying a speed at all.

Yes. Each servo has electronics at the bottom which take care of all of that.

This is a bit hard to explain in a simple forum post. Take a look on Wikipedia and in the GoRobotics Tutorial.

Enjoy - for the size and power, the value is unbeatable!

Correct. However, as you pointed out, you should really not be sending signals for the servo to rotate continuously, except perhaps for the base, but even then the wires will get caught.

Recall the equation before:
“A speed value of 100uS per second means the servo will take 10 seconds to move 90°. Alternately a speed value of 2000uS per second equates to 500mS (half a second) to move 90°.”
Therefore what is the delay needed for the servo to take 2.07 seconds to rotate 90 degrees? :astonished:

Honestly though, the speed value is not really needed - the arm does not move very fast at all; it’s not like an industrial arm which puts together cars.

You need to control all angles. Although it’s good to prepare beforehand, our suggestion is to actually have the SSC-32 and a 785HB in hand to play with.

Can you narrow down where the noise is coming from? The bearings are sealed and pressed into place. Check to see if there is anything caught in the teeth of the large / small gear (or if the teeth are worn at all), and also check that they are in contact perfectly. Next, check the shafts to see if the set screw has moved or rubbed against it. As with any mechanical device, check each joint to see if it has moved slightly or if anything has become loose.

You will find here the manual for the SSC-32 controller: robotshop.com/content/PDF/users-guide-ssc-32.pdf You should find all max and min values there. We recommend you experiment with pulse lengths in order to know where the motor will move to. As for mechanical limits, we recommend that you test all the joints and find min and max values for each one and implement some safety so not to exceed those.

Ultimately, I have another question :

M100RAK man :

  • pulses between 600us to 2400us correspond to a position. A pulse of 500us will cause the motor
    to rotate at full speed in one direction while a pulse of 2500us will cause
    the motor to rotate in the opposite direction.*

I start to write my python functions to test if commands values (PXXXX, SXXXX, TXXXX) are between accepted value, So I need to know the min and max uS I can send to my controler…
So can you check if it’s correct please :

**MIN_POSITION = 600
MAX_POSITION = 2400

MIN_CONTINUOUS_SPEED_CLOCKWISE = 500 # fast
MAX_CONTINUOUS_SPEED_CLOCKWISE = 599 # slow

MIN_CONTINUOUS_SPEED_ANTI_CLOCKWISE = 2401 # fast
MAX_CONTINUOUS_SPEED_CLOCKWISE = 2500 # slow**

I didn’t understand last time when you said :

there is no max and min value? the controler accept anything?
MIN_SPEED = ???
MAX_SPEED = ???

And about max time, min time (to go to a position in x time) is there limitation for TXXXX?
MIN_TIME = ???
MAX_TIME = ???

*Note that the arm cannot mechanically allow the joints to rotate 360 degrees, so please be
cautious about which signals are sent. *

I’m not sure so, HS785HB can rotate 1260 put when it’s plug/mounted/set on a SPG785A-5.0 Servo Gearbox, it can rotate only 252. So we don’t need to control if it can tuch the tube because it’s only 252…?