iwik
06-03-2011, 09:06 PM
Hi Guys,
Been trying to get Code to opearate corectly. Its for a Cessna and has o 10 20 and 30
degree steps. With the following code it works with one exception.
When the Indicator moves from 20 to 30 degrees or 30 to 20 the servo seems to speed up . Looking at the Fsuipc value when its showing 8192 its at 20 but as it passes thru
i think it appears to be a slight delay the the servo operates and moves at the correct speed until 30 is reached. Its almost as though when you just pass thru this 8192
its not seeing any change then it sees it and catches up ie increase in speed.
0 to 10 to 20 degrees either up or down is fine.
Appreciate anyones help to see where ive gone wrong.
Here is the code;
//
*******************************************************************
**********
// * Config_SIOC ver 3.4 - By Manolo Vélez - www.opencockpits.com (http://www.opencockpits.com)
//
*******************************************************************
**********
// * FileName : sioc.txt
// * Date : 04/06/2011
Var 0030, Link FSUIPC_INOUT, Offset $0BE0, Length 4 // Flap
Position
{
L0 = V0030
L0 = ABS L0
L2 = L0
IF L0 <= 5461
{
L1 = L2 * 0.0325
}
ELSE
{
L2 = L0 - 5461
IF L0 <= 8192
{
L1 = L2 * 0.044
L1 = L1 + 178
}
ELSE
{
L2 = L0 - 8192
IF L0 <= 16383
{
L1 = L2 * 0.0415
L1 = L1 + 536
}
}
}
&FlapPosServo = L1 + 72
}
Var 0001, name FlapPosServo, Link USB_SERVOS, Device 0, Output 1,
PosL 1, PosC 512, PosR 1023 // FLAP INDICATOR
Thanks
Les
Been trying to get Code to opearate corectly. Its for a Cessna and has o 10 20 and 30
degree steps. With the following code it works with one exception.
When the Indicator moves from 20 to 30 degrees or 30 to 20 the servo seems to speed up . Looking at the Fsuipc value when its showing 8192 its at 20 but as it passes thru
i think it appears to be a slight delay the the servo operates and moves at the correct speed until 30 is reached. Its almost as though when you just pass thru this 8192
its not seeing any change then it sees it and catches up ie increase in speed.
0 to 10 to 20 degrees either up or down is fine.
Appreciate anyones help to see where ive gone wrong.
Here is the code;
//
*******************************************************************
**********
// * Config_SIOC ver 3.4 - By Manolo Vélez - www.opencockpits.com (http://www.opencockpits.com)
//
*******************************************************************
**********
// * FileName : sioc.txt
// * Date : 04/06/2011
Var 0030, Link FSUIPC_INOUT, Offset $0BE0, Length 4 // Flap
Position
{
L0 = V0030
L0 = ABS L0
L2 = L0
IF L0 <= 5461
{
L1 = L2 * 0.0325
}
ELSE
{
L2 = L0 - 5461
IF L0 <= 8192
{
L1 = L2 * 0.044
L1 = L1 + 178
}
ELSE
{
L2 = L0 - 8192
IF L0 <= 16383
{
L1 = L2 * 0.0415
L1 = L1 + 536
}
}
}
&FlapPosServo = L1 + 72
}
Var 0001, name FlapPosServo, Link USB_SERVOS, Device 0, Output 1,
PosL 1, PosC 512, PosR 1023 // FLAP INDICATOR
Thanks
Les