winxp sp1 + standard servo

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

winxp sp1 + standard servo

Post by KLR233 » Tue Jul 21, 2009 11:22 pm

Post by KLR233
Tue Jul 21, 2009 11:22 pm

Hi everyone
I have just recieve my new toy, i strugled with the stuff during one entire week end to get it working! I'm running win xp sp1 with an usb wifi key on it and it's running fine!! Now it comes to coding. I'm trying to get three standard servo(futaba S3003) working but there is no way those little things moves!!

The executable (MFC + roboard lib + winio/dll/vxd/sys) produced with visual studio 2005 sp1 executes itself on the roboard without any problem(window showed, log working, no crash).
I've changed the pwm switch to be pull down, change the bios to get port0 & port1 to be gpio and each bits set as output with zero at start.

After init and choosing channel 0,1,2 doing the init then send pwm pulse and wait for the end (cycle 10000 µs duty 1500 µs) but those damn things just don't move. PLEASE HELP
Hi everyone
I have just recieve my new toy, i strugled with the stuff during one entire week end to get it working! I'm running win xp sp1 with an usb wifi key on it and it's running fine!! Now it comes to coding. I'm trying to get three standard servo(futaba S3003) working but there is no way those little things moves!!

The executable (MFC + roboard lib + winio/dll/vxd/sys) produced with visual studio 2005 sp1 executes itself on the roboard without any problem(window showed, log working, no crash).
I've changed the pwm switch to be pull down, change the bios to get port0 & port1 to be gpio and each bits set as output with zero at start.

After init and choosing channel 0,1,2 doing the init then send pwm pulse and wait for the end (cycle 10000 µs duty 1500 µs) but those damn things just don't move. PLEASE HELP
KLR233 offline
Newbie
Newbie
Posts: 2
Joined: Tue Jul 21, 2009 10:57 pm

Post by PedroR » Wed Jul 22, 2009 3:31 pm

Post by PedroR
Wed Jul 22, 2009 3:31 pm

hi

we've had reports of people trying to get pwm working but needing some time to get the hang of it.

Can you try with only 1 servo and using the roboard IO librar functions (position set and position) read instead of sending direct pwm pulses?

I would with a position read command to make sure you are able to communicate with the servo (if that servo model has position feedback).

Please let us know how it went.
Also make sure you are using the correct PWM port number....

Regards
Pedro
hi

we've had reports of people trying to get pwm working but needing some time to get the hang of it.

Can you try with only 1 servo and using the roboard IO librar functions (position set and position) read instead of sending direct pwm pulses?

I would with a position read command to make sure you are able to communicate with the servo (if that servo model has position feedback).

Please let us know how it went.
Also make sure you are using the correct PWM port number....

Regards
Pedro
PedroR offline
Savvy Roboteer
Savvy Roboteer
Posts: 1199
Joined: Mon Jun 16, 2008 11:07 pm

Post by KLR233 » Thu Jul 23, 2009 8:23 am

Post by KLR233
Thu Jul 23, 2009 8:23 am

Thanks for your reply

By the way those are cheap standard servo without feedback.
And i'm using the provided lib function within there is no way of choosing any pwm ports.

here is the code

DWORD CMFCBotBrain2Dlg::MainThread(void * pthis)
{

unsignedlong PWM_period = 10000;
unsignedlong PWM_duty = 1500;
unsignedlong SpeedCount = 100;
CString LogString_ST;
char pWork_c[150];

CMFCBotBrain2Dlg *pDial_O;
pDial_O = (CMFCBotBrain2Dlg *) pthis;
pDial_O->AddLog("Thread Start");
if (rcservo_Initialize(RCSERVO_USECHANNEL0 + RCSERVO_USECHANNEL1 + RCSERVO_USECHANNEL2) == RBAPI(false))
{
pDial_O->AddLog("RC SERVO INIT FAILED ");
pDial_O->AddLog(roboio_GetErrMsg());
}
else
{
pDial_O->AddLog("RC SERVO INIT SUCCESSFULL");
}

rcservo_EnterPWMMode();
do
{
rcservo_SendPWMPulses(RCSERVO_USECHANNEL0,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL1,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL2,PWM_peri od,PWM_duty,SpeedCount);
do
{
}
while(!rcservo_IsPWMCompleted(RCSERVO_USECHANNEL2));


if (PWM_duty != pDial_O-> PWM_duty)
{
PWM_duty = pDial_O->PWM_duty;
sprintf(pWork_c,"PWM DUTTY UPDATED %d",PWM_duty);
LogString_ST = pWork_c;
pDial_O->AddLog(LogString_ST);
}

}
while(pDial_O->QuitThread_b == false);

rcservo_Close();
pDial_O->AddLog("THREAD ENDED");
return (0);
}
Thanks for your reply

