Results 21 to 30 of 65
-
04-17-2011, 02:38 PM #21
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Jack,
maybe a more specific question would be good. I don't think someone will write the code for you
If I understand right you now have 3 pots connected to a input card (OC or bodnar) and you have one dc motor that should be move according to the pot's position.
The first thing would be to read the pots and check if one of them is in a range which would make it the active one. You will also need to calibrate the pots (hoping they are linear, logarithmic would be really difficult). When you have the active pot's position you need to calculate the difference from the pot to the fsuipc value and move the motor according to the difference.
Was that what you needed to know ?
Hope I could be of any help.
Gery
-
04-17-2011, 04:00 PM #22
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Gery,
The potentiometers are perfectly linear.
Potentiometer 1, range 127-255, covers the heading range: 180 - 010 Degrees
Potentiometer 2, range 121-253, covers the heading range: 009 - 179 Degrees
When the motor reaches 0 degrees, Potentiometer 2 kicks back in again and the process restarts.
Tests performed anticlockwise. Please note all above readings are anticlockwise.
Both pots work perfectly and are definitely suitable for this application. I would just like to know how I go about scaling, an example calculation, etc.
It's just hard because there are literally no scripts/advise for instruments such as heading indicators, which continously rotate.
Using the above information, can you show me an example calculation involving the offset, motor and pots?
Jack
-
04-17-2011, 04:30 PM #23
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
If I understand right, the scale of the instrument is 360 deg, the fsuipc value of $04CE goes from goes from 0 to 359 ?
If yes, then I would align everything on "0". Means the instrument's needle is at 0 when the pot1 is and also when $04CE is at 0.
When you move the motor with the pot from 0 to 1 degrees you should read the value that the pot1 shows and that is then the factor between the pots and the fsuipc $04CE value. You then need to choose which value you want to divide or multiply to have simmilar values to compare.
Example:
$04CE = 0 (degree) and pot1 = 0 (decimal)
$04CE = 1 (degree) and pot1 = 64 (decimal)
64 divided by 64 is 1. So if your pot is linear you should be able to divide all values by 64. Then your pot value is the same as your fsuipc value.
Then you need to programm something like :
-- Read pot1 and pot2 value
-- Check which pot is in active range and assing to a helper variable for example pot = pot1.
-- if pot_value < $04CE_value then
move motor negative.
-- if pot_value > $04CE_value then
move motor positive.
-- Else
stop motor.
-- End.
-
04-17-2011, 04:37 PM #24
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Gery,
I understood most of that, except for the "64 - Decimal" part. What is this "decimal"? Pots values in SIOC are 0-255, so I don't understand that little bit.
regards,
Jack
-
04-17-2011, 04:46 PM #25
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
http://en.wikipedia.org/wiki/Decimal
Sorry this is the last post for this thread. Can't help you more then this.
Gery
-
04-17-2011, 05:00 PM #26
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
-
04-17-2011, 05:12 PM #27
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Jack,
I believe he meant number 64 in the decimal system notation (what we normally use for numbers), not hexadecimal like $04CE
$64 (in hexadecimal system, base 16) would be 6*16 + 4 = 100 in decimal system notation (base 10) ...
You understand?
Nico
BTW 100 in the binary system (base 2) is the same as 4 decimal and 4 hexadecimalLast edited by kiek; 04-17-2011 at 05:15 PM.
-
04-17-2011, 05:30 PM #28
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Nico,
I'm not sure I understood all that. Where does the "+4" come from? And the base is what you multiply the value by? Like base 16 = *16 like you said.
Do I need to know this for the scripting of my HSI? I've done loads of Offsets with SIOC before and have never payed attention to this. 04CE is just standard 0-359.
Jack
-
04-17-2011, 05:40 PM #29
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Hi Jack,
You have to study a little bit I'm afraid...
The base is indeed used to calculate a number,
in a base 10 system 123 means:
1 x (10 to the power of 2) + 2 x (10 to the power of 1) + 3 x (10 to the power of 0), so 100 + 20 + 3 = 123
while in a base 16 system 123 means:
1 x (16 to the power of 2) + 2 x (16 to the power of 1) + 3 x (16 to the power of 0) = 256 + 32 + 3 = 291
Note that 10 to the power of 0 = 1
NicoLast edited by kiek; 04-18-2011 at 01:55 AM.
-
04-17-2011, 06:16 PM #30
Re: "Inner Circle" HSI - SIOC DC Motors Card Script
Okay, so in Decimal (base 10), the number 394 is...
3 x (10 power 2) + 9 x (10 power 1) + 4 x (10 power 0) = 300 + 90 + 4 = 394?
Similar Threads
-
DC Motors Card - How to use in SIOC?
By Boeing 747 Flyer in forum OpenCockpits General DiscussionReplies: 4Last Post: 04-20-2017, 09:11 PM -
Expansion card buggy? Shows "ghost" inputs where there aren't...
By Michael737NG in forum OpenCockpits General DiscussionReplies: 0Last Post: 12-26-2010, 07:02 AM -
SIOC "IF" Question
By Boeing 747 Flyer in forum OpenCockpits General DiscussionReplies: 89Last Post: 08-29-2010, 05:34 PM -
FSX "This graphics card does not meet minimum ..." HELP !!!!
By ibennett in forum Computer Hardware SetupReplies: 5Last Post: 04-12-2010, 09:46 PM -
Looking for "Below GS" and "Spoilers armed" annunciator light offset
By PeterH in forum PM General Q & AReplies: 17Last Post: 03-05-2008, 12:39 PM
Girls in your town
A320 Sound Files Missing