loading
 
pololu miro-maestro is not discerned
jacquesrg from Paraguay  [16 posts]
6 years
Hi,
I bought the licence of the last roborealm version and I have a problem with pololu micro-maestro.
I read the phorum and seen a exe to give one file log of analysis.
Of this kind:

Concentrateur USB racine - USB\ROOT_HUB&VID8086&PID24C7&REV0002
Concentrateur USB racine - USB\ROOT_HUB&VID8086&PID24C4&REV0002
Concentrateur USB racine - USB\ROOT_HUB&VID8086&PID24C2&REV0002
Concentrateur USB racine - USB\ROOT_HUB20&VID8086&PID24CD&REV0002
Périphérique USB composite - USB\Vid_05e1&Pid_0408&Rev_0005
Syntek STK1160 - USB\Vid_05e1&Pid_0408&Rev_0005&MI_00
Périphérique audio USB - USB\Vid_05e1&Pid_0408&Rev_0005&MI_01
Périphérique USB composite - USB\Vid_1ffb&Pid_009f&Rev_0102
Pololu Micro Maestro 6-Servo Controller Command Port - USB\Vid_1ffb&Pid_009f&Rev_0102&MI_00
Pololu Micro Maestro 6-Servo Controller TTL Port - USB\Vid_1ffb&Pid_009f&Rev_0102&MI_02
Pololu Micro Maestro 6-Servo Controller - USB\Vid_1ffb&Pid_009f&Rev_0102&MI_04

Best regards,
jacques
Anonymous 6 years
Jacques,

Thanks for that info. We've updated that module to use the 6 servo controller that you mention above. Please download 2.42.20.

Thanks!
STeven.
jacquesrg from Paraguay  [16 posts] 6 years
Hello STEVEN,
thank you very much for your indication. I recharged the last version in 2.42.21.0 and servos answers.
There remains a problem, I believe in script?
Stocks read on Center of Gravity are too weak:
- COG_X = 162
- COG_Y = 140
But I am not exactly in the centre of picture.
For servos, the centre is 1500.
It would seem that a multiplier of x10 is missing?
Thank you for your help.
Have a good day.
Jacques
jacquesrg from Paraguay  [16 posts] 6 years
Hello STEVEN,
I perhaps badly expressed myself.
When I link servos on COG, they both leave in extreme position minimum.
Stop, they come back to the neutral point.
Perhaps that I how did not understand regulate, docs is in English and I need to translate online. It is not very good.

Best regards,
Jacques
Anonymous 6 years
Jacques,

You have to scale the value before sending it  to a servo. So use a VBScript module with

halfWidth = GetVariable("IMAGE_WIDTH")/2
SetVariable "servo", (((GetVariable("COG_X") - halfWidth)*1000)/halfWidth)+1500

which should scale the COG_X to 500, 2500 with 1500 being neutral.

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
Helle STeven
I installed your script, here is data were acquired in variables:
- IMAGE_WIDTH = 320
- SERVO = 1362
- COG_X = 138
- COG_Y = 134
- PAN_SERVO = 675
- TILT_SERVO = 675  
Limits servos 675 and 2276 Neutral 1519
The target not being exactly in the centre, the value of variable SERVO seems correct (1362).
In the bet in action of servos, they always leave in extreme position ??
The stop well makes go them back to the centre.
If both variables COG_X and COG_Y were multiplied by 10, it would give logical data for servos.
Of that think of it to you?

Jacques
jacquesrg from Paraguay  [16 posts] 6 years
Hello STeven

I thought of making this modification:

halfWidth = GetVariable("IMAGE_WIDTH")/2
SetVariable "servo1", (((GetVariable("COG_X") - halfWidth)*1000)/halfWidth)+1500
halfheight = GetVariable("IMAGE_HEIGHT")/2
SetVariable "servo2", (((GetVariable("COG_Y") - halfheight)*1000)/halfheight)+1500

This time servos accepts data which work.
It is not perfect, there is a small swing, but I think that this comes from the mechanical trial assemblage which vibrates a bit.

If you have another resolution?

Thank you very much,
Jacques
Anonymous 6 years
Jacques,

That seems about right for a two axis pan/tilt.

For some more advanced predictive movements you can have a look at the scripts on

http://www.roborealm.com/help/Trossen_Robot_Turret.php