By the way those are cheap standard servo without feedback.
And i'm using the provided lib function within there is no way of choosing any pwm ports.

here is the code

DWORD CMFCBotBrain2Dlg::MainThread(void * pthis)
{

unsignedlong PWM_period = 10000;
unsignedlong PWM_duty = 1500;
unsignedlong SpeedCount = 100;
CString LogString_ST;
char pWork_c[150];

CMFCBotBrain2Dlg *pDial_O;
pDial_O = (CMFCBotBrain2Dlg *) pthis;
pDial_O->AddLog("Thread Start");
if (rcservo_Initialize(RCSERVO_USECHANNEL0 + RCSERVO_USECHANNEL1 + RCSERVO_USECHANNEL2) == RBAPI(false))
{
pDial_O->AddLog("RC SERVO INIT FAILED ");
pDial_O->AddLog(roboio_GetErrMsg());
}
else
{
pDial_O->AddLog("RC SERVO INIT SUCCESSFULL");
}

rcservo_EnterPWMMode();
do
{
rcservo_SendPWMPulses(RCSERVO_USECHANNEL0,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL1,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL2,PWM_peri od,PWM_duty,SpeedCount);
do
{
}
while(!rcservo_IsPWMCompleted(RCSERVO_USECHANNEL2));


if (PWM_duty != pDial_O-> PWM_duty)
{
PWM_duty = pDial_O->PWM_duty;
sprintf(pWork_c,"PWM DUTTY UPDATED %d",PWM_duty);
LogString_ST = pWork_c;
pDial_O->AddLog(LogString_ST);
}

}
while(pDial_O->QuitThread_b == false);

rcservo_Close();
pDial_O->AddLog("THREAD ENDED");
return (0);
}
KLR233 offline
Newbie
Newbie
Posts: 2
Joined: Tue Jul 21, 2009 10:57 pm

Post by roboard » Fri Jul 24, 2009 3:39 am

Post by roboard
Fri Jul 24, 2009 3:39 am

KLR233 wrote:do
{
rcservo_SendPWMPulses(RCSERVO_USECHANNEL0,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL1,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL2,PWM_peri od,PWM_duty,SpeedCount);
......


Hi, KLR233,

the "RCSERVO_USECHANNEL0/1/2" in the above rcservo_SendPWMPulses() and rcservo_IsPWMCompleted() calls should be changed to 0/1/2, and "RBAPI(false)" should be changed to "false". Try it again? (Also please ensure that you use the newest version of RoBoIO library, i.e., v1.5.)

I also have pm you a test code using PWM lib. Please see the pm message. :)

We are buying a Futaba S3003 servo for test, and will report the test result later.
KLR233 wrote:do
{
rcservo_SendPWMPulses(RCSERVO_USECHANNEL0,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL1,PWM_peri od,PWM_duty,SpeedCount);
rcservo_SendPWMPulses(RCSERVO_USECHANNEL2,PWM_peri od,PWM_duty,SpeedCount);
......


Hi, KLR233,

the "RCSERVO_USECHANNEL0/1/2" in the above rcservo_SendPWMPulses() and rcservo_IsPWMCompleted() calls should be changed to 0/1/2, and "RBAPI(false)" should be changed to "false". Try it again? (Also please ensure that you use the newest version of RoBoIO library, i.e., v1.5.)

I also have pm you a test code using PWM lib. Please see the pm message. :)

We are buying a Futaba S3003 servo for test, and will report the test result later.
roboard offline
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am


4 postsPage 1 of 1
4 postsPage 1 of 1