PDA

View Full Version : Airspeed indicator interfaced with OC cards



edo17982
07-11-2010, 05:38 PM
Hello guys I post here a link to my youtube channel where I'm posting videos of gauges conversion as i complete them.
Any comment / question / suggestion will be appreciated.
Hope you'll enjoy!!

http://www.youtube.com/user/Edoradar


Edoardo

fordgt40
07-11-2010, 06:08 PM
Edoardo

Excellent work and very impressive, especially with DC motors rather than servos

Well done

David

737NUT
07-11-2010, 06:31 PM
Edoardo

Excellent work and very impressive, especially with DC motors rather than servos

Well done

David

He is using a dc motor with a feedback pot, same as a servo. ;) None the less, nice job

Anderson/SBSP
07-11-2010, 07:30 PM
Bravissimo!!!

edo17982
07-11-2010, 08:23 PM
He is using a dc motor with a feedback pot, same as a servo. ;) None the less, nice job
Yup you're right, the good is that I was able to use the existing DC motors inside replacing resolvers with pots with some mod to the housing.
The bad is that OC don't use a PIC with higher resolution a/d and that is a limitation to smoothness and a big limit in those devices that have lot of turns like altimeter...:( any idea on how to pass over that?

737NUT
07-11-2010, 09:25 PM
Use a multi-turn pot and gearing, one turn = 5K or 10K feet just a thought

edo17982
07-11-2010, 09:29 PM
Already thought abput that but the result wth 256 steps only (8 bits) is that on, let's say, 60K feet range each step would be 60000/256 = 234 ft which is not possible... a thought was to use 2 pots...one rotate each 2000 ft and one make a rotation within the full range which work as a sort of counter...I need to elaborate a sioc script for that but could be a solution. the only bad is that a continuous rotation pot has a dead angle of more or less 20....

737NUT
07-11-2010, 09:35 PM
Well most planes dont fly above 40K feet so that could help on the resolution. Also the servo is 10bit so that may help also.

edo17982
07-11-2010, 09:38 PM
Yup you're right.. i'll post it once I'll find the most suitable solution :)

fordgt40
07-12-2010, 04:49 AM
He is using a dc motor with a feedback pot, same as a servo. ;) None the less, nice job

From his Youtube text it was not apparent that he had actually cannabalised existing servos. Also, as you are aware the programming of "raw" dc motors with separate feedback is much more complicated in SIOC than using servos - hence my comment

David

edo17982
07-12-2010, 06:58 AM
Edoardo

Excellent work and very impressive, especially with DC motors rather than servos

Well done

David

Thanks for your comment!
The easy part is about the motor itself as the gauge is already featuring small DC motors.
The hard part is to disassemble part of it and replace the syncros with pots which are not easy to find as for dimensions and shape. I found them on RS but are like more than 30 each, luckily I got a lot over ebay for 60USD for 8 of them :)
The hard part of the code was about the barber pole as it is spring loaded to a position, so I needed to program the motor to stay in a given position applying the right force to it as a DC once reach a position is deactivaded and the spring woulded bring it back in a continuous loop.
Here is the code I made for AS indicator


Var 0000, Value 0
{
&ASControl = TIMER 999 ,0 ,2
&ASObj = 0
&ASMotor = 0
&SBControl = TIMER 999 ,0 ,2
&SBObj = 0
&SBMotor = 0
&BPControl = TIMER 999 ,0 ,2
&BPObj = 0
&BPMotor = 0
}

Var 0003, name ASMotor, static, Link USB_DCMOTOR, Device 2, Output 1 // motor control (0-127) 0=Left, +128 = Rig
Var 0006, name ASAd, static, Link USB_ANALOGIC, Device 2, Input 1, PosL 0, PosC 127, PosR 255 // Potentiometer value
Var 9001, name AirSpdOffst, Link FSUIPC_IN, Offset $02BC, Length 4
{
L0 = &AirSpdOffst / 128 // FSUIPC conversion, L0=AirSpd
&AirSpd = L0
L0 = ABS L0
L2 = L0
IF L0 <= 59 // First sector
{
L1 = 0 // pot 0
}
ELSE
{
L2 = L0 - 59
IF L0 <= 80 // Second sector
{
L1 = L2 / 1.25 // pot 17
L1 = L1 + 0
}
ELSE
{
L2 = L0 - 80
IF L0 <= 250 // Third Sector
{
L1 = L2 / 1.0119 // pot 185
L1 = L1 + 17
}
ELSE
{
L2 = L0 - 250
IF L0 <= 450 // Fourth Sector
{
L1 = L2 / 3.125 // pot 249
L1 = L1 + 185
}
ELSE // Out of range
{
IF L0 > 450 // Fourth Sector
{
L1 = 250
}
}
}
}
}
&ASObj = L1
}

