Servo Speed

Based on DMP's Vortex processor / SoC this board is a full computer capable of running a standard Windows and Linux installation on the backpack of your robot.
13 postsPage 1 of 1
13 postsPage 1 of 1

Servo Speed

Post by dragonax » Tue Sep 07, 2010 6:22 am

Post by dragonax
Tue Sep 07, 2010 6:22 am

Is it possible to control the speed of the servo on the roboard like how you can do in ssc-32 servo controller?
Is it possible to control the speed of the servo on the roboard like how you can do in ssc-32 servo controller?
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by tommylin » Tue Sep 07, 2010 9:42 am

Post by tommylin
Tue Sep 07, 2010 9:42 am

Hi Dragonax,
My project video below ..
http://www.youtube.com/watch?v=WkezSkJUU3Q
I can Adjustment servo speed for Robot walking position.
Hi Dragonax,
My project video below ..
http://www.youtube.com/watch?v=WkezSkJUU3Q
I can Adjustment servo speed for Robot walking position.
tommylin offline
Newbie
Newbie
Posts: 4
Joined: Tue Sep 07, 2010 9:17 am

Post by dragonax » Tue Sep 07, 2010 11:10 am

Post by dragonax
Tue Sep 07, 2010 11:10 am

How did you managed to do this?
I want to control the speed of servos for my hexapod any idea on how to do this

Thanks
How did you managed to do this?
I want to control the speed of servos for my hexapod any idea on how to do this

Thanks
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by tommylin » Tue Sep 07, 2010 11:21 am

Post by tommylin
Tue Sep 07, 2010 11:21 am

did you got RoboIO.LIB or RoboIO source code from www.roboard.com yet ?
did you got RoboIO.LIB or RoboIO source code from www.roboard.com yet ?
tommylin offline
Newbie
Newbie
Posts: 4
Joined: Tue Sep 07, 2010 9:17 am

Post by dragonax » Tue Sep 07, 2010 11:23 am

Post by dragonax
Tue Sep 07, 2010 11:23 am

Im using roboio source latest version running in Linux
Im using roboio source latest version running in Linux
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by tommylin » Tue Sep 07, 2010 11:50 am

Post by tommylin
Tue Sep 07, 2010 11:50 am

used RoboIO is very simple.

call RoboIO API ..
rcservo_MoveTo(unsigned long* width, unsigned long playtime);

that's it,
I hope can help you, and see your hexapod project video soon ^^
used RoboIO is very simple.

call RoboIO API ..
rcservo_MoveTo(unsigned long* width, unsigned long playtime);

that's it,
I hope can help you, and see your hexapod project video soon ^^
tommylin offline
Newbie
Newbie
Posts: 4
Joined: Tue Sep 07, 2010 9:17 am

Post by dragonax » Tue Sep 07, 2010 12:29 pm

Post by dragonax
Tue Sep 07, 2010 12:29 pm

I have tried this but I can't seem to get it working I was using rceservo_SendPWMPulses before.

I tried the following with no luck

Code: Select all
if (rcservo_SetServo(2, RCSERVO_SERVO_DEFAULT_NOFB))
{
  if (rcservo_Initialize(RCSERVO_USECHANNEL2))
  {
    unsigned long motion[32];
    unsigned long count=100;
    motion[2] =1500;
    rcservo_EnterPlayMode_HOME(motion);
   
    rcservo_MoveTo(motion, count);
    while (rcservo_PlayAction() != RCSERVO_PLAYEND)
    {
    }
    rcservo_Close();
  }
}
I have tried this but I can't seem to get it working I was using rceservo_SendPWMPulses before.

I tried the following with no luck

Code: Select all
if (rcservo_SetServo(2, RCSERVO_SERVO_DEFAULT_NOFB))
{
  if (rcservo_Initialize(RCSERVO_USECHANNEL2))
  {
    unsigned long motion[32];
    unsigned long count=100;
    motion[2] =1500;
    rcservo_EnterPlayMode_HOME(motion);
   
    rcservo_MoveTo(motion, count);
    while (rcservo_PlayAction() != RCSERVO_PLAYEND)
    {
    }
    rcservo_Close();
  }
}
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by tommylin » Tue Sep 07, 2010 12:54 pm

