by hellu » Wed Feb 16, 2011 12:04 am
by hellu
Wed Feb 16, 2011 12:04 am
roboard wrote:please check the range of the servo duty.
If the servo position that you set is out of the range, the servo will not work.
I've encountered this problem with the width out of range and I cannot solve it, any value I put in the nofb_home_position and servo_position arry. What type of data must it contain, I see it is uint and the value is in us. For the middle of the servo i guess it is 1500, right?
The error that it gives me is
"warning: set_play mode_pulses() receives width 0 out of range for channel 15! "
What can it be the problem?
Here is the code. 1st it should go to 1500 then to 1800, but it goes to the end and gives "warning: set_play mode_pulses() receives width 0 out of range for channel 15! " in the console.
using System;
using System.Collections.Generic;
using System.Text;
using RoBoIO_DotNet;
using System.Threading;
namespace example_sv
{
class example_sv
{
static void Main(string[] args)
{
uint[] position = new uint[32];
uint[] home = new uint[32];
home[0] = 1500 ;
position[0] = 1800;
RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.rcservo_SetServo(15, RoBoIO.RCSERVO_SERVO_DEFAULT_NOFB) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
if (RoBoIO.rcservo_Initialize(RoBoIO.RCSERVO_USECHANNEL15) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
RoBoIO.rcservo_EnterPlayMode_NOFB(home);
RoBoIO.rcservo_MoveTo(position, 1000);
Console.ReadLine();
RoBoIO.rcservo_Close();
return;
}
}
}
Best regards, Vlad
roboard wrote:please check the range of the servo duty.
If the servo position that you set is out of the range, the servo will not work.
I've encountered this problem with the width out of range and I cannot solve it, any value I put in the nofb_home_position and servo_position arry. What type of data must it contain, I see it is uint and the value is in us. For the middle of the servo i guess it is 1500, right?
The error that it gives me is
"warning: set_play mode_pulses() receives width 0 out of range for channel 15! "
What can it be the problem?
Here is the code. 1st it should go to 1500 then to 1800, but it goes to the end and gives "warning: set_play mode_pulses() receives width 0 out of range for channel 15! " in the console.
using System;
using System.Collections.Generic;
using System.Text;
using RoBoIO_DotNet;
using System.Threading;
namespace example_sv
{
class example_sv
{
static void Main(string[] args)
{
uint[] position = new uint[32];
uint[] home = new uint[32];
home[0] = 1500 ;
position[0] = 1800;
RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.rcservo_SetServo(15, RoBoIO.RCSERVO_SERVO_DEFAULT_NOFB) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
if (RoBoIO.rcservo_Initialize(RoBoIO.RCSERVO_USECHANNEL15) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
RoBoIO.rcservo_EnterPlayMode_NOFB(home);
RoBoIO.rcservo_MoveTo(position, 1000);
Console.ReadLine();
RoBoIO.rcservo_Close();
return;
}
}
}
Best regards, Vlad