Var 9002, name AirSpd

Var 9004, name ASControl, Link SUBRUTINE // Subrutine for Control (each 20ms)
{
L0 = &ASObj - &ASAd
L1 = 0
IF L0 < 0
{
L1 = 128
}
L0 = ABS L0
L2 = &ASVelMax + L1
IF L0 <= &ASAprox8
{
L2 = &ASVel8 + L1
}
IF L0 <= &ASAprox6
{
L2 = &ASVel6 + L1
}
IF L0 <= &ASAprox4
{
L2 = &ASVel4 + L1
}
IF L0 <= &ASAprox2
{
L2 = &ASVel2 + L1
}
IF L0 <= &ASAproxSlow
{
L2 = &ASVelMin + L1
}
IF L0 = &ASMargen
{
L2 = 0
}
&ASMotor = L2
}

Var 9006, name ASObj // objective position (fixed in the example)
Var 9007, name ASMargen, Value 0 // %error
Var 9008, name ASAprox8, Value 15
Var 9009, name ASAprox6, Value 12
Var 9010, name ASAprox4, Value 8
Var 9011, name ASAprox2, Value 4
Var 9012, name ASAproxSlow, Value 1
Var 9013, name ASVelMax, Value 24 // Speed for follow objective
Var 9014, name ASVel8, Value 20 // Speed for proximity obj
Var 9015, name ASVel6, Value 16
Var 9016, name ASVel4, Value 12
Var 9017, name ASVel2, Value 8
Var 9018, name ASVelMin, Value 4 // Speed approaching target


Var 0004, name SBMotor, static, Link USB_DCMOTOR, Device 2, Output 2 // motor control (0-127) 0=Left, +128 = Rig
Var 0007, name SBAd, static, Link USB_ANALOGIC, Device 2, Input 2, PosL 0, PosC 127, PosR 255 // Potentiometer value
Var 9101, name SpdBugOffst, Link FSUIPC_IN, Offset $07E2, Length 2
{
L0 = &SpdBugOffst / 128 // FSUIPC conversion, L0=SpdBug
&SpdBug = L0
L0 = ABS L0
L2 = L0
IF L0 <= 100 // First sector
{
L1 = 36 // pot 36
}
ELSE
{
L2 = L0 - 100
IF L0 <= 250 // Second sector
{
L1 = L2 / 1.0274 // pot 182
L1 = L1 + 36
}
ELSE
{
L2 = L0 - 250
IF L0 <= 450 // Third Sector
{
L1 = L2 / 3.125 // pot 246
L1 = L1 + 182
}
ELSE // Out of range
{
IF L0 > 450 // Third Sector
{
L1 = 250
}
}
}
}
&SBObj = L1
}

Var 9104, name SBControl, Link SUBRUTINE // Subrutine for Control (each 20ms)
{
L0 = &SBObj - &SBAd
L1 = 0
IF L0 < 0
{
L1 = 128
}
L0 = ABS L0
L2 = &SBVelMax + L1
IF L0 <= &SBAprox8
{
L2 = &SBVel8 + L1
}
IF L0 <= &SBAprox6
{
L2 = &SBVel6 + L1
}
IF L0 <= &SBAprox4
{
L2 = &SBVel4 + L1
}
IF L0 <= &SBAprox2
{
L2 = &SBVel2 + L1
}
IF L0 <= &SBAproxSlow
{
L2 = &SBVelMin + L1
}
IF L0 = &SBMargen
{
L2 = 0
}
&SBMotor = L2
}
Var 9102, name SpdBug
Var 9106, name SBObj // objective position
Var 9107, name SBMargen, Value 0 // %error
Var 9108, name SBAprox8, Value 6
Var 9109, name SBAprox6, Value 4
Var 9110, name SBAprox4, Value 3
Var 9111, name SBAprox2, Value 2
Var 9112, name SBAproxSlow, Value 1
Var 9113, name SBVelMax, Value 60 // Speed for follow objective
Var 9114, name SBVel8, Value 40 // Speed for proximity obj
Var 9115, name SBVel6, Value 20
Var 9116, name SBVel4, Value 15
Var 9117, name SBVel2, Value 10
Var 9118, name SBVelMin, Value 13 // Speed approaching target


