Jump to content


Commercial Member
  • Content Count

  • Donations

  • Joined

  • Last visited

Community Reputation

0 Neutral

About bcs112

  • Rank

Contact Methods

  • Website URL
  • ICQ

Flight Sim Profile

  • Commercial Member
  • Online Flight Organization Membership
  • Virtual Airlines
  1. Hi all,I've spent most of the past 2 days looking for a way to disable the joystick axis via SimConnect but it doesn't seem to want to work !Here's the code for the X axis:if (SUCCEEDED(SimConnect_Open(&hSimConnect, "A300 Event", NULL, 0, 0, 0))){SimConnectOpen = true;//I use this event to change the state of the axis hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_1HZ, "1sec");hr = SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_XAXIS); hr = SimConnect_AddClientEventToNotificationGroup(hSimConnect, GROUP_JOYSTICK, EVENT_XAXIS);hr = SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_JOYSTICK, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE);hr = SimConnect_MapInputEventToClientEvent(hSimConnect, INPUT_XAXIS, "joystick:0:XAxis", EVENT_XAXIS, 0, (SIMCONNECT_CLIENT_EVENT_ID)SIMCONNECT_UNUSED, 0, true);hr = SimConnect_SetInputGroupPriority(hSimConnect, INPUT_XAXIS, SIMCONNECT_GROUP_PRIORITY_HIGHEST_MASKABLE); SimConnect_CallDispatch(hSimConnect, MyDispatchProcMI, NULL);}Then I catch the event:case SIMCONNECT_RECV_ID_EVENT:{ SIMCONNECT_RECV_EVENT *evt = (SIMCONNECT_RECV_EVENT*)pData; switch(evt->uEventID) {case EVENT_1HZ://Roll and pitchif ( green_accu_exp < 1450 && blue_accu_exp < 1450 && yellow_accu_exp < 1450 && XAXIS_ON ) { hr = SimConnect_SetInputGroupState(hSimConnect,INPUT_XAXIS, SIMCONNECT_STATE_OFF); XAXIS_ON = 0;}else { if ( XAXIS_ON == 0 && (green_accu_exp > 1450 || blue_accu_exp > 1450 || yellow_accu_exp > 1450)){ hr = SimConnect_SetInputGroupState(hSimConnect,INPUT_XAXIS, SIMCONNECT_STATE_ON); hr = SimConnect_SetInputGroupState(hSimConnect,INPUT_YAXIS, SIMCONNECT_STATE_ON); XAXIS_ON = 1; }}break;}All the hr's return S_OK so things seem to work as they should, but you guessed it... the joystick axis are not disabled !Did I miss anything ? I use the Saitek X52, would this need to be accessed as joystick:1 maybe ?Bj
  2. Hi,I've been trying to create a Dialog box in FSX using the DialogBox API call and with the resource for the dialog box in a resource only dll.Creating the box works fine and it displays correctly but... I can't communicate with the dialogbox ! I receive the WM_INITIALZE message and from then on the WM_REDRAW message but the title bar of the dialog stays in the "unfocussed" state and when I try to click the dialog (or the FSX window for that matter) I get the typical low xylophone "bong" sound. I also tried setting DialogMode via SimConnect but except for the background of the main FSX window turning black, this has no effect on the behaviour of the dialog box.Has anyone succeeded in working with DialogBox in FSX so far ? Any tricks I may have missed ?Bj
  3. OK thx for your thoughts, still it would be a great addition if they added click areas on the outside model...Bj
  4. Hey Fred,I'm not sure if many people will be facing the same problem but here is what I did. In my multigauge setup I use "module_init" and "module_deinit" for doing all kinds of things that only need to be done once, like initializing and loading the sound files. The big advantage of using this method is that these sections are always performed when the gauge is loaded. So you don't have to worry if the individual subgauge that holds the sound stuff is loaded or not (hope you see what I'm trying to say).And using this technique the sound stuff worked just fine when it was loaded the first time, but when you try to reload the panel for some reason directsound runs out of memory. The way to solve the problem is to move the sound away from the module sections and back into the gauge. Which is off course opposite to what I wanted to do in the first place.The sound must be initialized (InitDirectSound) in the PANEL_SERVICE_PRE_INITIALIZE section and unloaded in the PRE_KILL section.Bj
  5. Hi,Pitch sensitivity can be changed in the aircrtaft.cfg file, do note that this will also have an effect on the autopilot effectiveness ! Bj
  6. Hi,I was wondering if anyone knows if and how one could add mouse click zones on the exterior model of the aircraft. I was hoping on being able to use this for: opening doors, stowing the RAT etc. that kind of stuff.Thanks,Bj
  7. A "short" update on my progress so far...Lost many hous of sleep on this one ;) But I seem to have been able to create a stable VSPD controller now, albeit that in moderate turbulence it doesn't work well. I know real life VSPD doesn't work well in turbulent situations but its not good enough.Anyway, what I have done to get a good result is:- Use the elevator trim (not the elevator itself since this is also not done in real life) to set the aircraft pitch- Use a first PID controller to set the vertical speed based on current vertical speed and set speed => as discussed before this results in a very unstable controller that is always overshooting the set speed- I created a second PID controller that uses set vertical speed as the target and projected vertical speed as the current value. ==> The projected vertical speed is the current vertical speed + the delta (change) in vertical speed since the last check. I check the vertical speed 3 times per second now (in fact every 300ms). I calculate the vertical speed in about 4 seconds and use that in the second PID algorithm.- If the sign (+ or -) of the PID output based on the current VSPD is the same as the sign of the PID controller using projected VSPD than I use the current PID output, if the sign of the projected VSPD controller is opposit than I use the output of the other PID controller. I think this is called "feed forward". The problem is off course that in very turbulent conditions the feed forward principle tends to disable the VSPD controller since the rapid fluctuations will trigger the second PID controller output... so I need to take a look at that.- Finally I add a third P-only-controller that takes the (change in) bank angle and the actual bankangle into consideration. If the bank angle increases the VSPD is increased proportionaly (hence P-controller), if the bank angle decreases than I do the opposit. I possibly need to use a third PID controller for this but at first sight the results using a simple proportionate controller seem to be sufficiant. More testing needs to be done though. Since the g-force is proportionate to the square of the angle I possibly will need to use that also somewhere, but FS is not the real world so I'm not sure if this is modelled correctly in FS to start with.Bj
  8. Hi,Yes I agree using VSPD is not the best method, but I tried using elevator trim and elevator directly. I always get the same problems, the formula doesn't correct quicky enough when for instance the target speed is reached (derivate function).Hence my question if this is the best formula or if anyone knows of a better one. I will do some more tests though and hopefully find a better solution.Bj
  9. Hi again,First question: does this PID controller equation actually work for anyone or is here a better formula ?According to the abovementionned website one should tweak the PID controller based on Kp, Td and Ti. This is my basic set-up for an IAS (FL CH in Boeing speak) function using the vertical speed mode of the FS autopilot. The alt_set_target value is fed into the FS autopilot vertical speed setting.double ac_vs = VERTICAL_SPEEDvar.var_value.n/256*60/0.305;if ( ias_exp && sim_pause == 0 ){ VSPDController->Kp = Kp_exp; VSPDController->beta = 1.0; VSPDController->alpha = 0.1; VSPDController->gamma = 0.0; VSPDController->Ti = Ti_exp; VSPDController->Td = Td_exp; VSPDController->u_min = -5000; VSPDController->u_max = 5000; VSPDController->TargetValue = ap_target_spd *-1; VSPDController->CurrentValue = AIRSPEEDvar.var_value.n *-1; VSPDController->PreviousOutputValue = ac_vs ; VSPDController->Update(1); alt_set_target = VSPDController->OutputValue;}I start by setting Kp to 1 and Ti to 15, this results in a very slow reacting controller fluctuating around the set value. I then start increasing Kp, which results in a more explicit reaction (bigger VSPD steps) and reducing Ti for a snappier response until I get something slow but usable to start.The biggest issue is that I always get overshoots from the set speed, and these don't decrease. So there is a lack of predictive value in the system. I then slowly increase Td but that doesn't seem to make the system more stable.So how do I increase the predictive value of the system ? Are there any trick to make the system more stable ? The reaction time of the pitch in my aircraft is relatively slow but this is like the real aircraft (Airbus 300) which is quite heavy. So the system should be able to handle a relatively large lag.Bj
  10. Hi all,I've been using and abusing in many cases the FS autopilot system for years but with FSX the vertical stability of aircraft at low speed and in 25-30
  11. Thx Jean-Luc,I removed all the code from the main callback in the FO gauge and created separate gauges. That solved the problem for now ;)Kind regards,Bj
  12. Hi,It would think that the 3D model for instance is not a problem except if the model is somehow patented or registered (otherwise no-one could make sweaters, shoes, chairs, etc... anymore). The use of the Airbus or Boeing name and logo on the fuselage is something else of course since those symbols and logo's are registered !No idea about the software and representation of data in the cockpit. I know that when I created some of my gauges (TCAS gauges) I asked for explicit permission from the manufacturer. Well the permission was in fact to use the company name. Bendix at one point refused to give permission so I had to remove any reference to that company, L3 where very happy to help and they even sent me their original soundbites for TCAS alerts ! So, it really differs from company to company. Bj
  13. Here's what I found, apparently you can't use the same gauge twice but you have to create 2 separate gauges using the same callbacks...Bj
  • Create New...