Random Vibrations
Home
Up

Turbulence motion can be added to the platform by adding some random vibration to pitch and roll axis. I have used the RND function of GWbasic

I have made a program that can add random excursions to both pitch and roll, activated by extending Flaps . The following parameters can be set (to be modified by certain flying conditions):
AP = Max random pitch amplitude
AR = Max random roll amplitude
NP = Period of pitch vibration
MR = Period of roll vibration

87 D=INSTR("123456789ABCDEF",right$(D$,1))+16*INSTR("123456789ABCDEF",left$(D$,1))   'extract the dashboard indicator byte from Portdrv utility (7th bit = extend flaps)
90 IF D AND 2^7 GOTO 95 else Rout=0:Pout=0:GOTO 120
'activate random vibrations if Flaps are extended
95 AP=20:AR=20:NP=10:MR=2 
'set random vibration parameters
96 N=N+1:M=M+1                         
'N=pitch counter, M = roll counter
100 PRINT N, M, Rout, Pout :
103 Pout=INT((PNEW-POLD)*N/NP+POLD)  
'set values in between the two pitch random values
106 IF N=NP then POLD=PNEW:PNEW=INT(RND*AP-0.5*AP):N=-1 '
If counter reaches end value, set new random value, and reset counter
110 Rout=INT((RNEW-ROLD)*M/MR+ROLD)
113 IF M=MR then ROLD=RNEW:RNEW=INT(RND*AR-0.5*AR):M=-1

The complete trial program is shown below.

20 ON ERROR GOTO 140
30 CLOSE #1
40 OPEN "com1:9600,n,8" FOR RANDOM AS #1
50 A$=""
55 ON ERROR GOTO 50
60 LINE INPUT#1, A$
70 P$=mid$(A$,3,2)
80 R$=mid$(A$,5,2)
82 D$=right$(A$,2)
85 P=INSTR("123456789ABCDEF",right$(P$,1))+16*INSTR("123456789ABCDEF",left$(P$,1))
86 R=INSTR("123456789ABCDEF",right$(R$,1))+16*INSTR("123456789ABCDEF",left$(R$,1))
87 D=INSTR("123456789ABCDEF",right$(D$,1))+16*INSTR("123456789ABCDEF",left$(D$,1))
90 IF D AND 2^7 GOTO 95 else Rout=0:Pout=0:GOTO 120
95 AP=20:AR=20:NP=10:MR=2
96 N=N+1:M=M+1
100 PRINT N, M, Rout, Pout :
103 Pout=INT((PNEW-POLD)*N/NP+POLD)
106 IF N=NP then POLD=PNEW:PNEW=INT(RND*AP-0.5*AP):N=-1
110 Rout=INT((RNEW-ROLD)*M/MR+ROLD)
113 IF M=MR then ROLD=RNEW:RNEW=INT(RND*AR-0.5*AR):M=-1
120 DAC1=127+Pout
121 DAC2=127+Rout
123 IF DAC1>255 or DAC1<0 then goto 127
124 OUT 888,DAC1
125 OUT 890,3
126 OUT 890,11
127 IF DAC2>255 or DAC2<0 then goto 131
128 OUT 888,DAC2
129 OUT 890,9
130 OUT 890,11
131 GOTO 50
140 RESUME 20


The above graph shows the result of active random vibrations: Top waveform is pitch with slow random vibrations (NP=10), bottom graph is roll with fast random vibrations (MR=2)

>>> A flight video of the above motion cue can be seen here.

Some findings: The random vibration amplitude must be set very small, as noticeable platform movements (that are not visible on screen) make you nauseous. It may also be necessary to add a random function to the NP and MR values.

 

 

Back Next