loading
 
Pan Tilt arm + Robotis Dynamixel AX-12A
MOHD ADAM from Malaysia  [19 posts]
5 years
Hi,

I bought this arm from crust crawler+ Cm700 controller.. I attach Logitech c525 HD webcam..

First attempt I try grab a small blue box..it is a success!! Wohoo~

Next I try to make a pan and tilt.. I try Pan  using base motor and COG_X as a reference..

I study example object following from endurance R/C.. I alter the VB script to make it suitable with Dynamixel..but i dont understand how to make the servo stop..it keep adding the servo position...

http://www.endurance-rc.com/tracking.php

then I refer example in tutorial http://www.roborealm.com/help/VBScript_Program.php

below is my VB script program: (could someone alter)
-------------------------------------------------------------------------------------------------------------

   cogx = GetVariable("cog_x")
  cogy = GetVariable("cog_y")
  s1_pos = GetVariable("S1_POSITION")      'get the current position of dynamixel base
  COG_size=GetVariable("COG_BOX_SIZE")

  
    
  if cogx > 450 then    
    s1 = s1_pos+20
    
  else
    if cogx <300 then      
    s1 = s1_pos-20

  else
    if COG_size = 0 then
    s1 =s1_pos
  

    end if
  end if

  SetVariable "s1", left_motor
  SetVariable "S1_POSITION",s1_pos

end if

----------------------------------------------------------------------------------------------------------------

What is the best idea of pan and tilt system.. make the servo move and stop after reach the center of the screen? Or just make it stop after the servo reach the range of COG_X set?

MOHD ADAM from Malaysia  [19 posts] 5 years
  Hi, want to ask about VB script,

Whay it keep runing at statement

  if -80<y<120 then
  left_motor=s1_pos+500
  end if  

Below are my coding:
----------------------------------------------------------------------------
cogx = GetVariable("cog_x")
  cogy = GetVariable("cog_y")
  s1_pos = GetVariable("S1_POSITION")
  COG_size=GetVariable("COG_BOX_SIZE")
  left_motor=GetVariable("S1")


  y=320-GetVariable("cog_x")  

  
  if -320<y<-81 then  
  left_motor=s1_pos+100
  end if    


  if 320>y>121 then  
  left_motor=s1_pos+300
  end if  

  if -80<y<120 then
  left_motor=s1_pos+500
  end if  
    

  SetVariable "s1", left_motor
  SetVariable "S1_POSITaION",s1_pos
  SetVariable "y1",y


MOHD ADAM from Malaysia  [19 posts] 5 years



I write this code just to make dynamixel follow blue object along x axis....but the problem is,

the movement it not smooth..jerking and hard to stop at 0..it keep trying to reach x=0

so  I try make a range to stop:

difference_x=0 to  ----to----> loop while -10<difference_x<10  .........but roborealm hanging after compile!!

I try change:
left_motor=s1_pos-10  ----to--->  left_motor=s1_pos++ .....but got syntax error??

all the example in roborealm didnt refer the present position...I think the example not suitable for dynamixe servo motor..
====================================================
cogx = GetVariable("cog_x")
cogy = GetVariable("cog_y")
s1_pos = GetVariable("S1_POSITION")


difference_x=(GetVariable("image_width")/2)-GetVariable("cog_x")
    

  if difference_x<0 then    
   do
    left_motor=s1_pos-10
   loop while difference_x=0
  end if


  if difference_x>0 then
   do
    left_motor=s1_pos+10
   loop while difference_x=0    
  end if


SetVariable "difference_x", difference_x  ' difference between center  and COG_x
SetVariable "left_motor", left_motor
SetVariable "s1_position", s1_pos  'get the dynamixel current position

=====================================================



question 2:
How can I make looping statement in VB  example:  (x=0;x<0;x++)


====================================================

MOHD ADAM from Malaysia  [19 posts] 5 years
Here my video

http://www.youtube.com/watch?v=OlgV-7UE5Us
EDV  [328 posts] 5 years
I also made couple of experiments with object tracking:
http://www.youtube.com/watch?v=pt2y7xkiTXo
VBScript: http://www.roborealm.com/forum/program.php?post_id=23024

And enhanced tracking algorithm that takes into consideration variable servo speed:
http://www.youtube.com/watch?v=ueqDhuHiR-E
VBScript: http://www.roborealm.com/forum/program.php?post_id=24293

I hope that these script control programs could be useful in your experiments.

See here for more details: http://forums.trossenrobotics.com/showthread.php?4764-Using-of-AVM-plugin-in-RoboRealm&p=48865#post48865
MOHD ADAM from Malaysia  [19 posts] 5 years
Thank you EDV,

