SIOC Script for Speed-Indicator CS 753 FS2004
Hi Folks, :lol:
i´m right new here and is the first topic. first of all, hello to everybody. so, i´m building a multiplex cockpit by original rebuild aircraft parts with belongings e.g. interfaces, servocards, usb-devices. now i trying to fix a speedindicator with Servocard from opencockpits (OC) with Servomotor and SIOC.
I´m using one Westwind Speedindicator 0-400 Kt./ KIAS.
THAT IS THE SCRIPT I´M USING:
var 0
{
&outIAS = 511
}
var 2 name IASin Link FSUIPC_INOUT, Offset $02BC, Length 4 // SPEED HLD
{
L0 = &IASin
L1 = L0 / 128
L2 = L1 * 2
&OutIAS = L1 + L2
}
Var 10 name outIAS Link USB_SERVOS, Output 1, PosL 0, PosC 511, PosR 800, Type 1 // Output Valve
------------------------------------------------------------------------------
The Problem is, if i set the thrust-levers to full forward, the servo turns at first to fast. But if i stop the simulation at 100Kt (753 Captain Sim). and adjust the Speed-(Servo)-Indicator to 100kt back; it works fine; increasing and decreasing speed ist perfect. After landing with RVR and brakes-action to full stop the Speed-(Servo) is turning backwards after reaching 0 Kt. - thats the problem after restart or for a second takeoff.
I fixed a little pin at 0 Kt.marker on dial for needle, but the servo is to strong and turns the cogwheel at axis. Without the pin the neddle stop at close to 300 Kt.
So Anybody now´s about the problem and how to fix that. :?: All devices i got aren´t helpful.
THANKS, regards :-D
Re: SIOC Script for Speed-Indicator CS 753 FS2004
What are your servo values when the gauge needle is at 0 knots, 200 knots and 400 knots?
We can then help with amending your code
David
Re: SIOC Script for Speed-Indicator CS 753 FS2004
Thanks for fast responding; perfect :D
so i tried since my tread here und finished right now. also i tried the values with the script below and it works better now. only in case of decrease speed the needle is a little bit slower (different like 08-10 kts to sim).
var 0
{
&outIAS = 562
}
var 2 name IASin Link FSUIPC_INOUT, Offset $02BC, Length 4 // SPEED HLD
{
L0 = &IASin
L1 = L0 / 41
L2 = L1 * 1.6
&OutIAS = L1 - 150
}
Var 10 name outIAS Link USB_SERVOS, Output 1, PosL 0, PosC 562, PosR 988, Type 1 // Output Valve
------------------------------------------------------------------------------
The script before i got from a other person. Never seen before...SIOC, first time.
That are the Values now (got it with SIOC-Text.exe)
0 = 0
100=127
160=344
200=496
250=658
300=790
400=988
------------------------------------------------------------------------------
Now i changed to this Script but not tested at present:
var 0
{
&outIAS = 496
}
var 2 name IASin Link FSUIPC_INOUT, Offset $02BC, Length 4 // SPEED HLD
{
L0 = &IASin
L1 = L0 / 41
L2 = L1 * 1.6
&OutIAS = L1 - 150
}
Var 10 name outIAS Link USB_SERVOS, Output 1, PosL 0, PosC 496, PosR 988, Type 1 // Output Valve
------------------------------------------------------------------------------
The most problem exist about different speeds. If the speed up is synchronal perfect the decrease of speed is mostly to low and also backwards/reversed.
So i´ll THANK YOU FOR YOUR HELP :-)
Re: SIOC Script for Speed-Indicator CS 753 FS2004
Firstly, change
var 0
{
&outIAS = 562
}
to
var 0
{
&outIAS = 0
}
This will set your needle to zero speed when the programme is first run
The values for the servo positions versus speed are not linear. Is this the case with your gauge dial, eg is the distance around the gauge from 0 to 100 much less than the distance from 100 to 200. The reason I ask is that it makes the programming more difficult :roll: This is perhaps why you are seeing a mismatch between the gauge and your real speed. There are also some changes needed to your coding, but first we need to establish whether your gauge face is linear or not
David
Re: SIOC Script for Speed-Indicator CS 753 FS2004
Tip:
Change
Code:
var 2 name IASin Link FSUIPC_INOUT, Offset $02BC, Length 4 // SPEED HLD
into
Code:
var 2 name IASin Link FSUIPC_IN, Offset $02BC, Length 4 // SPEED HLD
because you only read from that offset (not write to).
Nico
Re: SIOC Script for Speed-Indicator CS 753 FS2004
sounds perfect. so i gonna test that later on. :D and ´ll let you know
would it be helpful if i post a picture of the dial of the speed-indicator (where i should post it?), because it seems to be, that this one is not really linear (mentioned once before).
so if the speed-indicator is completed and tested ok, i´ll give everybody all the information about the constructions who want to know.
GREAT ! THANK YOU A LOT !!:cool:
Re: SIOC Script for Speed-Indicator CS 753 FS2004
so if i change to that:
to 0 in place of 562
Re: SIOC Script for Speed-Indicator CS 753 FS2004
Here you are. I suggest that you thoroughly read and understand this coding. I have used your servo values for the respective speeds and divided the dial scale into 4 sectors, each with its own scaling factor to allow for the linear progression. You can add additional sectors using this logic and by amending the code. It should work !!:)
Code:
var 2 name IASin Link FSUIPC_IN, Offset $02BC, Length 4 // SPEED
{
L0 = &IASin / 128
L0 = ABS L0
IF L0 < 0 // check for less than 0 to avoid overdriving the servo
{
L1 = 0 // minimum range of servo movement
}
ELSE
{
IF L0 < 127 // If speed is less than 127 then it is in the first
sector
{
L1 = L0 * 1.27
}
ELSE
{
IF L0 <= 200 // speed is in the second sector
{
L2 = L0 - 100
L1 = L2 * 3.69 // servo ramp. IAS from 100 to 200 knots moves
the servo 369 units
L1 = L1 + 127
}
ELSE
{
IF L0 <= 300 // speed is in the third sector
{
L2 = L0 - 200
L1 = L2 * 2.94 // servo ramp. IAS from 200 to 300 knots moves
the servo 294 units
L1 = L1 + 496
}
ELSE
{
IF L0 <= 400 // Speed is in 4th sector
{
L2 = L0 - 300
L1 = L2 * 1.98 // servo ramp. IAS from 300 to 400 knots
moves the servo 198 units
L1 = L1 + 790
}
ELSE
{
IF L0 > 400 // If speed greater than 400 then do not
overdrive the servo
{
L1 = 988 // maximum range of servo movement
}
}
}
}
}
}
&OutIAS = L1
}
Var 10 name outIAS Link USB_SERVOS, Output 1, PosL 0, PosC 496, PosR 988 //
Re: SIOC Script for Speed-Indicator CS 753 FS2004
Re: SIOC Script for Speed-Indicator CS 753 FS2004
Hi Max,
I also posted this on the MH forums for you, but I'll post here too.
it is very similar to Davids, just slightly different in layout. It was taken from my script for an EGT Gauge from a year ago; it works perfectly. I also think David has used the same steps (100 per).
Code:
Var 0002, name IAS_Servo, Link USB_SERVOS, Output 1, PosL 0, PosC 562, PosR 988, Type 2 // IAS Servo Instrument
Var 0001, name IAS, Link FSUIPC_IN, Offset $02BC, Length 4, // IAS from SIM
{
L0 = DIV &IAS 128 // FSUIPC Conversion Airspeed IAS
L0 = ABS L0 // L0 not signed
L2 = L0
IF L0 <= 100 // First sector
{
L1 = L2 * 1.27 // (127 steps/100 values) = 1.27
}
ELSE // Is a greater value
{
L2 = L0 - 100 // L2 only have values for next sector
IF L0 <= 200 // Second sector
{
L1 = L2 * 3.69 // (369 steps / 100 values) = 3.69
L1 = L1 + 127 // Add steps of others sectors (+127)
}
ELSE
{
L2 = L0 - 200 // L2 only have values for next sector
IF L0 <= 300 // 3. Sector
{
L1 = L2 * 2.94 // ( 294 / 100) = 2.94
L1 = L1 + 496 // Add steps of others sectors (127 + 369)
}
ELSE // Out of range
{
L2 = L0 - 300 // L2 only have values for next sector
IF L0 <= 400 // 4. sector
{
L1 = L2 * 1.980 // (198 steps / 100 values) = 1.980
L1 = L1 + 790 // Add steps of others sectors (127 + 369 + 294)
}
ELSE
{
L1 = 988 // Max. position of IAS Gauge
}
}
}
}
&IAS_Servo = 0 + L1 // Add to minimum (0)
}
Also, changing FSUIPC_INOUT to FSUIPC_IN won't change anything; it will just reduce cycle time (as you are just "looking at" the offset, not sending values to it).
Regards,
Jack