Rig type 0 setting
Home
Up

Ian's software has a build-in option to do the pitch, roll and heave parameter mixing in post processing  or  automatically in the BFF driver. This option needs to be manually set in the BFF config file:

Rig_Type=0 
 is for uncoupled DOF's platforms (or post mixing done in the motor drive software)
Rig_Type=1  
is for coupled (3-point) DOF's platforms (like mine) so no post mixing needed

In the below program I do my own mixing, so the BFF config file uses  Rig_Type=0

20 ON ERROR GOTO 330
30 CLOSE #1
40 OPEN "com1:4800,n,8" FOR RANDOM AS #1
50 A$=""


55 ON ERROR GOTO 50
60 LINE INPUT#1, A$
65 P$=mid$(A$,5,2)
'get XX value
70 R$=mid$(A$,7,2)
'get YY value
75 H$=mid$(A$,9,2)
'get ZZ value
80 P=INSTR("123456789ABCDEF",right$(P$,1))+16*INSTR("123456789ABCDEF",left$(P$,1))
85 R=INSTR("123456789ABCDEF",right$(R$,1))+16*INSTR("123456789ABCDEF",left$(R$,1))
90 H=INSTR("123456789ABCDEF",right$(H$,1))+16*INSTR("123456789ABCDEF",left$(H$,1))
100 DP=128-P:DR=128-R:DH=128-H
'extract the deviation from center value and invert the values
120 DAC1=128+DP+DH
'front actuator needs positive pitch and positive heave
130 DAC2=128-DP+DH-DR
'right rear actuator needs negative pitch, positive heave and negative roll
140 DAC3=128-DP+DH+DR '
left rear actuator needs negative pitch, positive heave and positive roll
190 PRINT P;" "R;" "H;" "DAC1;" "DAC2;" "DAC3
200 IF DAC1>255 or DAC1<0 then goto 240
210 Out 888,DAC1
'send and latch DAC1 value
220 Out 890,10
230 out 890,11
240 IF DAC2>255 or DAC2<0 then goto 280
250 Out 888,DAC2
'send and latch DAC 2 value
260 Out 890,3
270 out 890,11
280 IF DAC3>255 or DAC3<0 then goto 320
290 Out 888,DAC3
'send and latch DAC3 value
300 Out 890,15
310 out 890,11
320 GOTO 50
330 RESUME 20

Note that the pitch, roll and heave amplitudes need to be scaled to stay within actuator range during normal flight. Especially heave is a very dynamic parameter that will use lots of actuator range. For good heave feeling, you want to maximize the range, but this easily results in maxed out actuators in many flight maneuvers. Therefore a scaling factor can be brought in, either via Ian's software (upper and lower bound of movement) or the GW basic code. This could be done as below: 

100 DP=128-P:DR=128-R:DH=(128-H)*0.8  'reduced heave range to 80%.

This leaves some 20% range for pitch and roll at max  heave conditions.

To simplify the code, you can make use of the Rig_Type=1 option in the BFF config file.
See Rig type 1 page.

 

Back Next