I have read yourVBscript and the AVM tutorial.. How I can get in touch with u? like skype @ email @ blog?

1)What is the treshold value? is it depend on environmental?

2)For dynamixel servo motor, it rotate 0-1023.. where I should change in VB?

3) How is the turret_h get the value? -128 and 127

4) What is turret_v128 use for?


Thank you in advance EDV..
EDV  [328 posts] 5 years
My e-mail is: "mail.for.edv AT gmail.com" but it would be better to continue our discussion here ;-)

>> 1) What is the threshold value? Is it depending on environmental?

The variable "threshold" is working like hysteresis that prevents self-oscillation of turret.

The value of "threshold" is number of pixels that provide "dead" area for servo motion control algorithm and it forces servo to stop motion when the hit to threshold interval is detected.

The value of "threshold" depends on the input image resolution also on the speed of camera turning and on the camera FPS (usually 25fps).

>> 2) For dynamical servo motor, it rotate 0-1023.. where I should change in VB?

There are two variables of servo control separately for position of rotation TURRET_H_CONTROL and for controlling of speed TURRET_H_SPEED (it is variables for Pan servo control and TURRET_V_CONTROL, TURRET_V_SPEED for Tilt servo control).

You can change it in these variables:

*Position of rotation
turret_min = -100
turret_max = 100

*Controlling of speed
speed_min  = 1
speed_max  = 100

See VBScript[2]: http://www.roborealm.com/forum/program.php?post_id=24293

>> 3) How is the turret_h get the value? -128 and 127

This limitation is stated in these conditions directly:

    if dX > threshold and turret_h > -128 then
        ' The object is at left side
        turret_h = turret_h - 1
    end if

    if dX < -threshold and turret_h < 127 then
        ' The object is at right side
        turret_h = turret_h + 1
    end if

>> 4) What is turret_v128 use for?

turret_v128 = turret_v + 128 => convert range to 0-255 for external variable "TURRET_V_128" of servo control .

See VBScript[1]: http://www.roborealm.com/forum/program.php?post_id=23024
MOHD ADAM from Malaysia  [19 posts] 5 years
thanks for the reply EDV,



sorry but I dont understand:

1) How do you get -128 and 127 value? Is it the value from x and y coordinate.. what screen resolution you use?

if dX > threshold and turret_h > -128 then 'How do you get -128 value?
        ' The object is at left side
        turret_h = turret_h - 1
    end if

    if dX < -threshold and turret_h < 127 then 'How do you get 127 value?
        ' The object is at right side
        turret_h = turret_h + 1
    end if


2) Now I am using your first program(no speed).. Should I change 128 to 1023 because standart RC servo like Parallax used 0 to 255 as the servo space, the dynamixel uses 0 to 1023

turret_v128 = turret_v + 128
turret_h128 = turret_h + 128

to

turret_v1023 = turret_v + 1023
turret_h1023 = turret_h + 1023

And what are the variable I should sent to servo motor?
TURRET_V_1023 and TURRET_H_1023
or
TURRET_V_CONTROL and TURRET_H_CONTROL

3) for threshold value, do i have to try and error to get the best value? My webcam logitech USB C525HD setting is at 30FPS, resolution 640x480 (or should i use standard AVM 320x240) and PAL 50Hz

Thanks for your time.
MOHD ADAM from Malaysia  [19 posts] 5 years
I should change to
turret_v512 = turret_v + 512 'min 0, max 1023 ,center 512
turret_h512 = turret_h + 512
EDV  [328 posts] 5 years
>> 1) How do you get -128 and 127 value? Is it the value from x and y coordinate..

The servo control variable TURRET_H_128 has range from 0 to 255 with 128 being neutral and I decided to use more convenient range in auxiliary variable turret_h (external TURRET_H_CONTROL) that had range -128 to 127 with 0 being neutral.

The value 255 is the maximum for control variable. So -128 and 127 are just half parts of this value.


>> what screen resolution you use?

The resolution 320x240 was used in this experiment.


>> 2) Now I am using your first program(no speed).. Should I change 128 to 1023 because standard RC servo like Parallax used 0 to 255 as the servo space, the dynamixel uses 0 to 1023

If value 1023 is the maximum then you should use range –512 to 511:

    if dX > threshold and turret_h > -512 then
        ' The object is at left side
        turret_h = turret_h - 1
    end if

    if dX < -threshold and turret_h < 511 then
        ' The object is at right side
        turret_h = turret_h + 1
    end if
...
turret_h512 = turret_h + 512
...
SetVariable "TURRET_H_512", turret_h512


>> And what are the variable I should sent to servo motor?

