Thanks for your response. I have to think about it. It's a bit of a chaos in my head which I try to sort.
I am asking this, because I would like to calculate the instrument errors for the VSI. 15 years ago I was in PPL training and did steep turns at night. My instrument scan was focused on the VSI, this is what I learned in the flightsim. Just watch the VSI and I am fine. Well, not in real life! I quickly lost 200-300ft in the turn. This is where my motivation comes from. X-Plane and most other sims do not take the instrument error into account. ELITE flightsim from the 90ies did!
So I am trying to estimate the inner workings of the VSI, mainly the processes with the calibration hole and friction. I calculated the static air pressure in XP11 (in XP12 its already a dataref) at an altitude and when starting on the ground it's the same air pressure in the diaphragm. Every movement from that 0-position is either a climb or descent. The diaphragm contains the "old" static air pressure and the housing of the VSI the static pressure (or vice versa, for the calculation it does not matter).
Now when we are climbing, the static pressure in the housing sinks, the diaphragm expands. Air slowly starts moving through the calibration hole, but the diaphragm does not move yet. First it needs to overcome inner friction, so there needs to be a certain pressure difference to start the needle movement. Once the needle moves, pressure can be subtracted from the diaphragm. The speed at which this happens is dependend of the pressure difference. I think for this to take place in a realistic and smooth movement, I can take the vertical-speed-dataref from X-Plane directly and cut it at a certain maximum climb or descent rate (thats the limited flow of the calibration hole).
Technically I am thinking about these two containers of pressure and how they interact. How to get the equilibrium of these two in a changing environment (true vertical speed is changing as I fly). Pressure can be seen as energy potential energy and the inflow/outflow of molecules as kinetic energy. It's a closed system, so energy can be converted back and forth. Taking the formulas of potential energy E=m*g*h and kinetic energy E=1/2m*v^2 and setting m=1, I'll get v=sqrt(2*F*h). F is the difference the calculated pointer and the VSI-dataref from X-Plane (thus, the closer it gets to the target, the slower it gets), h the actual pressure difference between both containers (after overcoming friction) and v the speed (with a maximum) at which the diaphragm changes inner pressure to meet the pressure in the housing. There is no friction once the containers are in equilibrium, friction only comes into account after the direction of movement changes.
But I have to try that out, not sure if my thinking is reasonable enough or correct. This should give delayed smooth needle movements with a sudden onset due to friction.
Of course I could try to fill arrays with past vertical speeds and display them, but then I depend on fps and it's only half the fun. For now, I need to get deeper into LUA. I still don't know when and how to use functions and how to pass variables back and forth. I'll post it if I have any progress.
Olli