How to make script for Tiller

This is a new forum for the OC4BAv4.
mvr1918
Site Admin
Posts: 1633
Joined: Thu Aug 30, 2012 3:35 pm

How to make script for Tiller

Post by mvr1918 »

This a little info about getting a Steering Tiller in operation.
The script code here is now included in the latest OCP4NGX script code.


Well, I don't have a steering tiller myself, but I guess this isn't too difficult.
By reading the servo card manual, and examining some other scripts, I think you would know the solution.
There's always a program example in the Opencockpits manuals.

In the specific manual, there are two examples. One for the servos and one for the analog inputs. By combining some code of both examples, you would have the solution.

So we need some code to read the analog input:

Var 001, name tiller_pot, Link USB_ANALOGIC, Device 2, Input 1, posL 0, posC 128, posR 255

Now you say that you get values between 55 and 203 with the center at 128. To make use of the complete analog input range 0-255, we need to change our code a little bit:

Var 001, name tiller_pot, Link USB_ANALOGIC, Device 2, Input 1, posL 55, posC 128, posR 203

After changing this, the value that comes from the analog input will go from 0 to 255 and no longer from 55 to 203 which give you a better resolution to control the tiller.

By entering the range of your potentiometer, sioc will calculate the full range from 0-255.

In SIOC monitor the value from the potentiometer will still be 55-203 because this is the raw data, but once you use the analog input in a variable, you can see the used value in the IOCP monitor.


Ok, now we also need some code to send data to an FSUIPC offset:

The offset for the steering tiller is 3BC4

Var 002, name tiller_offset, Link FSUIPC_OUT, Offset $3BC4, Length 2

Ok, now that we've got the code for the analog input and the FSUIPC offset, we need to make a complete code that sends the analog input to the FSUIPC offset:

Var 001, name tiller_pot, Link USB_ANALOGIC, Device 2, Input 1, posL 55, posC 128, posR 203
{
&tiller_offset = &tiller_pot
}
Var 002, name tiller_offset, Link FSUIPC_OUT, Offset $3BC4, Length 2


By adding the code "&tiller_offset = &tiller_pot", the value that comes from the analog input will be send to the FSUIPC offset everytime that the potentiometer has been moved.

Now run your flight sim, start sioc and open FSUIPC. Go to Axis Assignment and move the tiller. Select "Send direct to FSUIPC calibration",
enable the first action and from the list, select "Steering tiller". Now go to "Joystick calibration", page 9 and there calibrate the steering tiller.

That's all I guess. ;)

I just tried this with a spare servo card and potentiometer and it seems to work here.
DDC
Posts: 30
Joined: Sun Oct 09, 2016 6:10 pm

Re: How to make script for Tiller

Post by DDC »

Thanks a lot for posting this. Just read this on the train and will try it out tonight.
DDC
Posts: 30
Joined: Sun Oct 09, 2016 6:10 pm

Re: How to make script for Tiller

Post by DDC »

This process works. Thanks.
mvr1918
Site Admin
Posts: 1633
Joined: Thu Aug 30, 2012 3:35 pm

Re: How to make script for Tiller

Post by mvr1918 »

Verified and working
betampona
Posts: 36
Joined: Mon Jun 23, 2014 6:02 am
Location: Paris France

Re: How to make script for Tiller

Post by betampona »

Hello, I just have the test. The potentiometer replaces the support on the pedals, I see the rear wing and the pedals move, but not the front wheel.
I thought that when the Nose wheel steering switch was actuated this made the Tiller active and only the front wheel was rotating.
Greetings
DDC
Posts: 30
Joined: Sun Oct 09, 2016 6:10 pm

Re: How to make script for Tiller

Post by DDC »

I noticed the same thing. When I move the tiller it moves the pedals and not the tiller. I was thinking that the tiller doesnt actually move in P3D/FSX but maybe I am wrong.
mvr1918
Site Admin
Posts: 1633
Joined: Thu Aug 30, 2012 3:35 pm

Re: How to make script for Tiller

Post by mvr1918 »

I do not think the movements of the Tiller in the virtual 3D cockpit is modelled by PMDG.
betampona
Posts: 36
Joined: Mon Jun 23, 2014 6:02 am
Location: Paris France

Re: How to make script for Tiller

Post by betampona »

Hello, I would like to know that it is the action of Var 2743 entitled TILLER, it is an entry, when I simulate it, I is nothing moving in the PMDG.

The movement of the Tiller steering wheel should not be simulated, but does the front wheel have to rotate? I saw a video on youtube or the person was turning a wheel of joystick with a programming in FSUIPC and one saw the front wheel turned.
Greetings.
mvr1918
Site Admin
Posts: 1633
Joined: Thu Aug 30, 2012 3:35 pm

Re: How to make script for Tiller

Post by mvr1918 »

You can use FSUIPC

Here is my code


Var 897, name tiller, Link USB_ANALOGIC, Device 36, Input 1, PosL 1, PosC 140, PosR 255
{
IF &tiller > 129
{
&tiller_offset = &tiller
}
IF &tiller < 127
{
&tiller_offset = &tiller
}
}
Var 0898, name tiller_offset, Link FSUIPC_OUT, Offset $3BC4, Length 2

See video

https://www.youtube.com/watch?v=4V-CzkbQRus
betampona
Posts: 36
Joined: Mon Jun 23, 2014 6:02 am
Location: Paris France

Re: How to make script for Tiller

Post by betampona »

It is mentioned by youtube that this video is private. It is impossible for me to see it.
I would have liked to see it, to see if this corresponds to my request.
Why PosC 140 instead of 128?

Greetings.
Post Reply