You should use TURRET_H_512 variable for servo control.


>> 3) for threshold value, do i have to try and error to get the best value? My webcam logitech USB C525HD setting is at 30FPS, resolution 640x480 (or should i use standard AVM 320x240) and PAL 50Hz

As I mentioned earlier the value of "threshold" depends on the input image resolution also on the speed of camera turning and on the camera FPS (usually 25fps).

In my experiment it was set to “threshold = 40” and for resolution 320x240 it give 12.5% of screen width.

So you could set it to “threshold = 80” for resolution 640x480.
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi EDV,

I have alter ur 1st program (without speed) base on dynamixel and my mechanical structure, The robot can easily follow the object I draw on the paper.. the movement not so smooth.. I dont know how to tweak and fine tune to make it move smooth.. maybe your second program can make it work fine..

Video my arm robot:
http://www.youtube.com/watch?v=72uyV2jBX88

Video 2: This is the movement I want,  Darwin-OP, it use dynamixel but difference model
http://youtu.be/94VqAmtHlFA




program.robo
MOHD ADAM from Malaysia  [19 posts] 5 years
1)its easily follow the object I draw on the paper but it hard to follow an object such as pen, bottle cap.. How can I make it work?

2)If I remove the object I learn previous, and when I open it still in the list..

3)For program no 2 (with speed), which variable I should send to my motor? is it:

Turret_v , Turret_v_speed, Turret_h, Turret_h_speed?
EDV  [328 posts] 5 years
>> 1) Its easily follow the object I draw on the paper but it hard to follow an object such as pen, bottle cap.. How can I make it work?

The AVM algorithm use only grayscale matching and it not allow to AVM see difference between green and red balls for example. So, good object for recognition with AVM should has appreciable texture. Also you should endeavor so that the object occupies as much as possible the square of interest area (red rectangle) during training because for AVM anything that was placed in interest area will become as object (background also).

>> If an object goes out of view can the recognition box be stopped rather than carried over onto the out of range view... As I only have 1FPS then I would imagine that it would normally be dropped after 1/3 sec on a 30FPS cam.........but I am limited to 1FPS and it gets carried over for 15-20 frames.

You should (temporarily before AVM update will be released) switch AVM Navigator from "Object recognition" to "Navigate mode" or [Object recognition] -> [Navigate mode] -> [Nova gate mode] and this action will set parameter ptTrackingDepth from 40 to 2 frames.

The parameter "ptTrackingDepth" is the threshold value of the frame number in which the object was not found and then tracking will be stopped. The default is 40 frames (about 1.5 seconds) in "Object recognition" mode.

I plan to add new variable "NV_TRACKING_DEPTH" in the next version of AVM Navigator that will provide direct setting of "ptTrackingDepth" parameter (from VBScript program for example).

Also I noticed that your servos have a TOO MUCH speed and it cause to jerks of manipulator and dropping of object tracking. You should just to make servo speed slow down for good tracking.

>> Just another query can the learning box be made to vary too oblong as my recognition  items...(Boats) are that shape..:-)

Just click "Set key image size (New)" button and answer "No" in the next dialog. Further set the key image size by hand on the camera view in AVM Navigator dialog window. Look attentively on "Key: <width>x<height>" green indicator below blue rectangle that shows key size. It would good to set 80x80 or 160x80 but not 80x40 or 40x40 key size. When you set key image size then your interest area for object training will stay oblong.


>> 2) If I remove the object I learn previous, and when I open it still in the list..

The "Remove object" action can clear all visual data that was associated with chosen object in AVM search tree (if you want to correct previous bad training attempt) but can't remove his name from object's name table. But then you can try to learn this object once again. You can also continue to train on an existed object from object list (it writes additional data to AVM search tree) for new view angle (for example) in anytime.


>> 3) For program no 2 (with speed), which variable I should send to my motor? is it: Turret_v , Turret_v_speed, Turret_h, Turret_h_speed?

You should modify original program for your servos:
turret_min = –512
turret_max = 511

And further you should add:
turret_h512 = turret_h + 512
turret_v512 = turret_v + 512
...
SetVariable "TURRET_H_512", turret_h512
SetVariable "TURRET_V_512", turret_v512


You should use TURRET_H_512 for Pan servo control and TURRET_V_512 for Tilt servo control and variables TURRET_H_SPEED, TURRET_V_SPEED for speed control (if it needed).

And first try to just slow down your servo speed (now it too high).
EDV  [328 posts] 5 years
I noticed also that the value of horizontal and vertical rotation step is only 1 (turret_h = turret_h + 1, turret_v = turret_v + 1) however your servos have too big rotation angle for this amount.

