Accessing ICS modes in Kondo PWM servos with RoBoIO

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.
5 postsPage 1 of 1
5 postsPage 1 of 1

Accessing ICS modes in Kondo PWM servos with RoBoIO

Post by veltrop » Thu Oct 21, 2010 6:40 pm

Post by veltrop
Thu Oct 21, 2010 6:40 pm

I would like to access the different ICS modes of my Kondo servos. I'm referring to the different sets of pulse stretch and speed settings that can be stored in the servos, as described in the latter part of this page.

Here's the output on an oscilloscope connected to an RCB-3HV when activating mode 3 using Heart2Heart:

Image

It looks like it sends a pulse of 200 ms before the position pulse, modes 1 and 2 send 100 and 150 ms pre-pulses.

How can I reproduce this behavior in RoBoIO? Looking at the rcservo.cpp source I see:
Code: Select all
case RCSERVO_KONDO_COMMON:  //common setting for KONDO's servos
//...
rcservo_SetCmdPulse(channel, RCSERVO_CMD_POWEROFF, 50L);
rcservo_SetCmdPulse(channel, RCSERVO_CMD1, 100L);
rcservo_SetCmdPulse(channel, RCSERVO_CMD2, 150L);
rcservo_SetCmdPulse(channel, RCSERVO_CMD3, 200L);

So it seems like this lines up with the timings of the ICS settings, but I can't get it to work.

I've tried calling rcservo_SetPlayModeCMD(servo, RCSERVO_CMD3 etc) in various places in some test code and it there's no effect on the output on the oscilloscope, it always looks like a normal PWM signal.

How do I properly call the rcservo_SetPlayModeCMD() function, or how else can I access the ICS modes with RoBoIO?
I would like to access the different ICS modes of my Kondo servos. I'm referring to the different sets of pulse stretch and speed settings that can be stored in the servos, as described in the latter part of this page.

Here's the output on an oscilloscope connected to an RCB-3HV when activating mode 3 using Heart2Heart:

Image

It looks like it sends a pulse of 200 ms before the position pulse, modes 1 and 2 send 100 and 150 ms pre-pulses.

How can I reproduce this behavior in RoBoIO? Looking at the rcservo.cpp source I see:
Code: Select all
case RCSERVO_KONDO_COMMON:  //common setting for KONDO's servos
//...
rcservo_SetCmdPulse(channel, RCSERVO_CMD_POWEROFF, 50L);
rcservo_SetCmdPulse(channel, RCSERVO_CMD1, 100L);
rcservo_SetCmdPulse(channel, RCSERVO_CMD2, 150L);
rcservo_SetCmdPulse(channel, RCSERVO_CMD3, 200L);

So it seems like this lines up with the timings of the ICS settings, but I can't get it to work.

I've tried calling rcservo_SetPlayModeCMD(servo, RCSERVO_CMD3 etc) in various places in some test code and it there's no effect on the output on the oscilloscope, it always looks like a normal PWM signal.

How do I properly call the rcservo_SetPlayModeCMD() function, or how else can I access the ICS modes with RoBoIO?
veltrop offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 59
Joined: Wed Jul 22, 2009 8:04 am
Location: Japan

Re: Accessing ICS modes in Kondo PWM servos with RoBoIO

Post by roboard » Fri Oct 22, 2010 7:08 am

Post by roboard
Fri Oct 22, 2010 7:08 am

Hi,

the position pulse following the 200us pulse may be the feedback pulse of the KONDO servo (according to the description in their datasheet).

When entering the play mode, the RC servo lib of RoBoIO first sends a command pulse (50us, 100us, 150us, or 200us, ...; default by 100us) to read the positions of all servos as the home position. The command pulse can be customized by calling rcservo_SetPlayModeCMD().

Because the command pulse is sent only once when entering the play mode, you cannot see it in later pulse sequences.

:)
Hi,

the position pulse following the 200us pulse may be the feedback pulse of the KONDO servo (according to the description in their datasheet).

When entering the play mode, the RC servo lib of RoBoIO first sends a command pulse (50us, 100us, 150us, or 200us, ...; default by 100us) to read the positions of all servos as the home position. The command pulse can be customized by calling rcservo_SetPlayModeCMD().

Because the command pulse is sent only once when entering the play mode, you cannot see it in later pulse sequences.

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

Post by veltrop » Fri Oct 22, 2010 8:43 am

Post by veltrop
Fri Oct 22, 2010 8:43 am

Ah, thanks for the clarifying info!

So are you saying that I could to do something like this to change ICS settings on the fly?:

Code: Select all

unsigned long   playframe_[32];

memset(playframe_, 0, sizeof(long) * 32);

rcservo_SetServo(0x1, RCSERVO_KONDO_KRS78X);
rcservo_Initialize(0x1);

rcservo_EnableMPOS();
rcservo_SetFPS(100);
 