Var 0005, name BPMotor, static, Link USB_DCMOTOR, Device 2, Output 3 // motor control (0-127) 0=Left, +128 = Rig
Var 0008, name BPAd, static, Link USB_ANALOGIC, Device 2, Input 3, PosL 0, PosC 127, PosR 255 // Potentiometer value
Var 9201, name BarPolOffst, Link FSUIPC_IN, Offset $02BC, Length 4
{
L0 = &BarPolOffst // FSUIPC conversion, L0=BarPol
&BarPol = L0
L0 = ABS L0
L2 = L0
IF L0 <= 255 // First sector
{
L1 = 147
}
ELSE
{
L2 = L0 - 255
IF L0 <= 387 // Second sector
{
L1 = L2 / 3.1667 // pot 189
L1 = L1 + 147
}
ELSE // Out of range
{
IF L0 > 388 // Fourth Sector
{
L1 = 147
}
}
}
&BPObj = L1
}

Var 9202, name BarPol
Var 9204, name BPControl, Link SUBRUTINE // Subrutine for Control (each 20ms)
{
L0 = &BPObj - &BPAd
L1 = 0
IF L0 < 0
{
L1 = -25
L0 = &BPObj - &BPAd
L0 = ABS L0
IF L0 = 3
{
L1 = -20
}
ELSE
{
IF L0 = 2
{
L1 = -15
}
ELSE
{
IF L0 = 1
{
L1 = -10
}
}
}
}
L0 = ABS L1
IF &BPObj <= 147 // 255Kts
{
&BPVelMax = 20
&BPVelMin = 0
}
ELSE
{
IF &BPObj <= 152 // 270Kts
{
&BPVelMax = 58 + L1
&BPVelMin = 55 + L1
}
ELSE
{
IF &BPObj <= 155 // 280Kts
{
&BPVelMax = 60 + L1
&BPVelMin = 60 + L1
}
ELSE
{
IF &BPObj <= 158 // 290Kts
{
&BPVelMax = 62 + L1
&BPVelMin = 60 + L1
}
ELSE
{
IF &BPObj <= 161 // 300Kts
{
&BPVelMax = 64 + L1
&BPVelMin = 63 + L1
}
ELSE
{
IF &BPObj <= 164 // 310Kts
{
&BPVelMax = 66 + L1
&BPVelMin = 65 + L1
}
ELSE
{
IF &BPObj <= 167 // 320Kts
{
&BPVelMax = 68 + L1
&BPVelMin = 67 + L1
}
ELSE
{
IF &BPObj <= 170 // 330Kts
{
&BPVelMax = 70 + L1
&BPVelMin = 69 + L1
}
ELSE
{
IF &BPObj <= 173 // 340Kts
{
&BPVelMax = 72 + L1
&BPVelMin = 71 + L1
}
ELSE
{
IF &BPObj <= 176 // 350Kts
{
&BPVelMax = 74 + L1
&BPVelMin = 73 + L1
}
ELSE
{
IF &BPObj <= 179 // 360Kts
{
&BPVelMax = 76 + L1
&BPVelMin = 75 + L1
}
ELSE
{
IF &BPObj <= 183 // 370Kts
{
&BPVelMax = 80 + L1
&BPVelMin = 79 + L1
}
}
}
}
}
}
}
}
}
}
}
}
IF L0 <= &BPAprox
{
L2 = &BPVelMin
}
ELSE
{
L2 = &BPVelMax
}
IF L0 = &BPMargen
{
L2 = &BPVelMin
}
&BPMotor = L2
}

