Lynxmotion Tech Support

www.lynxmotion.com
It is currently Sun May 26, 2013 4:42 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Bot Board II
PostPosted: Thu Jan 05, 2012 9:47 am 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
Hello,

I am trying to use the Lynxmotion AL5D Robotic Arm with predefined motions when pressed buttons on the Lynxmotion PS2 wireless controller. The wireless receiver is hooked up to the Bot Board II. The Bot Board II then goes to the SSC-32 Servo Controller which is then connected to the arm.

I was wondering if it were possible to eliminate the SSC-32 from the equation? I haven't found any examples of controlling the servos with just the Bot Board II but was wondering if is possible.

Thank you!


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Thu Jan 05, 2012 10:48 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Here is an example...

http://www.lynxmotion.com/images/html/build148.htm

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Thu Jan 05, 2012 5:21 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
Before using the SSC-32 a command such as this worked perfectly:
serout p15,i38400,["#0 P2300 #2 P1500 #3 P2000 #4 P2000 #5 P3000",13]

What am I missing in order to control the servos with only the Bot Board II?

I have added this declaration:

;[PIN NUMBERS]
BasePin con P0 ;Base Connection
ShoulderPin con P1 ;Shoulder Connection
ElbowPin con P2 ;Elbow Connection
WristPin con P3 ;Wrist Connection
WristRotatePin con P5 ;Wrist Rotation Connection (Optional)


Thanks!


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Thu Jan 05, 2012 5:48 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
I don't even know where to start...

Try studying the code in this tutorial. It's for a BRAT not an arm, but it doesn't really matter. You will need to remove some BRAT specific things. But study this part of the code.

http://www.lynxmotion.com/images/html/build155.htm

Code:
      elseif(command = 4)                     ; Kick Left
         gosub movement [  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 500.0]
         gosub movement [-14.0,  0.0,  0.0, 42.0,  0.0,  0.0, 500.0]
         gosub movement [-23.0,  0.0,  0.0,  0.0,-32.0, 41.0, 500.0]
         gosub movement [-23.0,  0.0,  0.0,  0.0, 24.0,-20.0, 250.0]
         gosub movement [-18.0,  0.0,  0.0,  0.0,  0.0,  0.0, 500.0]
         gosub movement [  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 500.0]


The values are in degrees I believe, and the last value is the time in mS for each part of the sequence. Study the entire code and ask questions.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Fri Jan 06, 2012 4:23 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
Ok I have adopted the example code and I am able to completely able to control the arm using the PS2 controller.

I am trying to create defined arm motions by the press of the triangle button.

I have this code in the PS2Input gosub routine:
{
IF (DualShock(2).bit4 = 0) and LastButton(1).bit4 THEN ;Triangle Button

gosub movement [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 500.0]
gosub movement [-80.0, 0.0, 0.0, 0.0, 0.0, 0.0, 500.0]

ENDIF
}
Instead of rotating the base 80 degrees the arm simply jolts for less than a second. Am I forgetting anything? Do I need to specify the amount of time it should take to make the movement?

Thank you Jim you have been great help!


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Fri Jan 06, 2012 6:59 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
My guess is that once the movement is done, the code will then go to the default code, where it will probably have some variable defined like BaseAngle or the like and it will tell the arm to go to that location. IE there is probably code that takes the input from the ps2 controller joysticks and updates the different angles to the new desired location.

Kurt


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Mon Jan 09, 2012 3:15 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
I have tried to make the arm do predefined movements two different ways, each with their own difficulties. With both methods I am having trouble controlling the speed of the movements.

Method 1
With this code the shoulder and elbow do not move.
IF (DualShock(2).bit4 = 0) and LastButton(1).bit4 THEN ;Triangle Button
'starting postition
BaseAngle1=-200
ShoulderAngle1=300
ElbowAngle1=400
GlobalGripperAngle1=-550
TargetGripper1=0
Gripper1=0
TargetWristAngle1=0
WristRotateAngle1=0
ENDIF

I have found that the values are not in degrees. The range of motion for the servos are:
Base [-900,900]
Shoulder [-780,900]
Elbow [-780,900]
Gripper [720,680]
Wrist Rotate [-760,830]
Divide by 10 to get degrees.

Method 2
When I use code such as this, after the 3000 pause the arm continues to make undefined movements.
IF (DualShock(2).bit7 = 0) and LastButton(1).bit7 THEN ;Square Button test
gosub movement [0, 0, 0, 0, 0, 0, 0]
pause 3000
ENDIF


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Mon Jan 09, 2012 4:13 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
In both methods the arm does unpredictable movements when using a long pause such as 3000. Using shorter pauses such as 10 or 100 just skip the first step and go's to the last step.


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Mon Jan 09, 2012 5:19 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4415
I believe that the angle is in 1/10th of a degree. So base of +-900 is +-90 degrees...