rcservo_SetPlayModeCMD(0x1, RCSERVO_CMD2);

rcservo_EnterPlayMode();
 
playframe_[0] = 1000;

rcservo_MoveTo(playframe_, 2000);


// exit playmode???


rcservo_SetPlayModeCMD(0x1, RCSERVO_CMD3);

rcservo_EnterPlayMode();
 
playframe_[0] = 1500;

rcservo_MoveTo(playframe_, 2000);
 
rcservo_Close();



Would this do two different sets of servo behavior? Can you call rcservo_EnterPlayMode() multiple times like that?
Ah, thanks for the clarifying info!

So are you saying that I could to do something like this to change ICS settings on the fly?:

Code: Select all

unsigned long   playframe_[32];

memset(playframe_, 0, sizeof(long) * 32);

rcservo_SetServo(0x1, RCSERVO_KONDO_KRS78X);
rcservo_Initialize(0x1);

rcservo_EnableMPOS();
rcservo_SetFPS(100);
 
rcservo_SetPlayModeCMD(0x1, RCSERVO_CMD2);

rcservo_EnterPlayMode();
 
playframe_[0] = 1000;

rcservo_MoveTo(playframe_, 2000);


// exit playmode???


rcservo_SetPlayModeCMD(0x1, RCSERVO_CMD3);

rcservo_EnterPlayMode();
 
playframe_[0] = 1500;

rcservo_MoveTo(playframe_, 2000);
 
rcservo_Close();



Would this do two different sets of servo behavior? Can you call rcservo_EnterPlayMode() multiple times like that?
veltrop offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 59
Joined: Wed Jul 22, 2009 8:04 am
Location: Japan

Post by roboard » Tue Oct 26, 2010 4:32 am

Post by roboard
Tue Oct 26, 2010 4:32 am

You can call rcservo_SetPlayModeCMD() & rcservo_EnterPlayMode() multiple times within Play Mode to change the internal settings of servos.

Alternatively, there is an untested function called rcservo_PlayActionMix() that allows to send servo command pulses in realtime when playing a motion frame. Its usage is as follows:

Code: Select all
rcservo_SetAction(width, ...);
while (rcservo_PlayActionMix(mixwidth) != RCSERVO_PLAYEND)
{
    change the content of mixwidth[] in realtime ...
}


the mixwidth[] is an unsigned long array of 32 elements; when playing the motion frame with rcservo_PlayActionMix(mixwidth), it shall add each element of mixwidth[] to the currently calculated position of the corresponding channel; i.e., the real width of the position pulse to each servo will be the mix of the calculated position width and the mixwidth.

There are special mixwidthes defined in rcservo.h: RCSERVO_MIXWIDTH_CMD1, ..., RCSERVO_MIXWIDTH_CMD7. When seeing RCSERVO_MIXWIDTH_CMDx in mixwidth[], rcservo_PlayActionMix() will replace the calculated position pulse width by the corresponding command pulse width. This can be used to send servo command pulses in realtime when you are playing a motion frame.

:)
You can call rcservo_SetPlayModeCMD() & rcservo_EnterPlayMode() multiple times within Play Mode to change the internal settings of servos.

Alternatively, there is an untested function called rcservo_PlayActionMix() that allows to send servo command pulses in realtime when playing a motion frame. Its usage is as follows:

Code: Select all
rcservo_SetAction(width, ...);
while (rcservo_PlayActionMix(mixwidth) != RCSERVO_PLAYEND)
{
    change the content of mixwidth[] in realtime ...
}


the mixwidth[] is an unsigned long array of 32 elements; when playing the motion frame with rcservo_PlayActionMix(mixwidth), it shall add each element of mixwidth[] to the currently calculated position of the corresponding channel; i.e., the real width of the position pulse to each servo will be the mix of the calculated position width and the mixwidth.

There are special mixwidthes defined in rcservo.h: RCSERVO_MIXWIDTH_CMD1, ..., RCSERVO_MIXWIDTH_CMD7. When seeing RCSERVO_MIXWIDTH_CMDx in mixwidth[], rcservo_PlayActionMix() will replace the calculated position pulse width by the corresponding command pulse width. This can be used to send servo command pulses in realtime when you are playing a motion frame.

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

Post by veltrop » Tue Oct 26, 2010 4:51 pm

Post by veltrop
Tue Oct 26, 2010 4:51 pm

Thanks for all the help. Both methods worked for me.

I was having problems with shaky servos and the shakes go away when I switch to a softer ICS setting.
Thanks for all the help. Both methods worked for me.

I was having problems with shaky servos and the shakes go away when I switch to a softer ICS setting.
veltrop offline
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 59
Joined: Wed Jul 22, 2009 8:04 am
Location: Japan


5 postsPage 1 of 1
5 postsPage 1 of 1
cron