Open Cockpits USB servo card and flap gauge setup [SOLVED]

This is a new forum for the OC4BAv4.
Post Reply
dornier
Posts: 30
Joined: Wed Dec 14, 2016 3:58 am

Open Cockpits USB servo card and flap gauge setup [SOLVED]

Post by dornier »

Hi all,

I received an Opencockpits USB servo card today. I hooked it all up and with SOIC monitor I was able to move the flap indicator, but I'm lost on how to set it up with OC4BAv4. Could someone please help me setup the flap gauge? By the way, I'm using the OCP4NGX version 4.4.0.0 and OCP4NGX_v4.4.ssi.

Thanks!

George
mvr1918
Site Admin
Posts: 1703
Joined: Thu Aug 30, 2012 3:35 pm

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by mvr1918 »

The Flap servo should be connected to Output 1 of The Servo Card.

Connect Servo Card USB to PC.

Start OC4BAv4.

Click Config

Click PMDG B737

Click OCP4NGX_v4.4.ssi

Now all P&P modules should be listed in the Cockpit configuration box

Click detected Servo Card in Modules box

Click MIP_ServoCard1 in Operation box

Now The MIP_Servo should be added to the Cockpit configuration box

Exit Config
dornier
Posts: 30
Joined: Wed Dec 14, 2016 3:58 am

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by dornier »

mvr1918 wrote:The Flap servo should be connected to Output 1 of The Servo Card.

Connect Servo Card USB to PC.

Start OC4BAv4.

Click Config

Click PMDG B737

Click OCP4NGX_v4.4.ssi

Now all P&P modules should be listed in the Cockpit configuration box

Click detected Servo Card in Modules box

Click MIP_ServoCard1 in Operation box

Now The MIP_Servo should be added to the Cockpit configuration box

Exit Config
Hi,

When I selected the servo (-61), the servo started jumping from about the flaps 5 position to about the flaps 30 position. Once I selected MIP servo for the operation and exited the config screen, I selected the 737 icon and the flap indicator goes to the less than flaps up position and stops. When the flaps are moving, the servo doesn't move. The Servo USB number is -61. When I use the SIOC monitor, the Flaps Up value is 235 and Flaps 40 is 794. The flap indicator I'm using only has one needle. I guess if any of the code has to be modified, it could be either one (L or R)? Which values need to be changed for this to work?

The servo is connected to the Servo 1 jumper. In SIOC monitor, IDX = 36 and Device =61

Here's part of the script that I exported. If you need any other part or the whole thing, please let me know, thanks.:


Var 0331, name servo_flaps, Link USB_SERVOS, Device 36, Output 1, PosL 160, PosC 511, PosR 1000