Var 9206, name BPObj // objective position
Var 9207, name BPMargen, Value 1 // %error
Var 9212, name BPAprox, Value 2 // Proximity Value
Var 9213, name BPVelMax, Value 0 // Speed for follow objective
Var 9218, name BPVelMin, Value 0 // Speed approaching target


Var 9301, name MachOffst, Link FSUIPC_IN, Offset $11C6, Length 2
{
L0 = &MachOffst / 20480 // FSUIPC conversion, L0=Mach Number
&D_MACH_U = MOD L0 ,10 // Mach Units Number
L0 = DIV L0 ,10
&D_MACH_T = MOD L0 ,10 // Mach Tenth Number
L0 = DIV L0 ,10
&D_MACH_H = MOD L0 ,10 // Mach Hundreds Number
}

Var 9302, name D_MACH_H
{
IF &D_MACH_H = 0
{
&Mach_H_0 = 1
&Mach_H_0 = DELAY 0 100
}
ELSE
{
&Mach_H_0 = 0
}
IF &D_MACH_H = 1
{
&Mach_H_1 = 1
&Mach_H_1 = DELAY 0 100
}
ELSE
{
&Mach_H_1 = 0
}
IF &D_MACH_H = 2
{
&Mach_H_2 = 1
&Mach_H_2 = DELAY 0 100
}
ELSE
{
&Mach_H_2 = 0
}
IF &D_MACH_H = 3
{
&Mach_H_3 = 1
&Mach_H_3 = DELAY 0 100
}
ELSE
{
&Mach_H_3 = 0
}
IF &D_MACH_H = 4
{
&Mach_H_4 = 1
&Mach_H_4 = DELAY 0 100
}
ELSE
{
&Mach_H_4 = 0
}
IF &D_MACH_H = 5
{
&Mach_H_5 = 1
&Mach_H_5 = DELAY 0 100
}
ELSE
{
&Mach_H_5 = 0
}
IF &D_MACH_H = 6
{
&Mach_H_6 = 1
&Mach_H_6 = DELAY 0 100
}
ELSE
{
&Mach_H_7 = 0
}
IF &D_MACH_H = 7
{
&Mach_H_7 = 1
&Mach_H_7 = DELAY 0 100
}
ELSE
{
&Mach_H_7 = 0
}
IF &D_MACH_H = 8
{
&Mach_H_8 = 1
&Mach_H_8 = DELAY 0 100
}
ELSE
{
&Mach_H_8 = 0
}
IF &D_MACH_H = 9
{
&Mach_H_9 = 1
&Mach_H_9 = DELAY 0 100
}
ELSE
{
&Mach_H_9 = 0
}
}

Var 9303, name D_MACH_T
{
IF &D_MACH_T = 0
{
&Mach_T_0 = 1
&Mach_T_0 = DELAY 0 100
}
ELSE
{
&Mach_T_0 = 0
}
IF &D_MACH_T = 1
{
&Mach_T_1 = 1
&Mach_T_1 = DELAY 0 100
}
ELSE
{
&Mach_T_1 = 0
}
IF &D_MACH_T = 2
{
&Mach_T_2 = 1
&Mach_T_2 = DELAY 0 100
}
ELSE
{
&Mach_T_2 = 0
}
IF &D_MACH_T = 3
{
&Mach_T_3 = 1
&Mach_T_3 = DELAY 0 100
}
ELSE
{
&Mach_T_3 = 0
}
IF &D_MACH_T = 4
{
&Mach_T_4 = 1
&Mach_T_4 = DELAY 0 100
}
ELSE
{
&Mach_T_4 = 0
}
IF &D_MACH_T = 5
{
&Mach_T_5 = 1
&Mach_T_5 = DELAY 0 100
}
ELSE
{
&Mach_T_5 = 0
}
IF &D_MACH_T = 6
{
&Mach_T_6 = 1
&Mach_T_6 = DELAY 0 100
}
ELSE
{
&Mach_T_6 = 0
}
IF &D_MACH_T = 7
{
&Mach_T_7 = 1
&Mach_T_7 = DELAY 0 100
}
ELSE
{
&Mach_T_7 = 0
}
IF &D_MACH_T = 8
{
&Mach_T_8 = 1
&Mach_T_8 = DELAY 0 100
}
ELSE
{
&Mach_T_8 = 0
}
IF &D_MACH_T = 9
{
&Mach_T_9 = 1
&Mach_T_9 = DELAY 0 100
}
ELSE
{
&Mach_T_9 = 0
}
}


