PDA

View Full Version : Opencockpits USB Servo Card + 737 Flap Gauge



Key737
09-06-2011, 10:57 AM
Hi all.

I really need some help with a problem on the OC USB Servo Card + Flap Gauge.
I'm not as far in yet as writing the SIOC Script, I am just purely using the IOCards_test.exe that OC supply on their website.

The test software recognises the USB Servo Card. I have plugged in the flap gauge into Servo socket 1. As soon as I plug in the 5V power supply, the servo automatically turns all the way anti-clockwise until it reaches its end and that is it.

If I change the value in the Test program to set the gauge to a certain value, it wont move to that position. it will just try to move anti-clcokwise until it reaches the end of its turning.

Also on the left hand side of the screen on the test software, the potentiometer input values are jumping between 60-100 very quickly, when nothing is connected to them.

Any thoughts??

Many Thanks

Rich
Key737

iwik
09-06-2011, 02:31 PM
Hi Rich,
First up ,dont worry about the values on the left side jumping as this normal because the inputs are floating. If this annoys you just puta jumper between
centre and either pin. Should then read 0 or 255, 0 representing 0v and 255 5v.
Did you build it yourself or was the Card and Flap unit supplied by OC?. You should be able to drag the slider and make the servo move from one end to the other. Can you do that?. Also 5v needs to be connected to the servo card.
Let us know your answers, by the way there is code for flaps in the manual for this gauge if you didnt already know.
Les

dazchad
09-07-2011, 02:01 AM
// *****************************************************************************
// * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : indicador flaps USBServos mas LE.txt
// * Date : 23/11/2009



Var 0000, Value 0
{
&ind_le_extend = 0
&ind_le_trans = 0
}

Var 0001, name servo_flaps, Link USB_SERVOS, Output 1, PosL 0, PosC 511, PosR 1023

Var 0002, name flaps_fsuipc, Link FSUIPC_IN, Offset $0BE0, Length 4
{
L0 = &flaps_fsuipc
L0 = ABS L0
IF L0 = 0
{
&ind_le_extend = 0
&ind_le_trans = 0
}
ELSE
{
L1 = 0
&ind_le_trans = 1
IF L0 = 409
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 819
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 2047
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 4095
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 6143
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 10239
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 12287
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 16383
{
L1 = 1
&ind_le_trans = 0
}
&ind_le_extend = L1
}
L2 = L0
C0 = L0 >= 0
C1 = L0 <= 409
IF C0 AND C1
{
&flaps_low_val = 0
&flaps_high_val = 409
&servo_high_val = 999
&servo_low_val = 880 // 0 and 1
}
C0 = L0 >= 409
C1 = L0 <= 819
IF C0 AND C1
{
&flaps_low_val = 409
&flaps_high_val = 819
&servo_high_val = 880
&servo_low_val = 760 // 1 and 2
}
C0 = L0 >= 819
C1 = L0 <= 2047
IF C0 AND C1
{
&flaps_low_val = 819
&flaps_high_val = 2047
&servo_high_val = 760
&servo_low_val = 670 // 2 and 5
}
C0 = L0 >= 2047
C1 = L0 <= 4095
IF C0 AND C1
{
&flaps_low_val = 2047
&flaps_high_val = 4095
&servo_high_val = 670
&servo_low_val = 510 // 5 and 10
}
C0 = L0 >= 4095
C1 = L0 <= 6143
IF C0 AND C1
{
&flaps_low_val = 4095
&flaps_high_val = 6143
&servo_high_val = 510
&servo_low_val = 420 // 10 and 15
}
C0 = L0 >= 6143
C1 = L0 <= 10239
IF C0 AND C1
{
&flaps_low_val = 6143
&flaps_high_val = 10239
&servo_high_val = 420
&servo_low_val = 330 // 15 and 25
}
C0 = L0 >= 10239
C1 = L0 <= 12287
IF C0 AND C1
{
&flaps_low_val = 10239
&flaps_high_val = 12287
&servo_high_val = 330
&servo_low_val = 240 // 25 and 30
}
C0 = L0 >= 12287
C1 = L0 <= 16383
IF C0 AND C1
{
&flaps_low_val = 12287
&flaps_high_val = 16383
&servo_high_val = 240
&servo_low_val = 171 // 30 and 40
}
&servo_calc = &servo_low_val - &servo_high_val
&flaps_calc = &flaps_high_val - &flaps_low_val
&flaps_val = L0 - &flaps_low_val
&servo_val = &servo_calc * &flaps_val
&servo_val = &servo_val / &flaps_calc
L1 = &servo_high_val + &servo_val
&servo_flaps = L1
}

