Weight and Balance Calculator
for
Robin HR100/210 G-BAPY
This page has everything you need for doing weight and balance calculations for G-BAPY, including a fuel calculator.
Fuel calculator
Enter the amount of fuel in each of G-BAPY's four tanks (in Imperial gallons, US gallons or litres). Each tank can hold up to 25 Imperial gallons, of which about 1 gallon is unusable. You can also enter an estimated fuel burn rate to estimate total endurance (typical burn rate is about 9 Imperial gallons per hour at 65% power). Once you've done this, the fuel weight will be transferred automatically into the Weight & Balance calculator below.
Weight & Balance calculator
Below is a weight and balance calculator for G-BAPY. To use it, type in weights (in pounds) in the left-hand column of text boxes, then click "Calculate", and you should see the cross on the weight/balance graph move.
Important safety note: I use this calculator for doing weight and balance calculations before flying G-BAPY, but you should be aware that this calculator is specific to that particular aircraft. The answers it gives are not applicable to any other aircraft (not even other HR100s). It illustrates the principles of how the calculation is done, but you must use the data taken from the POH of your particular aircraft.
How does it work?
I get lots of emails from people asking me how the calculator works, and whether they can re-use it on their own sites. The answer is "yes" - you're free to re-use the code at your own risk and adapt it for your own aircraft. All I ask is that you include a link to this page and credit me as the original author of the calculator.
My aim when writing the calculator was to implement it using the least amount of web technology possible, so that it should work in as many browsers and on as many different platforms as possible. There are no Java applets or server-side components involved at all.
The calculator uses just two technologies: Javascript, and CSS. Both of these should be available on 99% of modern browsers, and because it's all client-side code the calculator works without the need for any round-trips to the web server.
Essentially, it all works using two images. The first image is a diagram of the weight and balance envelope, created using an ordinary graphics package and created using data from G-BAPY's POH. If you adapt the calculator for your own use, you will need to create your own envelope diagram using data for your own aircraft.
The envelope diagram is housed inside an HTML div, and forms the "background-image" of the div. The size of the div is manually set to match the size of the envelope diagram.
Now the clever bit. The crosshair is simply a transparent GIF that lives inside the envelope div. You can steal this image if you want (but please host it on your own server - don't just link to it). The crucial thing is that I've used CSS to give this a "position: relative" attribute. This takes the image out of the normal HTML document flow, and allows it to be repositioned dynamically by script.
Here's a simplified version of the HTML code, with the CSS styles included in the HTML code for clarity. In reality, you'd probably want to put the CSS styling into a separate CSS file...
<div style="background-image: url('http://www.yoursite.com/your_envelope_image.gif'); width: 640px; height: 315px;"> <img id="crossHairImage" style="position: relative; left: 0px; top: 0px; margin: 0px; padding: 0px;" src="http://www.yoursite.com/crosshair.gif" width="32" height="32" alt="" title="" /> </div>
The Javascript code simply takes all the weights that you type into the form, and does the calculations to figure out what coordinates it should move the crosshair to. It then updates the crosshair's "left" and "top" CSS properties, et voila! The crosshair moves automatically.
You can find the Javascript code here. It isn't the most beautiful code I've ever written, but it does the job. You will need to modify the values in the "WB_Reset" function to match the values for your own aircraft, and you'll need to modify the numbers in "WB_Plot" to match the dimensions of your envelope image.
function WB_Plot(weight, moment) { // Left-margin on the graph is 65 pixels... var x = Math.round(65 + ((moment - 40000) / 10000) * 80) - 15; var y = 266 - Math.round(((weight - 1500) / 100) * 32) - 15; // Move the crosshair image by updating its "left" and "top" // properties... with (document.images.crossHairImage.style) { left = x + 'px'; top = y + 'px'; } }