Var 9304, name D_MACH_U
{
IF &D_MACH_U = 0
{
&Mach_U_0 = 1
&Mach_U_0 = DELAY 0 300
}
ELSE
{
&Mach_U_0 = 0
}
IF &D_MACH_U = 2
{
&Mach_U_2 = 1
&Mach_U_2 = DELAY 0 300
}
ELSE
{
&Mach_U_2 = 0
}
IF &D_MACH_U = 4
{
&Mach_U_4 = 1
&Mach_U_4 = DELAY 0 300
}
ELSE
{
&Mach_U_4 = 0
}
IF &D_MACH_U = 6
{
&Mach_U_6 = 1
&Mach_U_6 = DELAY 0 300
}
ELSE
{
&Mach_U_6 = 0
}
IF &D_MACH_U = 8
{
&Mach_U_8 = 1
&Mach_U_8 = DELAY 0 300
}
ELSE
{
&Mach_U_8 = 0
}
}


Var 9400, name Mach_H_0, Link IOCARD_OUT, Output 0
Var 9401, name Mach_H_1, Link IOCARD_OUT, Output 1
Var 9402, name Mach_H_2, Link IOCARD_OUT, Output 2
Var 9403, name Mach_H_3, Link IOCARD_OUT, Output 3
Var 9404, name Mach_H_4, Link IOCARD_OUT, Output 4
Var 9405, name Mach_H_5, Link IOCARD_OUT, Output 5
Var 9406, name Mach_H_6, Link IOCARD_OUT, Output 6
Var 9407, name Mach_H_7, Link IOCARD_OUT, Output 7
Var 9408, name Mach_H_8, Link IOCARD_OUT, Output 8
Var 9409, name Mach_H_9, Link IOCARD_OUT, Output 9

Var 9410, name Mach_T_0, Link IOCARD_OUT, Output 10
Var 9411, name Mach_T_1, Link IOCARD_OUT, Output 11
Var 9412, name Mach_T_2, Link IOCARD_OUT, Output 12
Var 9413, name Mach_T_3, Link IOCARD_OUT, Output 13
Var 9414, name Mach_T_4, Link IOCARD_OUT, Output 14
Var 9415, name Mach_T_5, Link IOCARD_OUT, Output 15
Var 9416, name Mach_T_6, Link IOCARD_OUT, Output 16
Var 9417, name Mach_T_7, Link IOCARD_OUT, Output 17
Var 9418, name Mach_T_8, Link IOCARD_OUT, Output 18
Var 9419, name Mach_T_9, Link IOCARD_OUT, Output 19

Var 9420, name Mach_U_0, Link IOCARD_OUT, Output 20
Var 9422, name Mach_U_2, Link IOCARD_OUT, Output 21
Var 9424, name Mach_U_4, Link IOCARD_OUT, Output 22
Var 9426, name Mach_U_6, Link IOCARD_OUT, Output 23
Var 9428, name Mach_U_8, Link IOCARD_OUT, Output 24

As you can see it is a long one :P

Thanks

Edoardo

fordgt40
07-12-2010, 07:10 AM
Edoardo

An interesting bit of coding. Thank you for that and I may use some of it when motorising my throttles:)

Again well done and thanks for sharing

David

crashdog
08-06-2010, 03:10 PM
Hi,
I just received the same DC-10 AIS today. The interessting thing is that mine allready has build in potentiometers. I will get 2 more in the next days. Will be interesstng to see if they also have pottys or resolvers. I was actually wondering what resolvers are ? some sort of potentiometer ? or like a motor ?
I also got a sperry altimeter yesteray which has resolvers instead of pottys. So I will have to excange them there. Will try edo's OC code as soon as I got the hardware part done and I received the OC DC cards (still waiting for them to arrive).
Here's some pictures of the Instruments:
http://www.md80.ch/images/myimgs/DSC00304s.jpg
http://www.md80.ch/images/myimgs/DSC00301s.jpg
the altimeter from above
http://www.md80.ch/images/myimgs/DSC00296s.jpg