Var 0428, name flaps, static, Value 0
{
L0 = &flaps
L2 = L0
C0 = L0 >= 0
C1 = L0 <= 1000
IF C0 AND C1
{
&flaps_low_val = 0
&flaps_high_val = 1000
&servo_high_val = 160
&servo_low_val = 240 // 0 and 1
}
C0 = L0 >= 1000
C1 = L0 <= 2000
IF C0 AND C1
{
&flaps_low_val = 1000
&flaps_high_val = 2000
&servo_high_val = 240
&servo_low_val = 350 // 1 and 2
}
C0 = L0 >= 2000
C1 = L0 <= 5000
IF C0 AND C1
{
&flaps_low_val = 2000
&flaps_high_val = 5000
&servo_high_val = 350
&servo_low_val = 460 // 2 and 5
}
C0 = L0 >= 5000
C1 = L0 <= 10000
IF C0 AND C1
{
&flaps_low_val = 5000
&flaps_high_val = 10000
&servo_high_val = 460
&servo_low_val = 570 // 5 and 10
}
C0 = L0 >= 10000
C1 = L0 <= 15000
IF C0 AND C1
{
&flaps_low_val = 10000
&flaps_high_val = 15000
&servo_high_val = 570
&servo_low_val = 650 // 10 and 15
}
C0 = L0 >= 15000
C1 = L0 <= 25000
IF C0 AND C1
{
&flaps_low_val = 15000
&flaps_high_val = 25000
&servo_high_val = 650
&servo_low_val = 740 // 15 and 25
}
C0 = L0 >= 25000
C1 = L0 <= 30000
IF C0 AND C1
{
&flaps_low_val = 25000
&flaps_high_val = 30000
&servo_high_val = 740
&servo_low_val = 830 // 25 and 30
}
C0 = L0 >= 30000
C1 = L0 <= 40000
IF C0 AND C1
{
&flaps_low_val = 30000
&flaps_high_val = 40000
&servo_high_val = 830
&servo_low_val = 940 // 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 0332, name servo_val

Var 0333, name flaps_calc

Var 0334, name servo_calc

Var 0335, name flaps_val

Var 0336, name flaps_low_val

Var 0337, name flaps_high_val

Var 0338, name servo_high_val

Var 0339, name servo_low_val

Var 0340, name servo_flaps2, Link USB_SERVOS, Device 36, Output 2, PosL 160, PosC 511, PosR 1000

Var 0430, name flaps2, static, Value 0
{
L0 = &flaps2
L2 = L0
C0 = L0 >= 0
C1 = L0 <= 1000
IF C0 AND C1
{
&flaps_low_v2 = 0
&flaps_high_v2 = 1000
&servo_high_v2 = 169
&servo_low_v2 = 281 // 0 and 1
}
C0 = L0 >= 1000
C1 = L0 <= 2000
IF C0 AND C1
{
&flaps_low_v2 = 1000
&flaps_high_v2 = 2000
&servo_high_v2 = 281
&servo_low_v2 = 480 // 1 and 2
}
C0 = L0 >= 2000
C1 = L0 <= 5000
IF C0 AND C1
{
&flaps_low_v2 = 2000
&flaps_high_v2 = 5000
&servo_high_v2 = 480
&servo_low_v2 = 536 // 2 and 5
}
C0 = L0 >= 5000
C1 = L0 <= 10000
IF C0 AND C1
{
&flaps_low_v2 = 5000
&flaps_high_v2 = 10000
&servo_high_v2 = 536
&servo_low_v2 = 642 // 5 and 10
}
C0 = L0 >= 10000
C1 = L0 <= 15000
IF C0 AND C1
{
&flaps_low_v2 = 10000
&flaps_high_v2 = 15000
&servo_high_v2 = 642
&servo_low_v2 = 745 // 10 and 15
}
C0 = L0 >= 15000
C1 = L0 <= 25000
IF C0 AND C1
{
&flaps_low_v2 = 15000
&flaps_high_v2 = 25000
&servo_high_v2 = 745
&servo_low_v2 = 835 // 15 and 25
}
C0 = L0 >= 25000
C1 = L0 <= 30000
IF C0 AND C1
{
&flaps_low_v2 = 25000
&flaps_high_v2 = 30000
&servo_high_v2 = 835
&servo_low_v2 = 932 // 25 and 30
}
C0 = L0 >= 30000
C1 = L0 <= 40000
IF C0 AND C1
{
&flaps_low_v2 = 30000
&flaps_high_v2 = 40000
&servo_high_v2 = 932
&servo_low_v2 = 1023 // 30 and 40
}
&servo_calc2 = &servo_low_v2 - &servo_high_v2
&flaps_calc2 = &flaps_high_v2 - &flaps_low_v2
&flaps_v2 = L0 - &flaps_low_v2
&servo_v2 = &servo_calc2 * &flaps_v2
&servo_v2 = &servo_v2 / &flaps_calc2
L1 = &servo_high_v2 + &servo_v2
&servo_flaps2 = L1
}

Var 0341, name servo_v2

Var 0342, name flaps_calc2

Var 0343, name servo_calc2

Var 0344, name flaps_v2

Var 0345, name flaps_low_v2

Var 0346, name flaps_high_v2

Var 0347, name servo_high_v2

Var 0348, name servo_low_v2
dornier
Posts: 30
Joined: Wed Dec 14, 2016 3:58 am

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by dornier »

Update:

I read through the Opencockpits PDF for the flap gauge and modified a new the script based on v4.4 to the following. At least the Flap indicator goes to UP when I start OC4BAv4, but there's no movement as the flaps extend or retract:


Var 0331, name servo_flaps, Link USB_SERVOS, Device 36, Output 1, PosL 222, PosC 515, PosR 808

Var 0428, name flaps, static, Value 0
{
L0 = &flaps
L2 = L0
C0 = L0 >= 0
C1 = L0 <= 1000
IF C0 AND C1
{
&flaps_low_val = 0
&flaps_high_val = 1000
&servo_high_val = 222
&servo_low_val = 320 // 0 and 1
}
C0 = L0 >= 1000
C1 = L0 <= 2000
IF C0 AND C1
{
&flaps_low_val = 1000
&flaps_high_val = 2000
&servo_high_val = 320
&servo_low_val = 404 // 1 and 2
}
C0 = L0 >= 2000
C1 = L0 <= 5000
IF C0 AND C1
{
&flaps_low_val = 2000
&flaps_high_val = 5000
&servo_high_val = 404
&servo_low_val = 481 // 2 and 5
}
C0 = L0 >= 5000
C1 = L0 <= 10000
IF C0 AND C1
{
&flaps_low_val = 5000
&flaps_high_val = 10000
&servo_high_val = 481
&servo_low_val = 558 // 5 and 10
}
C0 = L0 >= 10000
C1 = L0 <= 15000
IF C0 AND C1
{
&flaps_low_val = 10000
&flaps_high_val = 15000
&servo_high_val = 558
&servo_low_val = 620 // 10 and 15
}
C0 = L0 >= 15000
C1 = L0 <= 25000
IF C0 AND C1
{
&flaps_low_val = 15000
&flaps_high_val = 25000
&servo_high_val = 620
&servo_low_val = 685 // 15 and 25
}
C0 = L0 >= 25000
C1 = L0 <= 30000
IF C0 AND C1
{
&flaps_low_val = 25000
&flaps_high_val = 30000
&servo_high_val = 685
&servo_low_val = 743 // 25 and 30
}
C0 = L0 >= 30000
C1 = L0 <= 40000
IF C0 AND C1
{
&flaps_low_val = 30000
&flaps_high_val = 40000
&servo_high_val = 743
&servo_low_val = 808 // 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 0332, name servo_val

Var 0333, name flaps_calc

Var 0334, name servo_calc

Var 0335, name flaps_val

Var 0336, name flaps_low_val

Var 0337, name flaps_high_val

Var 0338, name servo_high_val

Var 0339, name servo_low_val

Var 0340, name servo_flaps2, Link USB_SERVOS, Device 36, Output 2, PosL 222, PosC 515, PosR 808

Var 0430, name flaps2, static, Value 0
{
L0 = &flaps2
L2 = L0
C0 = L0 >= 0
C1 = L0 <= 1000
IF C0 AND C1
{
&flaps_low_v2 = 0
&flaps_high_v2 = 1000
&servo_high_v2 = 222
&servo_low_v2 = 320 // 0 and 1
}
C0 = L0 >= 1000
C1 = L0 <= 2000
IF C0 AND C1
{
&flaps_low_v2 = 1000
&flaps_high_v2 = 2000
&servo_high_v2 = 320
&servo_low_v2 = 404 // 1 and 2
}
C0 = L0 >= 2000
C1 = L0 <= 5000
IF C0 AND C1
{
&flaps_low_v2 = 2000
&flaps_high_v2 = 5000
&servo_high_v2 = 404
&servo_low_v2 = 481 // 2 and 5
}
C0 = L0 >= 5000
C1 = L0 <= 10000
IF C0 AND C1
{
&flaps_low_v2 = 5000
&flaps_high_v2 = 10000
&servo_high_v2 = 481
&servo_low_v2 = 558 // 5 and 10
}
C0 = L0 >= 10000
C1 = L0 <= 15000
IF C0 AND C1
{
&flaps_low_v2 = 10000
&flaps_high_v2 = 15000
&servo_high_v2 = 558
&servo_low_v2 = 620 // 10 and 15
}
C0 = L0 >= 15000
C1 = L0 <= 25000
IF C0 AND C1
{
&flaps_low_v2 = 15000
&flaps_high_v2 = 25000
&servo_high_v2 = 620
&servo_low_v2 = 685 // 15 and 25
}
C0 = L0 >= 25000
C1 = L0 <= 30000
IF C0 AND C1
{
&flaps_low_v2 = 25000
&flaps_high_v2 = 30000
&servo_high_v2 = 685
&servo_low_v2 = 743 // 25 and 30
}
C0 = L0 >= 30000
C1 = L0 <= 40000
IF C0 AND C1
{
&flaps_low_v2 = 30000
&flaps_high_v2 = 40000
&servo_high_v2 = 743
&servo_low_v2 = 808 // 30 and 40
}
&servo_calc2 = &servo_low_v2 - &servo_high_v2
&flaps_calc2 = &flaps_high_v2 - &flaps_low_v2
&flaps_v2 = L0 - &flaps_low_v2
&servo_v2 = &servo_calc2 * &flaps_v2
&servo_v2 = &servo_v2 / &flaps_calc2
L1 = &servo_high_v2 + &servo_v2
&servo_flaps2 = L1
}

Var 0341, name servo_v2

Var 0342, name flaps_calc2

Var 0343, name servo_calc2

Var 0344, name flaps_v2

Var 0345, name flaps_low_v2

Var 0346, name flaps_high_v2

Var 0347, name servo_high_v2

Var 0348, name servo_low_v2

Here's the SIOC ini file.

[SIOC]
IOCP_port=8092
IOCP_timeout=4000
Minimized=Yes
toggle_delay=20
[IOCARDS MODULE]
IOCard_disable=No
IOCard_LPT=No
[FSUIPC MODULE]
FSUipcdisable=No
FSUipcRefresh=60
[IOCP CLIENTS MODULES]
IOCPini_delay= 3000
IOCPclient0_disable=yes
IOCPclient0_host=localhost
IOCPclient0_port=8099
IOCPclient1_disable=yes
IOCPclient1_host=localhost
IOCPclient1_port=8092
[SOUND MODULE]
Sound_disable=Yes
Volume=100
[*]
[PMDG B737]
CONFIG_FILE=OCP4NGX _v4.4 Flap Mod.ssi
MASTER=7,7,1,58
MASTER=11,11,1,68
MASTER=15,15,1,60
MASTER=13,13,1,47
USBServos=36,61
dornier
Posts: 30
Joined: Wed Dec 14, 2016 3:58 am

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by dornier »

How about these entries? Do I need to modify them? Thanks again!

Var 1328, name FlapPosL, static // Flaps needle left 0 to 40000
{
CALL &FlapsDisplayL
}

Var 0429, name FlapsDisplayL, Link SUBRUTINE
{
C0 = &AUDI3_POWER_ON = 0
C1 = &FlapPosL < 10
IF C0 OR C1
{
CALL &AllOffL
}
ELSE
{
IF &FlapPosL < 990
{
CALL &Trans1L
}
ELSE
{
IF &FlapPosL < 5010
{
CALL &Ext1L
}
ELSE
{
IF &FlapPosL < 9990
{
CALL &Trans2L
}
ELSE
{
CALL &Ext2L
}
}
}
}
}

Var 1329, name FlapPosR, static // Flaps needle right 0 to 40000
{
CALL &FlapsDisplayR
}

Var 0431, name FlapsDisplayR, Link SUBRUTINE
{
C0 = &OVH_AFT_POW_ON = 0
C1 = &FlapPosR < 10
IF C0 OR C1
{
CALL &AllOffR
}
ELSE
{
IF &FlapPosR < 990
{
CALL &Trans1R
}
ELSE
{
IF &FlapPosR < 5010
{
CALL &Ext1R
}
ELSE
{
IF &FlapPosR < 9990
{
CALL &Trans2R
}
ELSE
{
CALL &Ext2R
}
}
}
}
}

Var 0432, name AllOffL, Link SUBRUTINE
{
&LE1_transit = 0
&LE1_ext = 0
&LE1_full_ext = 0
&LE2_transit = 0
&LE2_ext = 0
&LE2_full_ext = 0
&LE3_transit = 0
&LE3_ext = 0
&LE3_full_ext = 0
&LE4_transit = 0
&LE4_ext = 0
&LE4_full_ext = 0
&FL1_transit = 0
&FL1_ext = 0
&FL2_transit = 0
&FL2_ext = 0
}

Var 0433, name AllOffR, Link SUBRUTINE
{
&FL3_transit = 0
&Fl3_ext = 0
&FL4_transit = 0
&FL4_ext = 0
&LE5_transit = 0
&LE5_ext = 0
&LE5_full_ext = 0
&LE6_transit = 0
&LE6_ext = 0
&LE6_full_ext = 0
&LE7_transit = 0
&LE7_ext = 0
&LE7_full_ext = 0
&LE8_transit = 0
&LE8_ext = 0
&LE8_full_ext = 0
}

Var 0434, name Trans1L, Link SUBRUTINE
{
&LE1_ext = 0
&LE2_ext = 0
&LE3_ext = 0
&LE4_ext = 0
&LE1_transit = 1
&LE2_transit = 1
&LE3_transit = 1
&LE4_transit = 1
&FL1_ext = 0
&FL2_ext = 0
&FL1_transit = 1
&FL2_transit = 1
}

Var 0435, name Trans1R, Link SUBRUTINE
{
&LE5_ext = 0
&LE6_ext = 0
&LE7_ext = 0
&LE8_ext = 0
&LE5_transit = 1
&LE6_transit = 1
&LE7_transit = 1
&LE8_transit = 1
&Fl3_ext = 0
&FL4_ext = 0
&FL3_transit = 1
&FL4_transit = 1
}

Var 0436, name Ext1L, Link SUBRUTINE
{
&LE1_transit = 0
&LE2_transit = 0
&LE3_transit = 0
&LE4_transit = 0
&LE1_ext = 1
&LE2_ext = 1
&LE3_ext = 1
&LE4_ext = 1
&FL1_transit = 0
&FL2_transit = 0
&FL1_ext = 1
&FL2_ext = 1
}

Var 0437, name Ext1R, Link SUBRUTINE
{
&LE5_transit = 0
&LE6_transit = 0
&LE7_transit = 0
&LE8_transit = 0
&LE5_ext = 1
&LE6_ext = 1
&LE7_ext = 1
&LE8_ext = 1
&FL3_transit = 0
&FL4_transit = 0
&Fl3_ext = 1
&FL4_ext = 1
}

Var 0438, name Trans2L, Link SUBRUTINE
{
&LE1_full_ext = 0
&LE2_full_ext = 0
&LE3_full_ext = 0
&LE4_full_ext = 0
&LE1_transit = 1
&LE2_transit = 1
&LE3_transit = 1
&LE4_transit = 1
&LE1_ext = 1
&LE2_ext = 1
&LE3_ext = 1
&LE4_ext = 1
&FL1_ext = 1
&FL2_ext = 1
}

Var 0439, name Trans2R, Link SUBRUTINE
{
&LE5_transit = 1
&LE6_transit = 1
&LE7_transit = 1
&LE8_transit = 1
&LE5_ext = 1
&LE6_ext = 1
&LE7_ext = 1
&LE8_ext = 1
&LE5_full_ext = 0
&LE6_full_ext = 0
&LE7_full_ext = 0
&LE8_full_ext = 0
&Fl3_ext = 1
&FL4_ext = 1
}

Var 0440, name Ext2L, Link SUBRUTINE
{
&LE1_transit = 0
&LE2_transit = 0
&LE3_transit = 0
&LE4_transit = 0
&LE1_ext = 0
&LE2_ext = 0
&LE3_ext = 0
&LE4_ext = 0
&LE1_full_ext = 1
&LE2_full_ext = 1
&LE3_full_ext = 1
&LE4_full_ext = 1
&FL1_ext = 1
&FL2_ext = 1
}

Var 0441, name Ext2R, Link SUBRUTINE
{
&LE5_transit = 0
&LE6_transit = 0
&LE7_transit = 0
&LE8_transit = 0
&LE5_ext = 0
&LE6_ext = 0
&LE7_ext = 0
&LE8_ext = 0
&LE5_full_ext = 1
&LE6_full_ext = 1
&LE7_full_ext = 1
&LE8_full_ext = 1
&Fl3_ext = 1
&FL4_ext = 1
}

Var 0442, name LE_FL_Test, Link IOCARD_SW, Device 33, Input 68 // Test button LE Devices
{
CALL &AllOffL
CALL &AllOffR
CALL &FlapsDisplayL
CALL &FlapsDisplayR
}
dornier
Posts: 30
Joined: Wed Dec 14, 2016 3:58 am

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by dornier »

Last update before I go to sleep, I tried an older 4.2 ssi file and it worked! I changed the values to match the various flap positions and it worked great. Is it possible that the OCP4NGX_v4.4.ssi is corrupted on my end?

Thanks,

George
mvr1918
Site Admin
Posts: 1703
Joined: Thu Aug 30, 2012 3:35 pm

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by mvr1918 »

It is a bug in the OCP4NGX_V4.4.ssi script that came with OC4BAv4 beta1.

A new updated OC4BAv4 beta2 download is sent to you for test.
dornier
Posts: 30
Joined: Wed Dec 14, 2016 3:58 am

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by dornier »

mvr1918 wrote:It is a bug in the OCP4NGX_V4.4.ssi script that came with OC4BAv4 beta1.

A new updated OC4BAv4 beta2 download is sent to you for test.
You're the best! I'm using a modified OCP4NGXv4.4.ssi file with the correct servo values for my hardware and it works great with the 737, thanks! Now I just need the MIP to get here already! Running out of space on the desk :D .

George
mvr1918
Site Admin
Posts: 1703
Joined: Thu Aug 30, 2012 3:35 pm

Re: Open Cockpits USB servo card and flap gauge setup, pleas

Post by mvr1918 »

Good. Marked as SOLVED.
Post Reply