But more to the issue. I am not sure which program you are using. If you are using something like a striped down version of rover V1.2.bas, then The issues are, that once your code is done, you go back into the main loop, you will see something like:
Code:
main:

#IF EnableFSR=1
   ;Read analog input
   adin GripperFSRPin, GripperPressure
#ELSE
   GripperPressure=1000
#ENDIF

  ;Read remote input
  GOSUB Ps2Input

; rover stuff removed... 

;[ARM CALCULATIONS]

  ;Inverse Kinematic calculations
  GOSUB ArmIK [WristPosX, WristPosY, GlobalGripperAngle1] 
  ShoulderAngle1 = -IKShoulderAngle1+900
  ElbowAngle1 = IKElbowAngle1+900
  WristAngle1 = -IKWristAngle1

  GOSUB CheckLimits

  GOSUB WaitForPrevMove ;Wait for servos to finish the previous move
 
  IF ArmOn THEN 
    IF ArmOn AND Prev_ArmOn=0 THEN
      Sound P9,[60\4000,80\4500,100\5000]
     gosub InitArm
    
     GlobalGripperAngle1=0
     ENDIF
 
   GOSUB Movement[-BaseAngle1, -ShoulderAngle1, -ElbowAngle1, -WristAngle1, -Gripper1, -WristRotateAngle1, 50]

What you notice here is that as soon as the code goes back to Main: it checks for new PS2 input or in your case, it completes the call to PS2Input and then calls:
Code:
GOSUB ArmIK [WristPosX, WristPosY, GlobalGripperAngle1]

Which uses those 3 variables to calculate the new angles for the different servos and then a little more stuff and then calls off to Movement with it's own calculated values.

Some options that may work for you:
a) Set some mode variable when you press your button, that says, don't do anything else in main loop. Question would be how to clear it again... Sort-of how the on/off works... Could be press same button again on PS2 to clear. Could add code that if any of the 4 joystick values are out of the dead-band, to clear the flag...
b) Have your code set those 3 values...

Kurt


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Mon Jan 09, 2012 5:42 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Doh!!! Extreme sorrow...

I forgot to include the link. http://www.lynxmotion.com/images/html/build155.htm

Kurt and Autobot...

Because Autobot expressed interest in having the arm do a series of movements from a PS2 button press I pointed him to the BRAT tutorial. However I neglected to include the link... :oops:

Now my post might make a little more sense?

I edited the post...

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Tue Jan 10, 2012 3:39 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
I have been using the http://www.lynxmotion.com/images/html/build148.htm tutorial. I have arranged the jumpers and pins the same as the tutorial. Only the battery input closest to the PWR LED works. I have tested the connections for the other PWR source to verify that it works. The code has a subroutine causing the alarm to go off when low battery ie. it is always going off. Is the jumper layout in the tutorial correct?


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Tue Jan 10, 2012 4:05 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Two examples were provided. The first allows you to move the arm in real time from the PS2 controller. The second example is for a BRAT, and it sends a series of movements whenever a certain button is pressed.

From your previous posts it sounded to me like you needed the second tutorial not the first.

We are not telling you how to write a program, we are telling you what to change in the programs in the tutorials.

It's really not clear to me at all what you have done and what the code looks like.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Tue Jan 10, 2012 4:18 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
autobot wrote:
Only the battery input closest to the PWR LED works. I have tested the connections for the other PWR source to verify that it works.


Please follow the nomenclature we have established. There are two places to connect power. VS is for servo power and VL is for logic, or the microcontroller power. VS is 6vdc, and VL can be 7-9vdc. Applying power to the VL will light up the power LED, but applying power the the VS will not.

autobot wrote:
The code has a subroutine causing the alarm to go off when low battery ie. it is always going off. Is the jumper layout in the tutorial correct?


The code has nothing to do with battery voltage. Where did you read that? The beeping is bwecause the PS2 is not connected or connected wrong.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Tue Jan 10, 2012 4:19 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Here is a link to the manual for the BotBoard... hint hint >.<

http://www.lynxmotion.com/s-4-electroni ... .aspx#micr

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
 Post subject: Re: Bot Board II
PostPosted: Fri Jan 13, 2012 1:28 pm 
Offline
Roboteer

Joined: Wed Jan 04, 2012 4:29 pm
Posts: 15
Thanks for all your help. I have the arm going to all of the predefined positions that I wanted it to using the move and movement functions from the PS2 Biped BRAT Tutorial. :)

Are there any general rules to follow with the speed given to a movement and pauses after the command? One of my commands defaults to speed 0 and that is way to quick.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group