Var 0003, name servo_val

Var 0004, name flaps_calc

Var 0005, name servo_calc

Var 0006, name flaps_val

Var 0007, name flaps_low_val

Var 0008, name flaps_high_val

Var 0009, name servo_high_val

Var 0010, name servo_low_val

Var 0011, name ind_le_extend, Link IOCARD_OUT, Output 22

Var 0012, name ind_le_trans, Link IOCARD_OUT, Output 21



hi rich this is my SIOC Script for 737 f/g

Key737
09-07-2011, 04:20 AM
DazChad

Thanks for this! This will save me a lot of headache! :)


// *****************************************************************************
// * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : indicador flaps USBServos mas LE.txt
// * Date : 23/11/2009



Var 0000, Value 0
{
&ind_le_extend = 0
&ind_le_trans = 0
}

Var 0001, name servo_flaps, Link USB_SERVOS, Output 1, PosL 0, PosC 511, PosR 1023

Var 0002, name flaps_fsuipc, Link FSUIPC_IN, Offset $0BE0, Length 4
{
L0 = &flaps_fsuipc
L0 = ABS L0
IF L0 = 0
{
&ind_le_extend = 0
&ind_le_trans = 0
}
ELSE
{
L1 = 0
&ind_le_trans = 1
IF L0 = 409
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 819
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 2047
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 4095
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 6143
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 10239
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 12287
{
L1 = 1
&ind_le_trans = 0
}
IF L0 = 16383
{
L1 = 1
&ind_le_trans = 0
}
&ind_le_extend = L1
}
L2 = L0
C0 = L0 >= 0
C1 = L0 <= 409
IF C0 AND C1
{
&flaps_low_val = 0
&flaps_high_val = 409
&servo_high_val = 999
&servo_low_val = 880 // 0 and 1
}
C0 = L0 >= 409
C1 = L0 <= 819
IF C0 AND C1
{
&flaps_low_val = 409
&flaps_high_val = 819
&servo_high_val = 880
&servo_low_val = 760 // 1 and 2
}
C0 = L0 >= 819
C1 = L0 <= 2047
IF C0 AND C1
{
&flaps_low_val = 819
&flaps_high_val = 2047
&servo_high_val = 760
&servo_low_val = 670 // 2 and 5
}
C0 = L0 >= 2047
C1 = L0 <= 4095
IF C0 AND C1
{
&flaps_low_val = 2047
&flaps_high_val = 4095
&servo_high_val = 670
&servo_low_val = 510 // 5 and 10
}
C0 = L0 >= 4095
C1 = L0 <= 6143
IF C0 AND C1
{
&flaps_low_val = 4095
&flaps_high_val = 6143
&servo_high_val = 510
&servo_low_val = 420 // 10 and 15
}
C0 = L0 >= 6143
C1 = L0 <= 10239
IF C0 AND C1
{
&flaps_low_val = 6143
&flaps_high_val = 10239
&servo_high_val = 420
&servo_low_val = 330 // 15 and 25
}
C0 = L0 >= 10239
C1 = L0 <= 12287
IF C0 AND C1
{
&flaps_low_val = 10239
&flaps_high_val = 12287
&servo_high_val = 330
&servo_low_val = 240 // 25 and 30
}
C0 = L0 >= 12287
C1 = L0 <= 16383
IF C0 AND C1
{
&flaps_low_val = 12287
&flaps_high_val = 16383
&servo_high_val = 240
&servo_low_val = 171 // 30 and 40
}
&servo_calc = &servo_low_val - &servo_high_val
&flaps_calc = &flaps_high_val - &flaps_low_val
&flaps_val = L0 - &flaps_low_val
&servo_val = &servo_calc * &flaps_val
&servo_val = &servo_val / &flaps_calc
L1 = &servo_high_val + &servo_val
&servo_flaps = L1
}

