LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a roll angle to 2 analogue outputs

Hi,

 

I'm very new to Labview and am trying to teach myself as i go along. I have a question that i am assuming is very easy to do, i could just do with some help please.

 

I am trying to control a rig that simulates a basic aircraft. I have a bank angle input of -180 to 180 degrees and want to control two wings. For example when i input a bank angle of -180 degrees i need to output a voltage of -10volts to output 1 and =10 volts to output 2 (1 wing is up and the other wing is down).

 

I am guessing the best way to do this is by using a look up table of some kind? Maybe have a list of inputs from -180 to 180, with each of those being assigned a voltage to output 1 and output 2 which will make the two wings simulate the aircraft being at the relevant bank angle.

 

Any advice on how to implement this would be greatly received as i don't really know what to use and how to wire it up etc.

 

Kind Regards,

 

Kieran

0 Kudos
Message 1 of 10
(3,445 Views)

Hi Kieran,

Instead of using a look up table, it should be possible to use a formula to calcualte the output voltage of each output.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 10
(3,444 Views)

Hi Mike,

 

Thanks for that suggestion. The thought had passed my mind but i'm not really a programmer and wouldn't really know how to write a simple formula for that.

 

Would the look up table or read from spreadsheet not be best for me?

 

i have created a spreadsheet with my inputs of -180 to 180 and then the corresponding output1 and output2 in the next two columns. How would i then implement this in the block diagram. What would i use from the functions pallette etc?

 

I appreciate this is very very basic but i am very new to it and have been thrown in at the deep end 🙂

 

Kind Regards,

 

Kieran

0 Kudos
Message 3 of 10
(3,439 Views)

Hi Kieran,

i think it depends on your requirements. Have you only integer values? If yes, then you can store your data as an array and use the search 1D array function. With this index you can read the corresponding data, from another array with same size.

 

Mike

0 Kudos
Message 4 of 10
(3,435 Views)

Mike,

 

Unfortunately my values are to 2 decimal places.

 

Like i say i am very new to all this and may need more detail 🙂

 

Is there any way of retreiving a value for output 1 and output 2 of my spreadsheet by using the input. I think i need more detail as to exactly what functions to use and what needs wiring up to what.

 

i'm sorry to be a pain, it's just i'm really struggling

 

kind regards,

 

Kieran

0 Kudos
Message 5 of 10
(3,421 Views)

Hi Kieran,

how do you want to create your lock up table? If you use a formula for it, then you can use this formula directly in your code.

 

Mike

0 Kudos
Message 6 of 10
(3,417 Views)

Mike,

 

I have already made my look up table, all it is is a simple spreadsheet with 3 columns that looks like this:

 

Input          Output1           Output2

180                10                    -10

179               9.94                 -9.94

 ...                  ...                       ...

0                    0                         0

 ...                  ...                         ...

-180              -10                     10

 

That is an extract from my spreadsheet i have created but obviously with inputs from 180 all the way down to -180.

 

From the user inputting a value of between 180 and -180 i want to be able to output the relevant -10 to 10v for each output. So if a user inputs a value of -180, i want to set output1 to -10 and output2 to 10.

 

If you could go into as much detail as possible that would be great.

 

Thanks again for your time and advice.

 

Kieran

0 Kudos
Message 7 of 10
(3,415 Views)

Hi Kieran,

something like this should work for you, maybe you have to transform the array.

 

Hope it helps.

Mike

0 Kudos
Message 8 of 10
(3,413 Views)

Unless I misunderstand what you want, wouldn't this work......

 

Howard

 

 

Message Edited by tartan5 on 10-20-2008 07:48 AM
Message 9 of 10
(3,395 Views)

Howard, Mike,

 

Thanks for both your help. That simple divide by 18 has worked a treat. So simple 🙂

 

Think i was trying to be too complex.

 

Thanks again, does exactly what i wanted it to do.

 

Kind Regards,

 

Kieran

Message 10 of 10
(3,386 Views)