Welcome to Cockpitbuilders.com. Please login or sign up.

April 28, 2024, 03:29:41 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
444 Guests, 0 Users
Members
  • Total Members: 4,154
  • Latest: xyligo
Stats
  • Total Posts: 59,641
  • Total Topics: 7,853
  • Online today: 454
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 444
Total: 444

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

Math Question

Started by 727737Nut, February 12, 2012, 05:35:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

727737Nut

I have a unique problem I need to solve via math.  As I turn a potentiometer it's output goes from 179 to 0, what I need is a math formula that changes that to a 181 to 360    Is that even possible??

Thanks
Rob
737 Junkie

blueskydriver

#1
Rob,

You would want to use either (Y=360 then X-Y=Z) or use (X=360 where X-Y=Z).

I don't know what programs you're using, but for the first way (Y=360 then X-Y=Z); whatever is reading the descending of 179 to 0 is the X value, and then it just needs to have the constant of -360 the Y value and that will give the value of Z 181 to 360 in an ascending order. However, you will have a negative value for Z.

The second way is to assign the constant of 360 to X then (X-Y=Z). Thus, your descending values of 179 to 0 would be Y and the Z will be the ascending values 181 to 360.



Example for the first way:
Y=360
X-Y=Z

179-360=-181
178-360=-182
177-360=-183
176-360=-184
on down to
0-360=-360

You would have to include a modifier to change the Z values back to positives.

Example for the second way:
X=360
X-Y=Z

360-179=181
360-178=182
360-177=183
360-176=184
on down to
360-0=360

X is the constant, Y is your descending 179 to 0 and Z will be the ascending 181 to 360. However, the Z values will equal a positive, so no additional modifier...

Please thank Simlady for the math; she is the Wiz Kid!

BSD
| FSX | FDS-MIP OVRHD SYS CARDS FC1| PM | PMDG 737-700 | UTX | GEX | UT7 | ASE | REX2 | AES | TSR | IS | TOPCAT | AvilaSoft EFB | OC CARDS & OVRHD GAUGES| SIMKITS | SW 3D Lights | FS2CREW2010 | FSXPassengers | Flight1 AE | MATROX TH2GO-D | NTHUSIM | 3-Mits EW230Ust Proj |

727737Nut

Thanks,  I figured it out just before bed last night.  Take the input x -1 then add 360  That is a programmable formula with no need for tables.  ;)

Rob
737 Junkie

blueskydriver

Hi Rob,

Sorry, I didn't mean tables. I didn't know what program you were using (by the way, what is the program?). So, I just used that to explain it. I assume your using something that reads the inputs like an IO card then an interface like fsuipc or SIOC to program or is it something else?

BSD
| FSX | FDS-MIP OVRHD SYS CARDS FC1| PM | PMDG 737-700 | UTX | GEX | UT7 | ASE | REX2 | AES | TSR | IS | TOPCAT | AvilaSoft EFB | OC CARDS & OVRHD GAUGES| SIMKITS | SW 3D Lights | FS2CREW2010 | FSXPassengers | Flight1 AE | MATROX TH2GO-D | NTHUSIM | 3-Mits EW230Ust Proj |

727737Nut

I am using SIOC and the analog inputs on a USB servo card.  The pot is in the OBS tuning dial on the localizer and glide slpoe indicator I have.  Thanks again for the input, to both of you. ;)

Rob
737 Junkie

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate