I have some problem with the servo speed control

In the previous version of MRLComm (less than 1412), the speed control was adding some delay (skip on the main loop) before incrementing the position toward the target position. This will create:

  • a linear speed control between a setSpeed of 0.0 and 0.99 (1.0 mean not using the speed control
  • The speed create have have nothing to do with the actual speed a servo can move. (ie a setSpeed(0.5) won`t be half the speed of a setSpeed(1.0)
  • The speed is influence by the load on the arduino (ie, having the oscope run on 1 pin will significately reduce the speed
  • One thing it do, is that it make any servo turn at the same speed when setSpeed < 1.0

When I have rework MRLComm for the latest builds, I have try to get rid of some problem that the speed control create

  • setSpeed is linear between 0.0 and 1.0
  • the speed setting is directly proportional the the speed the servo can rotate (ie a setSpeed(0.5) is half the speed of a setSpeed(1.0)
  • the speed is not as much influanced by the load on arduino (having some oscope run on some pins won't slow down the servo

With the new MRLComm some problem arise for the speed control

  • the time it require to do a main loop while the arduino have very light load is way much faster than with the old MRLComm, but under some load, the time for the main loop will increase a lot (because writing msg to MRL is a lenghty process for the arduino)
  • So even if I put back the old speed control, servo will turn at much highger speed but with some load, they may appear to go at random speed

The problem that Gael point out to me with the gesture files that already exist are

  • the speed resulting from the setSpeed command are much faster than previously
  • the speed control are not the same for every InMoov, especially if they use different servo. So two InMoov that want to dance tango will have hard time to syncronize themself together using the same gesture script

I can make a new method like setVelocity() that take an speed value so robot can be syncronized and go at the speed need, but that will required change in the gesture scripts and I'm looking if there is a way to not do that

GroG

8 years 2 months ago

The variation of the old way did not really "vary" that much in the sense that when gestures were made, nothing much else would be happening.

For example I don't think Gael turned on or off analog port polling, even Markus who had skin sensors, the analog polling is done on different boards.

To define the problem, is one step closer to solving the problem.

I think the problem is primarily of scaling.  I don't know the details, but I would guess its constant or linear factor.  

So if Gael's difference is derived from the current  method of speed, the result can be applied as the 'default'

How to derive? Perhaps print the values & timestamps of a move of both versions and compare ?

Just tossing around some ideas :)

Hi guys ! I don't understand what is the good syntax to set servo speed.

Since 1666 version it seem setspeed didnt'd have effect. So may I use setmaxvelocity ? betweew 0 and 0.99 ?

I have an other problem it seem I can't detach servo anymore, maybe I do a mistake somewhere , but just to know if is not yet implemented

cheers

Hi moz4r

I'm still working on this. I recently did some change again and waiting for Gael feedback to know if it work for him

To have the speed control working you need to set some parametters.

I'm using the term Velocity to describe the speed that a part will rotate, it`s in degrees/second

There is now two way to control the speed

servo.setVelocity() will force the servo turn so the body part will rotate at the set angular velocity

servo.setSpeed() will modify the angular velocity that you have set. So a setVelocity(10) and a setSpeed(0.5) will have the robot part rotate at 5 degrees/second.

At first I have set setSpeed to modify maxVelocity (wich describe the maximum speed a part can rotate) wich seem more logical, but it create problem with back compatibility

So to have the gesture that was working with MRL version before 1412, you will need to add

  • servo.setVelocity(X) for each of the servo you are using
    • X should reflect the speed at wich the part was rotating with setSpeed < 1.0) on the pre-1412 version. I have not test wich value it should have, but I believe it's around 5

But this is still work in progress trying to find a way to preserve old compatibility

 

Ok thank you for this infomations. It is a great idea to do a real control speed.

I think I did a mistake because you are working on. And use 1666

Go back to 1663 and now setspeed is working

See you

hairygael

8 years 2 months ago

Hi Calamity,

Just tested version 1667 to check speed settings.

I replaced all my: servo.setMaxVelocity(x)

by: servo.setVelocity(x)

The script loads correctly without error but when applying power to the servos, they all go to their max position resulting nearly braking things... Luckily I'm always ready to punch the RED button in such case. I only got a pinky finger broken.

I tried to apply a "Rest" gesture by voice command which was activated but the servos stayed at their max position. I 'm posting a "noworky" for you to check what can be wrong.

did you upload MRLComm that come with version 1667?

I think we should start to increase again MRLComm version number when doing some change to it

 

 

Hey no, did it change again, since 1.0.1412?

I will try that now.

By the way, I wasn't able to send the "noworky", It was giving a error message, maybe due to the wrong MRLComm.ino