I think that you should decrease rotation angle amount in your Dynamixel controller settings in some way.
MOHD ADAM from Malaysia  [19 posts] 5 years

I can set the min and max of rotation angle. What If I read the feedback of present servo position can make the calculation faster?

turret_v = present_s2 + 1
EDV  [328 posts] 5 years
You already have present servo position value in "turret_v" variable and value of the next position too turret_v + 1 or turret_v - 1. This value is stored in external "TURRET_V_CONTROL" variable between iterations of script program  ;-)
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi Steven,

Today I try latest Roborealm version that have usb2dynamixel module..

First I test with cm-700 to the 7 AX-12+

The problem is, Roborealm keep crash every time I want to select or change dynamixel setting in dynamixel module

I have restart my PC, then I reinstall roborealm, disable antivirus but it still crash..

other module like RGB filter and COG working fine..

Here is the video I recorded:
http://www.youtube.com/watch?v=5xu233-zzPM

Anonymous 5 years
Mohd,

Just to be sure, can you download the latest and if that crashes send us/post the C:\RoboRealm.log file that is generated after a crash? That will help to quickly track down the problem.

Thanks,
STeven.
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi,

I cant find C:\\RoboRealm.log or in C://program file/roborealm and I have try in my other PC.. still crash

The program just terminate like in video and not ask permission to sent or create report/log..
Anonymous 5 years
It might be on your desktop. Be sure to have run RoboRealm as an Administrator to ensure it can write that file either on your c:\ or desktop. It is also possible that it is crashing outside of RoboRealm.

Also, can you include the robofile just before you insert the dynamixel module as there may be some interaction from those modules that is causing the problem.

We will also continue to test/investigate.

Thanks,
STeven.
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi Steven,

I have upload my code detect yellow round. Actually I even I try to remove all module and only use dynamixel module (like in video)..

I also have attach report generate by window 7 after roborealm crash. hope this will help you
MOHD ADAM from Malaysia  [19 posts] 5 years
I have run as admin, but no log file and crash


Description:
  A problem caused this program to stop interacting with Windows.

Problem signature:
  Problem Event Name:    AppHangB1
  Application Name:    RoboRealm.exe
  Application Version:    2.46.0.0
  Application Timestamp:    4ffdac21
  Hang Signature:    cd91
  Hang Type:    0
  OS Version:    6.1.7600.2.0.0.256.1
  Locale ID:    1033
  Additional Hang Signature 1:    cd910cae41ea6311c0147acf3158ab8a
  Additional Hang Signature 2:    48bf
  Additional Hang Signature 3:    48bfb0fcd6da86ca5393c9890855f76b
  Additional Hang Signature 4:    cd91
  Additional Hang Signature 5:    cd910cae41ea6311c0147acf3158ab8a
  Additional Hang Signature 6:    48bf
  Additional Hang Signature 7:    48bfb0fcd6da86ca5393c9890855f76b

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi Steven,

Forgot to tell you that the software crash when I use Cm-700 module, if i use USB2dynamixel its work fine
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi, can the problem on cm-700 module be solve?
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi, I have install 2.46.0

I cannot find AVM Navigator module? old version have in the plugin menu, did AVM Navigator has change name?
Anonymous 5 years
Yes, it can be solved. We have added additional error checking and reporting. Can you download the latest version, run the same module, crash and then rerun RoboRealm. It will bring up an interface asking to send us the crash report. Please allow for this to happen and we should receive more information.

We have also made some fixes to the Robotis module so you may also not experience this crash anymore.

The AVM has not changed. You probably were using the trial version of the software which includes the AVM module for testing. After the trial period the AVM module has to be purchased in addition to RoboRealm as it is a 3rd party module (see purchase page). If you wish to add this module to your account please contact me via email.

v.2.26.1 has these updates.

Thanks,
STeven.
MOHD ADAM from Malaysia  [19 posts] 5 years
Hi Steven, I have download and install v.2.26.1

Work fine on USB2Dynmamixel but crash when using CM-700..

I have run as admin and disable kapersky antivirus..

After crash and rerun Roborealm, there is no interface show up, asking for permission to sent crash report.

 
Anonymous 5 years
Mohd,

We finally figured out the issue. Its not actually a crash but a deadlock that your machine was picking up on. Thus no crash file would have been generated ... your error just looks a lot like when a crash dump happens. This was problematic since we were not sure why no crash dump was happening and lead us off into a different direction. Regardless, we have seen your issue and uploaded a fix.

Can you download 2.46.4 and try the cm700 mode?

Thanks,
STeven.
Anonymous 5 years
Thank Steven!! Version 2.46.6 working fine with CM-700

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