oh, and I was wondering if edo knows how the mach digits are moved. Looks like their tiny stepper motors ? From the OC code it looks like you use digital outputs for the mach digits ?
Does your allready work and if so can you post a video ?
Cheers,

Gery

edo17982
08-06-2010, 04:10 PM
Hi,
I just received the same DC-10 AIS today. The interessting thing is that mine allready has build in potentiometers. I will get 2 more in the next days. Will be interesstng to see if they also have pottys or resolvers. I was actually wondering what resolvers are ? some sort of potentiometer ? or like a motor ?
I also got a sperry altimeter yesteray which has resolvers instead of pottys. So I will have to excange them there. Will try edo's OC code as soon as I got the hardware part done and I received the OC DC cards (still waiting for them to arrive).


Hi Gary, Yes it has built in pots, 12.5K and it seemed simple to me as well at 1st impact...BUT
Those pots are not linear pots and the work more or less in this way:
for about 160 degrees of range the value increase more or leass linearly, then the value decreases for about 100 degrees to raise up again till 0 degrees.
That's the reason for which u HAVE to replace those pots...u can easily verify that with a multimeter. Sorry for this bad notice but It will let u lose less time to interface it. 2 are easy to replace, but to replace the one of the speed bug you'll have to remove the glass support, the needles, the faceplate and mach numbers, I can give u help with that if you need.


oh, and I was wondering if edo knows how the mach digits are moved. Looks like their tiny stepper motors ? From the OC code it looks like you use digital outputs for the mach digits ?
Does your allready work and if so can you post a video ?
Cheers,

I made a test last night and it works like a wet dream :D will post a video in next 2 days, just stay subscribed to my channel to get the update.
They are not stepper, it is a rotating device with 10 mini electromagnets (one for each digit) that are excited by 12V tension. you simply connect each wire to an output using an USB output card and the game is done...I made small changes to the code posted, I'll update it tomorrow. FYI you can keep the connector of the device and simply make longer wires to the other connector side

crashdog
08-06-2010, 04:18 PM
Thank you Edoardo for all the info. Extreamly helpfull ! :D
I have subscribed to your youtube channel and will keep looking there.
Will keep you posted on any progress or questions.

Cheers,

Gery

crashdog
08-06-2010, 04:24 PM
and about the potty 256 bit there might be this solution.
The BU0836X card has a 4096 bit resolution. /http://www.leobodnar.com/products/BU0836X/ with the full version of fsuipc you can read some axis in the axis assignment tab and forward it to an fsuipc offset. That offset can be read by sioc. The numbers of axis are a bit limited. But for 2 altimeters it should work and maybe there are some more extensibility. Asking in Pete dowsons forum often helps.

Cheers,
Gery

edo17982
08-07-2010, 01:08 AM
and about the potty 256 bit there might be this solution.
The BU0836X card has a 4096 bit resolution. /http://www.leobodnar.com/products/BU0836X/ with the full version of fsuipc you can read some axis in the axis assignment tab and forward it to an fsuipc offset. That offset can be read by sioc. The numbers of axis are a bit limited. But for 2 altimeters it should work and maybe there are some more extensibility. Asking in Pete dowsons forum often helps.

Cheers,
Gery

I have 2 of those interfaces for flight controls actually and I didn't know about that function in FSUIPC...
The problem anyway is that SIOC won't be able to manage a motor control with more than 256 steps, there is not a function to support it...if you try to assign a max value greater than 255 in the motor control value, sioc won't go on with compiling... :(
Anyway I thought a good solution I think...If you see the altimeter there is one resolver which completes 1 turn each 2000 ft or 5000 ft depending on models, and another which makes more or less 180 degrees within the full range...my idea is to use the first for precision altitude indication and the second one as a sort of counter to let sioc understand in which altitude range is so the indication is always correct...will keep u updated with as I find the code for :)

crashdog
08-07-2010, 06:43 AM
Those pots are not linear pots
I could take the pots apart without destroying them. Do you know if they can be modifyed to be linear ? or mabe noth woth the effort ? which pots do you use Edoardo ?

Gery

edo17982
08-07-2010, 04:52 PM
I posted the new VIDEO (http://www.youtube.com/watch?v=Bpl5YpsAqAc)in my channel you can watch it.
About pots...I got a lot of 8 pots out of ebay, you should finde pots with servo flange and 3mm shaft diameter or u have to sort something out :)
Those pots can't be modified, baybe you can somehow keep its housing to fit another pot but can't say that...

