View Full Version : Help in BOBII..setting up toe brake question
Stuart72
9th November 2008, 03:39 PM
I never really did any CMS programing, so I am not technical at this at all. I just copied what I saw working in other profiles.
I would like to program my toe brake so that I can progressively use my left and right toe brake to slow and turn my aircraft on the ground.
In BOBII the right brake is "." (period) and the left brake is "," (comma)
The script I was going to use is as follows:
CMS.B1 = ([JS3.A1 > 128] or [JS3.A2 >128]); // Left WHEEL BRAKES
CMS.B2 = ([JS3.A1 > 128] or [JS3.A2 >128]); // Right WHEEL BRAKES
In the CMS control page, the B1 button I was going to uncheck DX mode and enter "," (comma) for the left brake and the same procedure for the B2 button with a "." period.
Is this the best way to do this..would both left and right brake work the same if I press down on both brakes at the same time and let me stop straight without veering off the to left or right.
Bob Church
11th November 2008, 03:19 AM
Hi Stuart,
It would activate the brakes, but there's nothing progressive there. They'll just be on or off. To a degree, you can control it by taking the value from the toe brakes and using that to control an INTERVAL timer. Do some math since you probably can't get more than 5 or 6 before they get too far apart. Also, so long as the trigger points are the same, you really only need to make determination one time. I'd think it would look something like this:
script
b1 = ([ js3.a1 > 128 ] or [ js3.a2 > 128 ]);
timer( INTERVAL, d1, 2, (( 255 - js3.a1 ) / 25 )) = b1;
cms.b1 = d1;
timer( INTERVAL, d2, 2, (( 255 - js3.a2 ) / 25 )) = b1;
cms.b2 = d2;
endScript
The calculations of the off time for the timers would probably need something besides what I've written, you can tweak it to be whatever you want. If you do it that way, you might be able to get acceptable proportional braking since it would modify the time between characters. The brakes are zero at the top, 255 fully depressed. The subtraction from 255 will invert them. It's something that will take a little trial and error.
Anyway, the only way to find out is to give it a try. If you run into trouble, let me know and we can work it out.
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Stuart72
11th November 2008, 03:42 PM
Thanks for the feedback....I am hoping to translate this to other sims such as IL2 or CF3 or Falcon....
I understand that "cms b1" and "cms b2" reffers to button 1 and 2 on the CMS pad, (where I would put the "." and ",")...
But what is being refered to in the
js3.a1 - left toe brake on the pro peddal ???
js3.a2 - right toe brake on the pro peddal ???
b1 -
d1 -
d2 -
Nowing what this is would help understand the script.
Bob Church
11th November 2008, 11:01 PM
Hi Stuart,
>> I understand that "cms b1" and "cms b2" reffers to button 1 and 2 on the CMS pad, (where I would put the "." and ",")... <<
Yes.
>> But what is being refered to in the
js3.a1 - left toe brake on the pro peddal ???
js3.a2 - right toe brake on the pro peddal ???
<<
Yes. It's the current value of the left and right toe brake axis as you say. The value is 0 with the brake released, 255 fully depressed. They're really the X and Y axes, but it needs a CMS-type reference for the script.
>>
b1 -
<<
It's just a bit variable, you can set it TRUE or FALSE with the script. It acts like a button, but it's only visible in the script itself. The references to js1.b1, e.g. with a controller designator, can be referenced up in the GUI. I just used it to set the value once and avoid doing the same calculations for the left and right brakes.
>>
d1 -
d2 -
<<
Those are "Device Bits". Timers and toggles have to have a bit output to tell you what the state of the device is. It's probably easiest to understand with the Toggle:
toggle( d1 ) = js1.b1;
The d1 bit would alternate state every time you click js1.b1, like a push on/push off switch. In the script, they're they indicate whether the timer output is off or on, that gets sent to the cms.bN bit, and you program the cms bits up in the GUI to send the braking character.
When you're testing, remember that the timers don't start running until the pedals are at least half-way down. It's controlled by the 128 value in the first line. You might want to make that smaller or rescale things so you get smoother braking, but I think this would prove out the concept and if it worked the arithmetic can be tweaked to give better response.
Does that help?
Best regards,
- Bob
The StickWorks
http://www.stickworks.com
Powered by vBulletin® Version 4.1.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.