diomedes33
31-01-2005, 04:57 PM
I liked my ch Fighterstick so much that I recently bought the throttle and pedals to go with it, replacing my old X-45. I primarily fly IL2 and I use the two rotaries on the X-45 throttle for prop-pitch and elevator trim. After I set up everything in the CH Manager, I found that there was only one rotary and it was at the base of the stick.
This was a problem for me that took me a couple month's to solve. I also use the mouse stick on the throttle to look around, so everytime I wanted to adjust trim I was left vulnerable. I tried mapping keys to buttons, but I either had to click a lot or it just moved too slow (using character repeat).
I knew that the cms script was pretty powerful from looking at the examples and since I had a pretty good programming background, I thought eh? maybe I can make something.
Here's the result:
I create virtual axies using CMS.Ax and use different buttons on the stick to increment or decrement their position. The mode on the throttle is unused so I used it to switch between coarse, medium and fine rates.
Here's a code example of elevator trim
%DEFINE ELEV_TRIM A2
%DEFINE delta_Axis A1
//AxisRate = (255*CHARACTER_RATE) / (TARGET_PERIOD)
//I believe that the axis rate can only be Integers so round up or down
//CHARACTER_RATE is defined in the first tab (defaults to 50 ms)
//TARGET_PERIOD is the time you want the axes to travel from full open to full close
%DEFINE COARSE_RATE 3 (255*0.050) / (4.25 sec)
%DEFINE MEDIUM_RATE 2 (255*0.050) / (6.375 sec)
%DEFINE FINE_RATE 1 (255*0.050) / (12.75 sec)
//Use the throttle mode to switch between Coarse/Medium/Fine
IF ([PROTHRMODE == 1]) THEN
delta_Axis = MEDIUM_RATE;
ELSE IF ([PROTHRMODE == 2]) THEN
delta_Axis = FINE_RATE;
ELSE
delta_Axis = COARSE_RATE;
ENDIF ENDIF
//Elevator Trim (uses POV hat on Stick)
SEQUENCE
WHILE(JS1.B25); //<--Change this binding to move the button
ELEV_TRIM = ELEV_TRIM - delta_Axis;
DELAY(1);
ENDSEQUENCE
SEQUENCE
WHILE (JS1.B29);
ELEV_TRIM = ELEV_TRIM + delta_Axis;
DELAY(1);
ENDSEQUENCE
//Resets Trim to neutral using the pinky button on the stick
IF (JS1.B4) THEN
ELEV_TRIM = 0;
ENDIF
//This may be overkill but it makes sure that the values stay with in the
//range -127 < Axis < 127 (for prop pitch switch to 0 < Axis < 255)
IF ([ELEV_TRIM < (-127 + delta_Axis)]) THEN ELEV_TRIM = -127; ENDIF
IF ([ELEV_TRIM > (127 - delta_AXis)]) THEN ELEV_TRIM = 127; ENDIF
//Binds the axes to the second step
CMS.A1 = 127 + ELEV_TRIM; //Centered Axis
//CMS.A1 = ELEV_TRIM; //or CMS.A1 = 255 - ELEV_TRIM; //Non-centered
After this bind the CMS.A1 to an unused axis and you're good to go.
I appologize if this has already been done, I got tunnel vision about halfway through and I wasn't about to let a collection of plastic and potentiometers beat me.
This setup up works pretty well for me, I have Elevator and Aileron trim bound to my stick's POV hat and prop-pitch bound to the top 4-way hat on the throttle. Hope this helps anyone who was having the same issues as me.
This was a problem for me that took me a couple month's to solve. I also use the mouse stick on the throttle to look around, so everytime I wanted to adjust trim I was left vulnerable. I tried mapping keys to buttons, but I either had to click a lot or it just moved too slow (using character repeat).
I knew that the cms script was pretty powerful from looking at the examples and since I had a pretty good programming background, I thought eh? maybe I can make something.
Here's the result:
I create virtual axies using CMS.Ax and use different buttons on the stick to increment or decrement their position. The mode on the throttle is unused so I used it to switch between coarse, medium and fine rates.
Here's a code example of elevator trim
%DEFINE ELEV_TRIM A2
%DEFINE delta_Axis A1
//AxisRate = (255*CHARACTER_RATE) / (TARGET_PERIOD)
//I believe that the axis rate can only be Integers so round up or down
//CHARACTER_RATE is defined in the first tab (defaults to 50 ms)
//TARGET_PERIOD is the time you want the axes to travel from full open to full close
%DEFINE COARSE_RATE 3 (255*0.050) / (4.25 sec)
%DEFINE MEDIUM_RATE 2 (255*0.050) / (6.375 sec)
%DEFINE FINE_RATE 1 (255*0.050) / (12.75 sec)
//Use the throttle mode to switch between Coarse/Medium/Fine
IF ([PROTHRMODE == 1]) THEN
delta_Axis = MEDIUM_RATE;
ELSE IF ([PROTHRMODE == 2]) THEN
delta_Axis = FINE_RATE;
ELSE
delta_Axis = COARSE_RATE;
ENDIF ENDIF
//Elevator Trim (uses POV hat on Stick)
SEQUENCE
WHILE(JS1.B25); //<--Change this binding to move the button
ELEV_TRIM = ELEV_TRIM - delta_Axis;
DELAY(1);
ENDSEQUENCE
SEQUENCE
WHILE (JS1.B29);
ELEV_TRIM = ELEV_TRIM + delta_Axis;
DELAY(1);
ENDSEQUENCE
//Resets Trim to neutral using the pinky button on the stick
IF (JS1.B4) THEN
ELEV_TRIM = 0;
ENDIF
//This may be overkill but it makes sure that the values stay with in the
//range -127 < Axis < 127 (for prop pitch switch to 0 < Axis < 255)
IF ([ELEV_TRIM < (-127 + delta_Axis)]) THEN ELEV_TRIM = -127; ENDIF
IF ([ELEV_TRIM > (127 - delta_AXis)]) THEN ELEV_TRIM = 127; ENDIF
//Binds the axes to the second step
CMS.A1 = 127 + ELEV_TRIM; //Centered Axis
//CMS.A1 = ELEV_TRIM; //or CMS.A1 = 255 - ELEV_TRIM; //Non-centered
After this bind the CMS.A1 to an unused axis and you're good to go.
I appologize if this has already been done, I got tunnel vision about halfway through and I wasn't about to let a collection of plastic and potentiometers beat me.
This setup up works pretty well for me, I have Elevator and Aileron trim bound to my stick's POV hat and prop-pitch bound to the top 4-way hat on the throttle. Hope this helps anyone who was having the same issues as me.