-
Interfacing a Basic ASI Gauge
Hello everyone,
I have managed to pick up today 7 real-world aircraft instruments for an outstanding price.
One of the items picked up was an altimeter. It is an altimeter ranging from 0-450, presumed ex-military.
Anyway, I was wondering how this could be interfaced. Maybe through using the USBServos Card from Opencockpits? I'm getting the hang of SIOC (having just sucessfully implemented the USBKeys Card) but am pretty much lost on how to get the "output information" from the SIm to reference in SIOC, and then from then on onto the actual servo motor.
Even then, how do I define how mcuh the motor turns? Obviously,different gauges have different scales, so how do I tell the USBServos Motor this?
Maybe someone how has interfaced something like an analogue ASI could give me some tips.
Thanks very much,
Jack:D
-
Re: Interfacing a Basic ASI Gauge
It is kind of a complicated process but once you get the hang of it, it is easy. First off you need to determine what drives the gauge. A dc motor with a pot as feedback, (easy to interface) Synchro resolver's and transmitters, or simple air pressure or differential air. If you have to add a servo to drive a gauge, they are limited to 180deg movement. So if you have a gauge that has more than that, which 99% do, you will need to add some kind of gearing. Again, easy once you get the hang of it. You could even drive an altimeter with a simple dc motor and 10turn pot. Using gearing and programming. Once you have the mechanical set-up done, you test it by using IOCP console and commanding the servo to position 1-1022 to determine the range that matches your gauge. Example, my VSI gauge -5000 = servo position 450 and +5000 = servo position 925 Once you know that, you apply a little math and a small program in sioc and it functions perfect! Here is an example of some of my gauge scripts,
Var 0001, name VSI, Link USB_SERVOS, Output 1, PosL 170, PosC 612, PosR 1023, Type 1 // vsiservo
Var 0002, name EngN1servo, Link USB_SERVOS, Output 2, PosL 345, PosC 647, PosR 950, Type 1 // N1 Servo
Var 0003, name egt1servo, Link USB_SERVOS, Output 3, PosL 1, PosC 550, PosR 1023, Type 1 // EGT Gauge
Var 0004, name eng3N2servo, Link USB_SERVOS, Output 4, PosL 345, PosC 647, PosR 950, Type 1
Var 0005, name Eng3N1servo, Link USB_SERVOS, Output 5, PosL 345, PosC 647, PosR 950, Type 1
Var 0006, name Eng2N2servo, Link USB_SERVOS, Output 6, PosL 345, PosC 647, PosR 950, Type 1
Var 0007, name eng3N2, Link FSUIPC_INOUT, Offset $09C6, Length 2 // N2 rpm for eng 3
{
L0 = &eng3N2 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&eng3N2servo = L2
}
Var 0011, name eng1N1, Link FSUIPC_IN, Offset $0898, Length 2
{
L0 = &eng1N1 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&EngN1servo = L2
CALL &ConfigWarn1
}
Var 0012, name Eng1Egt, Link FSUIPC_IN, Offset $08BE, Length 2 // Eng 1 EGT
{
L0 = &Eng1Egt * 0.05249023 // 16384=860C
L1 = L0 * 0.522727
L2 = L1 + 335
&egt1servo = L2
}
Var 0013, name relay1, Link USB_RELAYS, Output 1 // AP Power
Var 0014, name APMaster, Link FSUIPC_INOUT, Offset $0278, Length 2 // Status of AP master switch
{
IF &APMaster = 1
{
&relay1 = 1
}
ELSE
{
&relay1 = 0
}
}
Var 0015, name Eng1N2, Link FSUIPC_INOUT, Offset $0896, Length 2
{
L0 = &Eng1N2 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&Eng2N2servo = L2
}
Var 0016, name No2N1, Link FSUIPC_INOUT, Offset $0930, Length 2
{
L0 = &No2N1 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
}
Var 0017, name eng3N1, Link FSUIPC_INOUT, Offset $09C8, Length 2
{
L0 = &eng3N1 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&Eng3N1servo = L2
-
Re: Interfacing a Basic ASI Gauge
Okay that's fanastic. So for an ASI gauge that runs through about 500 degrees, I would use a pot with a mechenical mechanism? Would I use the USBServos to interface?
Thanks,
Jack
-
Re: Interfacing a Basic ASI Gauge
The gauge runs off differential air pressures. "Sucking" on the input increase the ASI, whilst "Blowing" on the input decreases the speed. Can this be interfaced?
-
Re: Interfacing a Basic ASI Gauge
Right, I'm a little bit confused here. The gauge works off air pressures, can this still be interfaced?
Also ,does anyone have a circuit diagram for something like an ASI that moves about 500 degrees?
Thanks,
Jack
-
Re: Interfacing a Basic ASI Gauge
Okay, I think I need to sort out the mechanical system first.
As I said, the gauge works off've ir pressures. If needs be, could I scrap this system and simply attacth a DC Motor with a Pot, and interface it that way?
Are there any circuit diagrams available for anything like this?
I think I can figure out the programming side of things later, I just need to know the actual mechanical connections between the USBServos Card and my Air-Pressured ASI Gauge, which moves through 500 degrees of movement.
Thanks alot,
Jack
-
Re: Interfacing a Basic ASI Gauge
Take out the air diaphram and associated parts. By using some gearing, you turn the shaft witha servoor a dc motor Servocity.com as all the stuff you need.
-
Re: Interfacing a Basic ASI Gauge
Hi there,
Yes I'm taking out the air diaphram, it is a very strange system which cannot be interfaced in any way. I will just connect the needle to a servo. Also, what's interesting is the fact that there is a "U/C" flap which pops up and down when connected to a 5V power supply.
Anyway, lets say I purchased the USBServos Card. What else will I need to purchase? What will I need to buy from Servocity.com? What else should I know?
Also, will connecting a Servo and DC Motor direct to the Card work? I thought you mentioned something about limited 180 degree movement, etc.
Thanks very much,
Jack =)
-
Re: Interfacing a Basic ASI Gauge
Okay, I think as I'm understanding this more and more I've boiled it down to some important questions...
- What EXACTLY do I connect to the USBServos Card, and, what attatched to what, etc?
- What motor/servo do I need to connect? There are thousands on Servocity, which one(s)?
Thanks,
Jack
-
Re: Interfacing a Basic ASI Gauge
Jack
You need a servo not a motor.
You will need a servo that can either fit in the housing or easily be mounted to it, probably something like a Hitec HS-55
Check the full scale deflection of the needle against the servo movement range, it is likely that you will need to use gearing
Read the OC USBservos card manual as to how to hook up the servo, do not just plug it in as it is very likely that you will need to change over the servo leads and if you do not do this then it will blow up
Preferably only try the servo out by using a sioc programme first, else be very careful that the servo does not move under power to the full extent of its range as it could easily stall and burn out if it is not getting a position signal
David
-
Re: Interfacing a Basic ASI Gauge
HI David,
You mention "using gearing"...
What does this mean exactly?
I understand how to use the IO Cards Servo testing software, this is no problem. It's more the mechanical side of things.
Also, the Hitec HS55 doesn't look lie it'll fit within my instrument. Is it possible to house the Servo BEHIND the instrument, and feed the needle movement with a small metal "Pole" attatched to the sevo?
Thanks, very much,
Jack =)
-
Re: Interfacing a Basic ASI Gauge
Jack
If your ASI needle needs to move through 360deg and the max typical range of the servo is 180deg then you need to install gears such that for each deg of servo movment then the ASI needle moves 2 deg - ie a ratio of 2 to 1 or to put it another way you need twice the number of gear teeth on the servo shaft as is on the needle shaft. Follow this link for a practical example
http://www.737ng.co.uk/djb/brake_pressure_gauge.pdf
David
-
Re: Interfacing a Basic ASI Gauge
I understand. If the Servo only moves 180 degrees,then you'll need to "multiply" its working efforts, by adding gears.
I think I understand the eletronic connections now. It is like this:
PC -> USBServos -> Servo (Hitec HS-55) -> Instrument
Is that correct?
Also, the testing software. On the interface, you can move the servo by either using the "sliding control" at the bottom, or using the manual entry of a number between 0-1024. I have a question about this... If I entered, say "5" into this box, would it move the servo to "position 5", or through a RANGE of 5 (eg 0-5)?
Thanks alot,
Jack
P.S: That gearing photo helped. Are there any methods to work out the number/size needed?
-
Re: Interfacing a Basic ASI Gauge
Jack
PC -> USBServos -> Servo (Hitec HS-55) -> Instrument - yes
If I entered, say "5" into this box, would it move the servo to "position 5", or through a RANGE of 5 (eg 0-5)?
It will move to position 5 within the range of 0 to 1024
Are there any methods to work out the number/size needed - Only simple maths as outlined above, however, if the ratio is 2.5 to 1 then go for 3 to 1 on the gearing to give you extra needle travel as servos can be a bit jittery at their extremes of travel. Having decided on the ratio then find matching gears. If 3 to 1 then the gears should have 30/10 or 36/12 teeth respectively
David
-
Re: Interfacing a Basic ASI Gauge
Right that's awesome.
Also, there are many different variants of the Hitec HS-55. Which one should I buy? There is a "mini" version, larger version... Etc.
-
Re: Interfacing a Basic ASI Gauge
Jack
Whichever you think appropriate :)
David
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
fordgt40
Jack
Whichever you think appropriate :)
David
Right okay, I'm just worried incase there are any mechanical/electronic differences I should look out for. Anything that won't be compatible I should be aware of?
Thanks,
Jack
-
Re: Interfacing a Basic ASI Gauge
Jack
Only size and extent of rotation are relevant for this purpose. As advised, I use the Hitec HS-55 which as far as I am aware only comes in one sub micro size, not "mini and larger" as you suggested earlier
David
-
Re: Interfacing a Basic ASI Gauge
Hiya,
If you type in Hitec HS-55 on Ebay you'll get loads of different Models called "HS-55"
Also, some versions say things like "0.18 / 0.14 sec @ 60deg"... Shouldn't that be 180 degrees?
-
Re: Interfacing a Basic ASI Gauge
Jack
Sorry, but I would not use Ebay as an authority:)
I buy my servos from a local hobbyshop - safer!
No idea about "0.18 / 0.14 sec @ 60deg"... , means nothing to me
David
-
Re: Interfacing a Basic ASI Gauge
Hiya David,
I ended up not getitng the HS-55, I spoke to a shop assistant and I told him the model name HS-55, and he gave me a different model but with very similar features.
Luckily, the one he gave me is much smaller than the HS-55, and easily fits within the ASI housing.
Next to master is the SIOC script. I will post a screenshot later today "labelling" what I think each section of the SIOC script means, then if I'm wrong could you steer me correct?
Thanks,
Jack
-
Re: Interfacing a Basic ASI Gauge
-
Re: Interfacing a Basic ASI Gauge
Hi Dave,
I've prepared this:
http://i822.photobucket.com/albums/z.../USBServos.jpg
Am I correct?
Also, 737NUT mentioned a Pot for feedback... Is this needed?
-
Re: Interfacing a Basic ASI Gauge
Jack
One comment - I think that the Type command should be Type 2 for a 1024 bit servo (could be wrong, but do not have the docs to hand)
The POSL POSC and POSR figures represent the servo values for the start, centre and finish of your needle movment. You can get these directly from the test programme. Alternatively, you can put in the default values of 0, 512, 1024 (provided the servo can move freely to these positions without stalling). In this latter case you would need to alter the programming to reflect that the start of the needle range is position say 300 instead of 0. Either way you will need to programme the movement to reflect the different scales eg ASI needle moves x amount against a servo range of y movement.
Also cannot guarantee which way the servo may move in relation to the input values - sometimes you have to change the code to cater for this
Edit - you do not need a pot as the servo has one internally
Good luck
David
-
Re: Interfacing a Basic ASI Gauge
A pot is only needed when using a DC motor and not a servo. :) Example, the VSI gauge i interfaced already had a DC motor and pot, i just wired them into a gutted servo and presto! A servo driven VSI guage that took less than hour to interface. Look for servo driven/electric only gauges.
-
Re: Interfacing a Basic ASI Gauge
Okay, and one final request...
Could anyone supply an example SIOC script for an ASI that I could modify for my needs?
Thanks alot,
Jack
-
Re: Interfacing a Basic ASI Gauge
Any ideas? Just an example ASi script that I could modify.
-
Re: Interfacing a Basic ASI Gauge
Jack
Perhaps there are none out there, so you will have to get your hands dirty. I suggest you just take a gauge example, perhaps 737nut`s ones above, change the offset reference to the air speed parameter you want in FSUIPC and adjust the coding to suit your specific needs.
David
-
Re: Interfacing a Basic ASI Gauge
Okay will do.
Just found out that the servo I purchased only moves 180 degrees. I take it this can still work if geared properly?
Var 0007, name ASI, Link USB_SERVOS, Output 1, PosL X, PosC X, PosR X, Type 2
^^^^^^^
Is the above script acceptable? Will I need to add anything? Also, Where I've put X... Does the number that goes here represent the minimum/maximum movements of the servo? If so, how will I find these?
-
Re: Interfacing a Basic ASI Gauge
Jack
Most servos only move 170-180 deg hence the need for gearing.
I answered your question about X earlier, you can find the start, middle and finish points by running the IOTEST programme that you have and taking note of the readings -though you need a completed gauge to do this.
Yes, you need much more coding, see 737nut`s examples above, as earlier suggested
David
-
Re: Interfacing a Basic ASI Gauge
Who is Jason?:p
Anyway, when you say run the IOTEST software, am I trying to find the mid/max/centre points of the GAUGE or the SERVO? Surely won't they just be the values of 0, 512, and 1024? Or is it different for each Servo? I know you have explained before but I'm a real novice on all this motorized know-how.
Also, I may have to contact Opencockpits regarding the script... Really not sure of what to do then. In 737NUT's examples the VSI line is only one line, and nothing else.
-
Re: Interfacing a Basic ASI Gauge
Jack/Jason
I edited out the mistake earlier, sorry for the mixup:)
Forget the left centre and right values for the time being, you have a bigger challenge ahead of you! The SIOC code to make the gauge work is not just the one line referencing the servo, it is a whole collection of commands to read the ASI values from a FSUIPC offset, convert the values into a suitable numeric and scale the result to suit the ratio of movement between the servo and gauge face, then make the servo move. The single line you quote only sets the parameters for the servo - nothing else. You need to understand how to code in SIOC and I suggest that you try this site http://www.lekseecon.nl/ as well as downloading and the SIOC manuals from the OC site.
Even if you were fortunate enough to find a script, you would still need to tailor it significantly to suit your needs, hence the need to fully understand how SIOC commands work. I will try to find and post a simple gauge script (not ASI) to give you a starting point
Good luck
David
-
Re: Interfacing a Basic ASI Gauge
Jack
Here is a very simple script
var 9004, name Servo4, Link USB_SERVOS, Output 4, PosL 1, PosC 511, PosR 1023, Type 2 // Servo Motor
Var 9005, name LeftDuctPress, Link FSUIPC_INOUT, Offset $5315, Length 2 // Duct Pressure * 10
{
L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364
}
This script defines the servo and the offset to get the gauge data
It then scales the data to suit the gauge range and then adds a value to position the needle at the beginning of the gauge
Please now follow my advice and links to understand how SIOC works before proceeding further
Regards
David
-
Re: Interfacing a Basic ASI Gauge
Hi David,
Yes I've trawled through Nicos site in the past and found it very informative, unfortunately no SIOC Servo examples (I already know how to program in SIOC for things like push-buttons)
I've taken a look at your SIOC example.
First question - Why are there two variables if it is for one continous gauge?
Secondly, What are the lines "L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364" For, are these the scaling lines which define the gauge?
Apart from that, I can understand the rest of it. I think it is just trying to physically find the scaling and writing it in SIOC.
-
Re: Interfacing a Basic ASI Gauge
Jack
Servo4 is the variable attached to the servo motor, so when that variable changes value the servo motor will move
Leftductpress is the variable collecting the actual value you need from flight sim
By way of further explanation
L0 = &LeftDuctPress / 1.5 is scaling the data to suit the needle range
&Servo4 = L0 + 364 - as the gauge needle travel does not match the servo, adding this number makes sure that when the data is zero, the needle is also at zero
David
-
Re: Interfacing a Basic ASI Gauge
Right then, this is starting to make sense.
As you said, could I use the SIOC example you posted and tailor it to my specifications?
Is there something such as a "SIOC dictionary" that I could look up certain terms such as "l0" and "Length2"?
When you say scaling the data to suit the needle range, is that the 1.5 value which suceeds the forward slash?
I definitely understand the + 364 part though, as you say this is to match both gauges to zero (this means that the "real" gauge is +364 from the zero positon).
Thanks,
Jack
Thanks,
Jack
-
Re: Interfacing a Basic ASI Gauge
Jack
yes
yes - download the sioc manuals from OC. By the way IO is actually ten in my example (the fsuipc offset provides the data times ten)
yes
yes
David
-
Re: Interfacing a Basic ASI Gauge
Okay, I will download the manuals.
Does 1.5 mean that the movement is 1.5 times the sim movement or soemthing?
-
Re: Interfacing a Basic ASI Gauge
Right. I am ready to modify the script into my needs, and I would appreciate if yo ucould evaluate it.
First of all, I need to know:
- How you get the "var" number
- How you get the "Length" number
- How to know what number to divide (in this case) LeftDuctPress by?
Thankfully though, I understand the following lines!
L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364
The top line is defining what "L0" is, in this case LeftDuctPress/1.5 - The bottom line is defining what the value of Servo4 is, which is the formula of the top line + 364, which matches the "real" servo position of "0".
Correct?:)
-
Re: Interfacing a Basic ASI Gauge
Jack
Sorry, but we cannot go fwd together on a "drip feed" basis. You need to demonstrate some effort into understanding SIOC - then I am happy to help. I am not an alternative to the manual. Trust that you will understand
David