crashdog
08-08-2010, 11:01 AM
Just found a fully compatible potentiometer... or at least looks like it. 3.1 mm shaft, linear, same housing as the original and a really proud price...(almost CHF 85 ) but I will consider to take these as I don't need to mod the metal plates in the AIS. It should work right away.
https://www.distrelec.ch/ishopWebFront/catalog/product.do/para/artView/is/true/and/node/is/DC-20275/and/productNr/is/741511/and/id/is/01/and/series/is/1.html

Gery

ps. sorry I was wrong the housing looks similar but he diamter of the housing is only 22mm where the original is 26mm.... so won't work I guess.

edo17982
08-09-2010, 06:57 AM
yeah I know, all the pots u finf out are 22 mm wide...and same is for those I use. so 22 mm with really little mod will work :) Maybe u can find them bit cheaper, around 30 on RS

crashdog
08-10-2010, 01:43 PM
just found this page today... lot's of pictures of electromechanical instruments. Had not seen the page before.
http://l1011project.blogspot.com/2010/01/avionics-bending-airspeedmach-indicator.html

edo17982
08-10-2010, 05:57 PM
Wow, really great find!!! I already found 2 VSI indicators, the same he's using and took them as they have the DC motor inside and will be easy to make working...I can tell u where to get it if u need

crashdog
08-11-2010, 05:14 PM
Just got my DC card today and try to understand the basics of siocing it...
I made a fsuipc var to read vertical speed. My target is a t the moment just to get the needle of my alt to move right when climb and left when descend.
from the example codes it seames that one must have a timer... never use those but... well at the moment it seames to move pritty much like it wants here's the code i use:


Var 1000, Value 0
{
&dc_mo_in1 = TIMER 999,0,2
}

Var 0200, name dc_test1, Link USB_DCMOTOR, Device 4, Output 1 // dc motor1

Var 0210, name dc_mo_in1, Link FSUIPC_IN, Offset $02C8, Length 4 // dc mo in 1
{
L0 = &dc_mo_in1 * 60
L0 = L0 * 3.28084
L0 = L0 / 256
L0 = L0 / 10
IF L0 > 128
{
L0 = 128
}
IF L0 < -128
{
L0 = -128
}
&dc_test1 = L0
}


what am I undersanding wrong here ? the needle just turns and turns in one direction. Randomy or maybe the first impulse it get's at start off sioc ?

Gery

edo17982
08-12-2010, 09:52 AM
Just got my DC card today and try to understand the basics of siocing it...
I made a fsuipc var to read vertical speed. My target is a t the moment just to get the needle of my alt to move right when climb and left when descend.
from the example codes it seames that one must have a timer... never use those but... well at the moment it seames to move pritty much like it wants here's the code i use:

what am I undersanding wrong here ? the needle just turns and turns in one direction. Randomy or maybe the first impulse it get's at start off sioc ?

Gery

