wckReadPos

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
5 postsPage 1 of 1
5 postsPage 1 of 1

wckReadPos

Post by chickenkai » Tue May 21, 2013 11:26 am

Post by chickenkai
Tue May 21, 2013 11:26 am

Hi

I programming a code in C# with RobobuilderLib.dll

Now I use a trackBar to control the servo motor to move

But I Found a problem:

when I pull the trackBar slowly and use the function wckReadPos to

read the wck posture, the value is inaccuracy within 5 degrees,

but if I pull the trackBar fast and use wckReadPos the value is

inaccuracy would increase a lot, bigger than 10 degrees,

how can I solve this problem?

thanks!
Hi

I programming a code in C# with RobobuilderLib.dll

Now I use a trackBar to control the servo motor to move

But I Found a problem:

when I pull the trackBar slowly and use the function wckReadPos to

read the wck posture, the value is inaccuracy within 5 degrees,

but if I pull the trackBar fast and use wckReadPos the value is

inaccuracy would increase a lot, bigger than 10 degrees,

how can I solve this problem?

thanks!
chickenkai offline
Savvy Roboteer
Savvy Roboteer
Posts: 30
Joined: Thu Jul 26, 2012 10:09 am

Post by l3v3rz » Tue May 21, 2013 1:02 pm

Post by l3v3rz
Tue May 21, 2013 1:02 pm

Its probably a timing issue - if you read servo too quickly it won't have settled , try a delay before reading or multiple wckReadPos until it settles.
Its probably a timing issue - if you read servo too quickly it won't have settled , try a delay before reading or multiple wckReadPos until it settles.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by chickenkai » Tue May 21, 2013 1:28 pm

Post by chickenkai
Tue May 21, 2013 1:28 pm

how can I do?

Like this?

Code: Select all
if (i == 11)
{
     rbWCK.wckMovePos(11, Convert.ToByte(trackBar1.Value), 2);
     textBox_pos.Text = Convert.ToString(trackBar1.Value);
     rbWCK.delay_ms(200);
     if (rbWCK.wckReadPos(11))
     {                   
            richTextBox1.Text = "Servo 11 end:" + Convert.ToString(rbWCK.respnse[1]);       
      }
      else
     {
      textBox_pos.Text = "Servo 11 NOT CONNECTED";
      }
}
how can I do?

Like this?

Code: Select all
if (i == 11)
{
     rbWCK.wckMovePos(11, Convert.ToByte(trackBar1.Value), 2);
     textBox_pos.Text = Convert.ToString(trackBar1.Value);
     rbWCK.delay_ms(200);
     if (rbWCK.wckReadPos(11))
     {                   
            richTextBox1.Text = "Servo 11 end:" + Convert.ToString(rbWCK.respnse[1]);       
      }
      else
     {
      textBox_pos.Text = "Servo 11 NOT CONNECTED";
      }
}
chickenkai offline
Savvy Roboteer
Savvy Roboteer
Posts: 30
Joined: Thu Jul 26, 2012 10:09 am

Post by l3v3rz » Tue May 21, 2013 3:49 pm

Post by l3v3rz
Tue May 21, 2013 3:49 pm

hope this isn't a trick question - but yes - exactly. you may find you can reduce the value from 200ms down to may be 50-100ms. It partially depends on how big the move is, the servos have a velocity, so the bigger the move the longer it takes before it settles.
hope this isn't a trick question - but yes - exactly. you may find you can reduce the value from 200ms down to may be 50-100ms. It partially depends on how big the move is, the servos have a velocity, so the bigger the move the longer it takes before it settles.
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Post by chickenkai » Wed May 22, 2013 4:03 am

Post by chickenkai
Wed May 22, 2013 4:03 am

I tried this:

Code: Select all
if (rbWCK.wckReadPos(11))
{
   if (rbWCK.respnse[0] == 0)
  {
       rbWCK.wckMovePos(11, Convert.ToByte(trackBar1.Value), 2);
       textBox_pos.Text = Convert.ToString(trackBar1.Value);
       rbWCK.delay_ms(50);
        if (rbWCK.wckReadPos(11))
            {
               richTextBox1.Text = "Servo 11 end posture:" + Convert.ToString(rbWCK.respnse[1]);
             }
   }                       
}
else
{
   textBox_pos.Text = "Servo 11 NOT CONNECTED";
}
 


And I found that as same condition as I mentioned.

If I suddenly pull the trackBar fast and use wckReadPos the value is

inaccuracy would increase a lot, bigger than 10 degrees.

If I increase the delay time, the motor would not move smoothly.

It's so strange.
I tried this:

Code: Select all
if (rbWCK.wckReadPos(11))
{
   if (rbWCK.respnse[0] == 0)
  {
       rbWCK.wckMovePos(11, Convert.ToByte(trackBar1.Value), 2);
       textBox_pos.Text = Convert.ToString(trackBar1.Value);
       rbWCK.delay_ms(50);
        if (rbWCK.wckReadPos(11))
            {
               richTextBox1.Text = "Servo 11 end posture:" + Convert.ToString(rbWCK.respnse[1]);
             }
   }                       
}
else
{
   textBox_pos.Text = "Servo 11 NOT CONNECTED";
}
 


And I found that as same condition as I mentioned.

If I suddenly pull the trackBar fast and use wckReadPos the value is

inaccuracy would increase a lot, bigger than 10 degrees.

If I increase the delay time, the motor would not move smoothly.

It's so strange.
chickenkai offline
Savvy Roboteer
Savvy Roboteer
Posts: 30
Joined: Thu Jul 26, 2012 10:09 am


5 postsPage 1 of 1
5 postsPage 1 of 1
cron