Post by tommylin
Tue Sep 07, 2010 12:54 pm

need to confirmed 2 thing ..
A. what's your board version RB-100 ? RB-110 ?
B. RoboIO Lib Version ? 1.5 or 1.6 ?

my code ..
Code: Select all
static unsigned long ActionData[100][24]//[FrameNo][ChannelNo];

roboio_SetRBVer(RB_100); // 為RoBoard RB-100
for ( int i=0; i < 24; i++ )                                       
  rcservo_SetServo ( i, RCSERVO_HITEC_HSR8498 );
                  
rcservo_Initialize(
                     RCSERVO_USECHANNEL0 + RCSERVO_USECHANNEL1 + RCSERVO_USECHANNEL2 +
                     RCSERVO_USECHANNEL3 + RCSERVO_USECHANNEL4 + RCSERVO_USECHANNEL5 +
                     RCSERVO_USECHANNEL6 + RCSERVO_USECHANNEL7 + RCSERVO_USECHANNEL8 +
                     RCSERVO_USECHANNEL9 + RCSERVO_USECHANNEL10 + RCSERVO_USECHANNEL11 +
                     RCSERVO_USECHANNEL12 + RCSERVO_USECHANNEL13 + RCSERVO_USECHANNEL14 +
                     RCSERVO_USECHANNEL15 );//+ RCSERVO_USECHANNEL16 + RCSERVO_USECHANNEL17 +
                     //RCSERVO_USECHANNEL18 + RCSERVO_USECHANNEL19 + RCSERVO_USECHANNEL20   );

rcservo_EnterPlayMode ();

rcservo_MoveTo(  ActionData[CurrentFrameNo], 500L );
need to confirmed 2 thing ..
A. what's your board version RB-100 ? RB-110 ?
B. RoboIO Lib Version ? 1.5 or 1.6 ?

my code ..
Code: Select all
static unsigned long ActionData[100][24]//[FrameNo][ChannelNo];

roboio_SetRBVer(RB_100); // 為RoBoard RB-100
for ( int i=0; i < 24; i++ )                                       
  rcservo_SetServo ( i, RCSERVO_HITEC_HSR8498 );
                  
rcservo_Initialize(
                     RCSERVO_USECHANNEL0 + RCSERVO_USECHANNEL1 + RCSERVO_USECHANNEL2 +
                     RCSERVO_USECHANNEL3 + RCSERVO_USECHANNEL4 + RCSERVO_USECHANNEL5 +
                     RCSERVO_USECHANNEL6 + RCSERVO_USECHANNEL7 + RCSERVO_USECHANNEL8 +
                     RCSERVO_USECHANNEL9 + RCSERVO_USECHANNEL10 + RCSERVO_USECHANNEL11 +
                     RCSERVO_USECHANNEL12 + RCSERVO_USECHANNEL13 + RCSERVO_USECHANNEL14 +
                     RCSERVO_USECHANNEL15 );//+ RCSERVO_USECHANNEL16 + RCSERVO_USECHANNEL17 +
                     //RCSERVO_USECHANNEL18 + RCSERVO_USECHANNEL19 + RCSERVO_USECHANNEL20   );

rcservo_EnterPlayMode ();

rcservo_MoveTo(  ActionData[CurrentFrameNo], 500L );
tommylin offline
Newbie
Newbie
Posts: 4
Joined: Tue Sep 07, 2010 9:17 am

Post by dragonax » Tue Sep 07, 2010 1:24 pm

Post by dragonax
Tue Sep 07, 2010 1:24 pm

Thanks for the code but it doesn't work for me :(

I tried with the following

Code: Select all
ActionData[0][2]=1500;
rcservo_MoveTo(ActionData[0],500L);
Thanks for the code but it doesn't work for me :(

I tried with the following

Code: Select all
ActionData[0][2]=1500;
rcservo_MoveTo(ActionData[0],500L);
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by dragonax » Tue Sep 07, 2010 1:48 pm

Post by dragonax
Tue Sep 07, 2010 1:48 pm

my board is RB_100 and roboio ver is 1.6
my board is RB_100 and roboio ver is 1.6
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by dragonax » Tue Sep 07, 2010 2:05 pm