at the bottom of the page. Different hardware but same concept.

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
Thank you very much, STeven.

jacques
jacquesrg from Paraguay  [16 posts] 6 years
STEVEN

Desolate to insist, but I paid a licence and I would like I shall manage my plan.

there remains a problem with roborealm module for micro - pololu.
Why data are not between 0 and 255 with 128 as neutral?
Other modules have these data every.
With 500 - on 2500, they do not fall in the data of variable COG_X COG_Y and I tried what you recommended me to trosen. Also, all data are from 0 to 255.

Jacques
Anonymous 6 years
Jacques,

The difference is created by the hardware vendors. We have no control over if they use 0 to 255 or 500 to 2500. This is NOT something that we control and it is easy enough to convert between the two by changing some numbers. Note that 500 to 2500 is preferred as you have higher resolution control but that's not always the case. The first SSC controller used 0 to 255 which many have kept. But some have moved to 500,2500 as that better reflects the actual servo timing period.

Your formula above would then be

halfWidth = GetVariable("IMAGE_WIDTH")/2
SetVariable "servo1", (((GetVariable("COG_X") - halfWidth)*255)/halfWidth)+128
halfheight = GetVariable("IMAGE_HEIGHT")/2
SetVariable "servo2", (((GetVariable("COG_Y") - halfheight) 255)/halfheight)+128

Or if you don't like using the formulas you can use 2x the following module with the appropriate numbers.

http://www.roborealm.com/help/Scale_Variable.php

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
STEVEN

Now it is clear.
Ok, this walks with Scale_variables!
Now, how take away the 6 figures after the point?
Example 1250.778894 in the billing of variables.
Afterwards, promised, I ask for nothing more ; -)

Jacques
Anonymous 6 years
Jacques,

You can use

variable = CInt(variable)

Alternatively you can also check out

http://www.roborealm.com/help/Differential_Drive.php

(Sorry, forgot we had that module)

STeven.
Petr from Czech Republic  [13 posts] 6 years
I think there is a bug in the "Creating Opposing Left and Right Output" checkbox. If I check it, it fix variable of Right motor to 500 and never let it change.
jacquesrg from Paraguay  [16 posts] 6 years
Hi
It is what would explain that servos always leaves in extreme position at the end of some seconds?
Jacques
Anonymous 6 years
Jacques,

The differential drive module has been fixed but it does NOT explain why your servos would suddenly move to extreme positions. What DOES explain that behavior is a power issue. When some boards/servos do not have enough power to  power the servos you will get twitches than happen ever so often that seem very spuratic. You will need ensure that the Maestro has a battery pack connected with enough power to drive the connected servos. Or if you do already change out the batteries to new ones.

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
STeven
I have a feeding 5 volts - 4,8 Amperes to feed servos and plate maestro. I do not have fall of voltage.
When I start servos, it begins by turning in a circle around the target (immobile for tests), then servos two leave in position minimum.
I am going to take back my tries with a pololu on serial port to compare.
Possible also that this comes from vibrations of interim assemblage. I ordered a turret Pan-tilt PT2 to Endurance R/C.
I would come back when I would have made out a will with the new turret.

Jacques
Petr from Czech Republic  [13 posts] 6 years
If I understand OK what are you describing, you can solve this problem in Maestro Control Center from Pololu. You can set there, what servo should do after it is turned ON or after some error and save it directly to Maestro. See Picture.

 
Anonymous 6 years
I think Petr is probably right. If you momentarily lose connection that would cause it to jump back to neutral. Can you verify your connections?

How long does it typically take for the servos to jump? Is the number of seconds about the same each time?

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
Hi STEVEN and Petr
I discover that I have no same system of control which you put in picture?
However I have version in 2.42.22
I proved connections and servos answers very well manually.

Jacques

 
jacquesrg from Paraguay  [16 posts] 6 years
Hi STeven and Petr
an anomaly:
here is my program in picture 1.
Here are two scalX and scalY to transform data in picture 2.
Here are shown variables in picture 3.
Variables contain data which do not correspond to the reality of position?
I changed and took back your script, more high.
I have a swing Pan/Tilt between the stocks of departure and 500.
But the value 500 does not stay, swing makes go those of departure back?
I do not know if you will not understand, I use an online translator. My language it is French, then Spanish.