Hi Gery!
What I can suggest (I'm not a SIOC guru but I found a way to have my gauges workin) is 1st to divide variables for FSUIPC conversion and Motor control as I did.
In the FSUIPC conversion you will put the converion itself as you did and the various ranges of the VSI scale according to the pot positioning.
In the control variable you will define how the motor will act according to the pot position and the objective position it has to reach.
In your code I see that you forgot to insert the variable for the pot used for the positioning...remember also to correctly configure your IOCDCMOTOR.INI file to get everything workin properly.


Var 0000, Value 0
{
&VSControl = TIMER 999, 0, 2
&VSMotor = 0
&VSObj = 127
}

Var 0001, name VSMotor, static, Link USB_DCMOTOR, Device 2, Output 1 // motor control (0-127) 0=Left, +128 = Right
Var 0006, name VSAd, Link USB_ANALOGIC, Device 2, Input 1, PosL 0, PosC 127, PosR 255 Static // Potentiometer value
Var 9001, name VSOffst, link FSUIPC_IN, offset $02C8, Length 4
{
L0 = &VSOffst * 60 // FSUIPC conversion, L0=VS
L0 = L0 * 3.28084 // FSUIPC conversion, L0=VS
L0 = L0 / 256 // FSUIPC conversion, L0=VS
L0 = ROUND L0 // Let's round the decimal value
&VS = L0
L2 = L0 // Since now we'll calculate all the ranges of the scale
IF L0 <= -6000 // First sector, value greater than - 6000 ft/min
{
L1 = 0 // Pot 0: here you will type the value according to the pot position when needle is on the "6" in negative range
}
ELSE
{
L2 = L0 + 6000
IF L0 <= -2000 // Second sector, value between -6000 and -2000
{
L1 = L2 / 80 // pot 50
L1 = L1 + 0
L1 = ABS L1
}
ELSE
{
L2 = L0 + 2000
IF L0 <= -1000 // Third sector, value between -2000 and -1000
{
L1 = L2 / 50 // pot 70
L1 = L1 + 50
L1 = ABS L1
}
ELSE
{
L2 = L0 + 1000
IF L0 < 0 // Fourth sector. value between -1000 and 0
{
L1 = L2 / 17.85714 // pot 126
L1 = L1 + 70
L1 = ABS L1
}
ELSE
{
L2 = L0
IF L0 = 0 // Fifth sector, Value 0
{
L1 = 127
}
ELSE
{
L2 = L0
IF L0 <= 1000 // Sixth sector, value between 0 and 1000
{
L1 = L2 / 17.85714 // pot 184
L1 = L1 + 127
}
ELSE
{
L2 = L0 - 1000
IF L0 <= 2000 // Seventh sector, value between 1000 and 2000
{
L1 = L2 / 50 // pot 204
L1 = L1 + 183
}
ELSE
{
L2 = L0 - 2000
IF L0 <= 6000 // Sixth sector, value between 2000 and 6000
{
L1 = L2 / 80 // pot 254
L1 = L1 + 203
}
ELSE // Out of range
{
IF L0 > 6000 // Last sector, value greater than +6000 ft/min
{
L1 = 255 // Pot 255: here you will type the value according to the pot position when needle is on the "6" in positive range
}
}
}
}
}
}
}
}
}
&VSObj = L1
}
Var 9002, name VS
Var 9004, name VSControl, Link Subrutine // Subrutine for Control (each 20ms)
{
L0 = &VSobj - &VSAd
L1 = 0
IF L0 < 0
{
L1 = 128
}
L0 = ABS L0
L2 = &VSVelMax + L1
IF L0 <= &VSAprox8
{
L2 = &VSVel8 + L1
}
IF L0 <= &VSAprox6
{
L2 = &VSVel6 + L1
}
IF L0 <= &VSAprox4
{
L2 = &VSVel4 + L1
}
IF L0 <= &VSAprox2
{
L2 = &VSVel2 + L1
}
IF L0 <= &VSAproxSlow
{
L2 = &VSVelMin + L1
}
IF L0 = &VSMargen
{
L2 = 0
}
&VSMotor = L2
}

Var 9006, name VSObj // objective position
Var 9007, name VSMargen, Value 0 // %error
Var 9008, name VSAprox8, Value 6
Var 9009, name VSAprox6, Value 4
Var 9010, name VSAprox4, Value 3
Var 9011, name VSAprox2, Value 2
Var 9012, name VSAproxSlow, Value 1 // Value approaching target
Var 9013, name VSVelMax, Value 60 // Max Speed for follow objective
Var 9014, name VSVel8, Value 40
Var 9015, name VSVel6, Value 34
Var 9016, name VSVel4, Value 28
Var 9017, name VSVel2, Value 22
Var 9018, name VSVelMin, Value 13 // Speed approaching target

crashdog
08-12-2010, 03:00 PM
the problem seames to be the dc motor card or at least the output on the card I used. I have a second card and connected the altimeter there and it works correct now. That's why I always order more than one OC card ;) For the moment I don't have the potentiometer and I wanted to see how the motor must be programmed. Will had the potty as soon as I have it. What did you mean with "RS" is that servo city or some other store ?

edo17982
08-12-2010, 03:16 PM
RS is RS component store. Try another input to see if it works correctly and post also the IOCDCmotor ini file as well as sioc.ini to see if it is correct along with your code.
PS in prev post I posted the just compiled VSI code for you