Var 0003, name servo_val

Var 0004, name flaps_calc

Var 0005, name servo_calc

Var 0006, name flaps_val

Var 0007, name flaps_low_val

Var 0008, name flaps_high_val

Var 0009, name servo_high_val

Var 0010, name servo_low_val

Var 0011, name ind_le_extend, Link IOCARD_OUT, Output 22

Var 0012, name ind_le_trans, Link IOCARD_OUT, Output 21



hi rich this is my SIOC Script for 737 f/g

Key737
09-07-2011, 04:23 AM
Les

Thanks for the reply! Great to know about the potentiometer values, thanks. The card was pre-built along with the flap gauge and both supplied by OpenCockpits. There is a 5V supply connected up to the board already. When I drag the slider from one end to the other, it has no effect on the flap gauge. As soon as the 5v power is connected, the gauge just moves anti-clockwise on its own, until it reaches the end of its turn cycle.


Hi Rich,
First up ,dont worry about the values on the left side jumping as this normal because the inputs are floating. If this annoys you just puta jumper between
centre and either pin. Should then read 0 or 255, 0 representing 0v and 255 5v.
Did you build it yourself or was the Card and Flap unit supplied by OC?. You should be able to drag the slider and make the servo move from one end to the other. Can you do that?. Also 5v needs to be connected to the servo card.
Let us know your answers, by the way there is code for flaps in the manual for this gauge if you didnt already know.
Les

fordgt40
09-07-2011, 04:50 AM
Rich

When you connect the servo, to the controller card and turn the power supply on, does the little "radio button" underneath "ser-1" turn black?

David

Key737
09-07-2011, 05:33 AM
David

When everything is connected, nothing changes on the iocards_test.exe. It recognises the card, with device ID of 2048, and shows potentioeter values moving (until i stopped them by putting a jumper on each one). The radio button under Ser-1 is already black when program opens. Even when I select Ser-6. and then connect everything, it dosent switch to Ser-1. The gauge is definetly connected to Ser-1.

Thanks

Rich


Rich

When you connect the servo, to the controller card and turn the power supply on, does the little "radio button" underneath "ser-1" turn black?

David

fordgt40
09-07-2011, 05:51 AM
Rich

So whatever servo input you use, the appropriate radio button turns black, but the servo always rotates fully anticlockwise and will not respond to the slider or manual input.

I assume that your pc properly recognises the servo usb card ie not as "unkown device". Have you tried using different USB ports and I assume you are not connecting through a hub?

Running out of suggestions here:-?

David

Key737
09-07-2011, 05:59 AM
David

The radio buttons Do Not turn black. It just stays on Ser-1 unless i physically change it with the mouse in the software.

It recognises the card, and assigns it the device ID of 2048. It detects the potentiometer inputs so I know it is seeing the card. I have tried 3 different USB ports, and 2 different machines altogether. No hub, directly into each machine when tried. I know, It is very confusing, since all I have read about this from people, saying it is a very easy setup. We can only come to the conclusion that it is either a dodgy card or Servo.


Rich

So whatever servo input you use, the appropriate radio button turns black, but the servo always rotates fully anticlockwise and will not respond to the slider or manual input.

I assume that your pc properly recognises the servo usb card ie not as "unkown device". Have you tried using different USB ports and I assume you are not connecting through a hub?

Running out of suggestions here:-?

David

Perik
09-07-2011, 06:52 AM
Rich,

Have you verified the Servo wiring?

J9 a J14 – Servo motors
Pin 1 = +5V
Pin 2 = Data (S)
Pin 3 = GND

Key737
09-12-2011, 07:48 AM
Rich,

Have you verified the Servo wiring?

J9 a J14 – Servo motors
Pin 1 = +5V
Pin 2 = Data (S)
Pin 3 = GND


Thanks very much for all of your ideas! Turns out it was a broken servo in the flap gauge module. Have installed a replacement and all is working perfectly!

Many Thanks!

Rich

Also we have a website of www.key737.co.uk if any of you want to take a look, which includes photos and videos of the build.

Im sure I will be back with more questions for you! :). Its a big learning curve.

fordgt40
09-12-2011, 08:45 AM
Rich

That was unlucky, but glad to see that it is now sorted

David