Jacques

   
Anonymous 6 years
Jacques,

I realize that you are using a translator ... that's easy to see based on the way the text is written. No worries, we will try our best to understand based on the images you posted.

The Scale variable is not correct. It should be



as you need to scale from 0 to IMAGE_WIDTH and not 0 to 255.

The image petr sent is from

Pololu Maestro Control Center.exe

which you download from

http://www.pololu.com/file/0J266/maestro_windows_110720.zip

and is NOT in RoboRealm.

Hopefully this text is simple and translates well.

STeven.
Anonymous 6 years
Jacques,

Thanks for the video. That indicated the problem very clearly. Your issue is that once the color tracking is lost the system defaults to a 500,500 setting. This is expected since you probably did not include a check for when there is no object.

In your VBScript module you will need

if GetVariable("COG_BOX_SIZE")> 10 then

do all you settings and conversions here ...

end if

which will prevent the pan and tilt variables from being set when there is no detection in the image and just leave the current settings. That should stop the sudden movements.

If you don't understand the above statement please include your current robofile and we'll update that.

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
STEVEN

you really have a lot of patience!
I prefer reaching with you the file, I think that it will be better that descriptions.
In 70 years, learn robotics, it is not obvious, but it is exciting.
Thank you very much.

Jacques
program.robo
Anonymous 6 years
Attached is your updated robofile. See the VBScript module.

STeven.
program.robo
Anonymous 6 years
Another version using CInt so that the coordinates are just integers with no decimal points.

STeven.
program.robo
jacquesrg from Paraguay  [16 posts] 6 years
Hello Steven

I do not have the decimal figures anymore.
But I always have this displacement in a circle as on the last sent video.
Is it normal that stocks COG are not numerous of stocks servo?
For instance the centre 128 with 1500?
Could this explain this circular movement?
I think wait for the arrival of the turret which I bought at Endurance.
But since the others they sell without having the equipment in supply and ask me to be patient!

Jacques

 
Anonymous 6 years
Jacques,

I'm not sure what is causing that circular movement. It seems that the servos are not responding correctly. Try first just using one servo and see if that is working correctly. One possibility is that the servos are not updating fast enough.

Another thing you can try is to put a dead zone into your values. A dead zone is where the servos just stop updating. For example

if GetVariable("COG_X") > halfWidth + 10 or GetVariable("COG_X") < halfWidth - 10 then

'update values

else

  'otherwise set them to neutral
  SetVariable "pan", 1500
  SetVariable "tilt", 1500

end if

Yes, the COG is with respect to IMAGE coordinates ( for example 0,0,320,240) whereas the servo commands are NOT. Thus you need to convert the COG into what commands you use. This is normal!

STeven.
jacquesrg from Paraguay  [16 posts] 6 years
STeven

If I use only with the variable Tilt servo2 is curious?
Because the Pan also works when it is cut?
If I use only with the variable Tilt servo1, there are the same movements.
The camera explores in all directions?
So I changed the connections. I used 5 and 6 instead of 1 and 2.
reactions are identical.
Why only one variable acts on Pal and Tilt is not logical.

jacques
jacquesrg from Paraguay  [16 posts] 6 years
error:

If I use only with the variable Pan servo1, there are the same movements.
Anonymous 6 years
Jacques,

Your servos are moving too quickly to keep in control. You have to slow down how quickly they are moving in order to gain better control. This can be done by reducing the scale from image to servo space. Attached is your robofile with this done. The servo values will not range from 1000 to 2000 instead of 500 to 2500 which will slow them down and remove this oscillation.

Or you can move to digital servos that move quicker and are faster to stop.

STeven.
program.robo
jacquesrg from Paraguay  [1 posts] 6 years
STEVEN
I used your last program, only changed the servos of place.
I put in day roborealm program.
Drift is exactly the same, but very slow.
I send you a film (for others also who would like to see problem) http://asthma-reality.com/private/steven1.1.avi
You will be able to see that variable Pan (servo1) used alone, gives a very small reaction right-left-right. It comes certainly from a vibration of the turret.
Variable Tilt (servo1), used alone derives from above (direction 2 hours).
There is therefore a problem in this variable, in my view.
If both variables acted in a identical manner, there would be only one very small movement and no drift.
I am going to receive this week new turret. But it does not explain the drift of variable servo2.

Jacques

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index