Post by dragonax
Tue Sep 07, 2010 2:05 pm

I got it working I had to change to

Code: Select all
rcservo_EnterPlayMode_NOFB(motion);


But still rcservo_MoveTo() function doesn't control the speed of the servo Any idea how to achieve this?
I got it working I had to change to

Code: Select all
rcservo_EnterPlayMode_NOFB(motion);


But still rcservo_MoveTo() function doesn't control the speed of the servo Any idea how to achieve this?
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm

Post by roboard » Tue Sep 07, 2010 3:56 pm

Post by roboard
Tue Sep 07, 2010 3:56 pm

dragonax wrote:I tried the following with no luck

...


Hi, please try the following code again:

Code: Select all
if (rcservo_SetServo(2, RCSERVO_SERVO_DEFAULT_NOFB))
{
  if (rcservo_Initialize(RCSERVO_USECHANNEL2))
  {
    unsigned long motion[32];
    motion[2] =1500;
    rcservo_EnterPlayMode_NOFB(motion);
   
    motion[2] =1800;
    rcservo_MoveTo(motion, 1000L); //move servo in channel 2 from position 1500 (us) to 1800 (us) in 1sec
    rcservo_Close();
  }
}


In rcservo_EnterPlayMode_NOFB(motion), the "motion" must be the home (initial) position of servo; and in rcservo_MoveTo(motion, 1000L), the "motion" is the destination (target) position.

When calling rcservo_MoveTo(), servo will move from the last position to the specified destination position. For example, if you want servo to move from home, motion1, motion2, ..., to motion 10, then you can write

Code: Select all
unsigned long home[32];
unsigned long motion1[32];
unsigned long motion2[32];
...
unsigned long motion10[32];

...
... //set value for home, motion1, ..., motion10
...

rcservo_EnterPlayMode_NOFB(home);
rcservo_MoveTo(motion1, 200L); //move from home to motion1 in 200ms
rcservo_MoveTo(motion2, 200L); //move from motion1 to motion2 in 200ms
rcservo_MoveTo(motion3, 200L); //move from motion2 to motion3 in 200ms
...
rcservo_MoveTo(motion10, 200L); //move from motion9 to motion10 in 200ms


:)
dragonax wrote:I tried the following with no luck

...


Hi, please try the following code again:

Code: Select all
if (rcservo_SetServo(2, RCSERVO_SERVO_DEFAULT_NOFB))
{
  if (rcservo_Initialize(RCSERVO_USECHANNEL2))
  {
    unsigned long motion[32];
    motion[2] =1500;
    rcservo_EnterPlayMode_NOFB(motion);
   
    motion[2] =1800;
    rcservo_MoveTo(motion, 1000L); //move servo in channel 2 from position 1500 (us) to 1800 (us) in 1sec
    rcservo_Close();
  }
}


In rcservo_EnterPlayMode_NOFB(motion), the "motion" must be the home (initial) position of servo; and in rcservo_MoveTo(motion, 1000L), the "motion" is the destination (target) position.

When calling rcservo_MoveTo(), servo will move from the last position to the specified destination position. For example, if you want servo to move from home, motion1, motion2, ..., to motion 10, then you can write

Code: Select all
unsigned long home[32];
unsigned long motion1[32];
unsigned long motion2[32];
...
unsigned long motion10[32];

...
... //set value for home, motion1, ..., motion10
...

rcservo_EnterPlayMode_NOFB(home);
rcservo_MoveTo(motion1, 200L); //move from home to motion1 in 200ms
rcservo_MoveTo(motion2, 200L); //move from motion1 to motion2 in 200ms
rcservo_MoveTo(motion3, 200L); //move from motion2 to motion3 in 200ms
...
rcservo_MoveTo(motion10, 200L); //move from motion9 to motion10 in 200ms


:)
roboard offline
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

Post by dragonax » Tue Sep 07, 2010 4:08 pm

Post by dragonax
Tue Sep 07, 2010 4:08 pm

Thanks a lot it works now
Thanks a lot it works now
dragonax offline
Savvy Roboteer
Savvy Roboteer
Posts: 35
Joined: Sat Sep 04, 2010 7:46 pm


13 postsPage 1 of 1
13 postsPage 1 of 1