To create the effect of the wheels over the runway grooves,
you can add the following code, to be activated when wheels are on ground.
100 A=6: GP=10
'Set the bump amplitude A1 and the groove period LP
101 N=N+1
102 If N=1 then Pout=A 'The first count
will produce a bump with amplitude A
103 If N>1 then Pout=0 'The rest
of the counts will give no bumps
104 IF N=LP then N=0 'When
the counter reaches to groove period LP it will be reset
120 DAC1=P+Pout
The result of this code will be that every N program cycles, a bump will
be generated. It is most realistic to add this bump to the platform pitch
drive. To make the bump frequency increase with speed, LP should be made
dependent on airspeed. You could also make the amplitude dependent on
braking, as the grooves will be more pronounced when the aircraft brakes are
applied.
Above graphs show the DAC output result with A=6 and LP = 10 (slow) and 2
(fast), giving a bump frequency of 1.8Hz and 9Hz respectively. (using with
portdrvr utility, update speed = ~ 45msec)
Note that the max frequency is not completely stable. For some reason the the update speed
with Portdrv utility sometimes skips a beat.
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 GOTO 95 else Pout=0: GOTO 120 'Will activate
the bump code when wheels are on ground
95 A=6: GP=10
100 PRINT N, Pout :
101 N=N+1
102 If N=1 then Pout=A
103 If N>1 then Pout=0
106 IF N=GP then N=0
120 DAC1=127+Pout
121 DAC2=127
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
Back Next