Coil Spring Weight Calculator Mtb

MTB Coil Spring Weight Calculator – Calculate Your Bike's Spring Rate body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; background-color: #f8f9fa; color: #333; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 30px auto; padding: 25px; background-color: #ffffff; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); } header { background-color: #004a99; color: #ffffff; padding: 20px 0; text-align: center; border-radius: 8px 8px 0 0; margin-bottom: 30px; } header h1 { margin: 0; font-size: 2.2em; letter-spacing: -0.5px; } .calc-section { margin-bottom: 40px; padding: 30px; background-color: #eef5ff; border-radius: 6px; border: 1px solid #d0e0f0; } .calc-section h2 { color: #004a99; margin-top: 0; margin-bottom: 20px; font-size: 1.8em; text-align: center; } .input-group { margin-bottom: 20px; display: flex; flex-direction: column; align-items: flex-start; } .input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #004a99; } .input-group input[type="number"], .input-group select { width: 100%; padding: 12px 15px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 1.1em; transition: border-color 0.3s ease; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: #004a99; outline: none; box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 8px; display: block; } .input-group .error-message { color: #dc3545; font-size: 0.9em; margin-top: 8px; display: none; /* Hidden by default */ height: 1.2em; /* Reserve space */ } .button-group { display: flex; justify-content: center; gap: 15px; margin-top: 30px; flex-wrap: wrap; } button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1.1em; font-weight: 600; transition: background-color 0.3s ease, transform 0.2s ease; color: #ffffff; background-color: #004a99; } button:hover { background-color: #003366; transform: translateY(-2px); } button.secondary { background-color: #6c757d; } button.secondary:hover { background-color: #5a6268; } button.success { background-color: #28a745; } button.success:hover { background-color: #218838; } #result-container { margin-top: 35px; padding: 25px; background-color: #d4edda; border: 1px solid #28a745; border-radius: 6px; text-align: center; min-height: 150px; /* Ensure space for results */ display: flex; flex-direction: column; justify-content: center; } #result-container.hidden { display: none; } #main-result { font-size: 2.5em; font-weight: bold; color: #155724; margin-bottom: 15px; display: block; /* Ensure it takes space */ } #result-container .result-label { font-size: 1.2em; font-weight: 600; color: #155724; margin-bottom: 10px; } .intermediate-results { display: flex; justify-content: space-around; margin-top: 20px; flex-wrap: wrap; gap: 15px; } .intermediate-results .result-item { text-align: center; padding: 10px 15px; background-color: #ffffff; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.08); } .intermediate-results .result-label { font-size: 0.9em; color: #004a99; margin-bottom: 5px; font-weight: 600; } .intermediate-results .result-value { font-size: 1.3em; font-weight: bold; color: #004a99; } .formula-explanation { font-size: 0.95em; color: #555; margin-top: 20px; text-align: center; font-style: italic; } table { width: 100%; border-collapse: collapse; margin-top: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.08); } thead { background-color: #004a99; color: #ffffff; } th, td { padding: 12px 15px; text-align: left; border: 1px solid #ddd; } th { font-weight: bold; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { caption-side: bottom; padding-top: 10px; font-size: 0.9em; color: #666; font-style: italic; text-align: center; margin-top: 15px; } #chart-container { margin-top: 30px; padding: 20px; background-color: #ffffff; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.08); text-align: center; } #chart-container h3 { color: #004a99; margin-top: 0; margin-bottom: 15px; } canvas { max-width: 100%; height: auto; } .article-section { margin-top: 40px; padding: 30px; background-color: #ffffff; border-radius: 6px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); } .article-section h2, .article-section h3 { color: #004a99; margin-bottom: 15px; } .article-section h2 { font-size: 2em; border-bottom: 2px solid #004a99; padding-bottom: 10px; } .article-section h3 { font-size: 1.5em; margin-top: 25px; } .article-section p { margin-bottom: 15px; font-size: 1.05em; } .article-section ul, .article-section ol { margin-left: 20px; margin-bottom: 15px; font-size: 1.05em; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; padding: 10px; background-color: #f2f9ff; border-left: 4px solid #004a99; border-radius: 3px; } .faq-item strong { color: #004a99; display: block; margin-bottom: 5px; } .related-links { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { color: #004a99; text-decoration: none; font-weight: 600; } .related-links a:hover { text-decoration: underline; } .related-links span { font-size: 0.9em; color: #555; display: block; margin-top: 3px; } .highlight { background-color: #fff3cd; padding: 3px 5px; border-radius: 3px; } @media (max-width: 768px) { .container { margin: 15px auto; padding: 20px; } header h1 { font-size: 1.8em; } .calc-section h2 { font-size: 1.5em; } button { width: 100%; } .button-group { flex-direction: column; align-items: center; } .intermediate-results { flex-direction: column; align-items: center; } .intermediate-results .result-item { width: 80%; } #main-result { font-size: 2em; } .article-section { padding: 20px; } .article-section h2 { font-size: 1.7em; } .article-section h3 { font-size: 1.3em; } }

MTB Coil Spring Weight Calculator

Calculate Your Ideal MTB Coil Spring Rate

Enter your total weight in kilograms (kg).
Enter your bike's weight in kilograms (kg).
The total travel of your rear shock in millimeters (e.g., 65mm, 75mm).
22.2 mm (Common for smaller shocks) 25.4 mm (Common for many shocks) 28.6 mm (Less common, larger shocks) 34.9 mm (Very large shocks, downhill) The diameter of the shock's shaft. Check your shock manufacturer's specs.
Your bike's suspension leverage ratio (e.g., 2.5, 3.0). Check your bike's manual or manufacturer website.
Input Value Unit Description
Rider Weight (incl. gear) kg Total weight of rider and equipment.
Bike Weight kg Total weight of the bicycle.
Shock Stroke mm The full travel range of the rear shock.
Shock Shaft Diameter mm The diameter of the shock's internal shaft.
Leverage Ratio Ratio of rear wheel travel to shock travel.
Key inputs used for MTB coil spring rate calculation.

Spring Rate vs. Rider Weight

How recommended spring rate changes with rider weight for typical MTB setups.

What is MTB Coil Spring Weight (Spring Rate)?

The MTB coil spring weight, more accurately termed the spring rate, is a crucial measurement that dictates how much force is required to compress a coil spring a certain distance. For mountain bikers, understanding and selecting the correct spring rate for their rear shock is fundamental to achieving optimal suspension performance, comfort, and control on the trail. It directly influences how the suspension reacts to impacts, how much sag is present, and the overall feel of the bike.

Who Should Use an MTB Coil Spring Weight Calculator?

Any mountain biker using a coil-sprung rear shock should consider using a coil spring rate calculator. This includes riders across various disciplines:

  • Downhill (DH) Riders: Rely heavily on coil shocks for their consistent damping and ability to handle high-impact forces. Accurate spring rate is critical for control and preventing bottom-outs.
  • Enduro Riders: Often opt for coil shocks for their tunable nature and robustness on long, demanding descents.
  • Freeride and Bike Park Riders: Benefit from the plushness and impact absorption of coil springs.
  • Trail Riders: Some trail bikes are spec'd with coil shocks, offering a more linear suspension feel.

Even if your bike came with an air shock, you might be considering a conversion to a coil shock. In this case, a coil spring weight calculator is indispensable. It helps demystify the process of choosing the right spring, which is often specified in pounds per inch (lbs/in) or Newtons per millimeter (N/mm).

Common Misconceptions About MTB Coil Spring Rates

  • "Heavier spring = stiffer ride": While a heavier spring (higher spring rate) will feel stiffer, it's not always about simply choosing the stiffest option. An overly stiff spring will prevent the suspension from using its travel effectively, leading to a harsh ride and reduced traction.
  • "You just add rider weight and bike weight": The actual calculation is more complex, involving suspension geometry (leverage ratio) and shock design (stroke, shaft diameter). Simply guessing can lead to a poorly performing suspension.
  • "Spring rate is the only factor": While critical, spring rate is only one part of the suspension equation. Damping settings (rebound, compression) are equally important for controlling the suspension's movement after compression.

MTB Coil Spring Rate Formula and Mathematical Explanation

The core principle behind determining the correct MTB coil spring weight is understanding the forces acting on the suspension and how they relate to the shock's geometry. The goal is to select a spring that provides approximately 20-33% sag when the rider is in a neutral riding position. This calculator uses a common approach to estimate the required spring rate.

The Formula

The primary calculation for the required spring rate is derived from:

Spring Rate (N/mm) = (Total System Weight * Acceleration due to Gravity) / (Shock Stroke * Leverage Ratio)

Let's break down the components:

  1. Total System Weight (kg): This is the combined weight of the rider and their gear, plus the weight of the bicycle itself. This represents the total mass that the suspension needs to support.
  2. Acceleration due to Gravity (m/s²): Approximately 9.81 m/s². This converts mass (kg) into force (Newtons). Force = Mass × Acceleration.
  3. Shock Stroke (mm): The total linear travel of the shock absorber's shaft. This is a physical dimension of the shock.
  4. Leverage Ratio (unitless): This is a critical factor determined by your bike's suspension linkage design. It describes how much the rear wheel moves relative to the shock's movement. A higher leverage ratio means the shock compresses more for a given amount of rear wheel travel. The formula usually uses the *effective* leverage ratio at the point of sag.

Variable Explanations Table

Variable Meaning Unit Typical Range
Rider Weight (incl. gear) Total mass of the rider and their protective gear, pack, etc. kg 50 – 150+
Bike Weight Total mass of the bicycle itself. kg 12 – 20+
Shock Stroke The maximum linear travel of the shock absorber. mm 50 – 75+
Shock Shaft Diameter The diameter of the inner shaft of the shock. Affects air spring volume/pressure if applicable, but used here as a proxy for shock physical characteristics and typical linkage interactions. mm 22.2, 25.4, 28.6, 34.9
Leverage Ratio The ratio between rear wheel travel and shock travel at a specific point in the suspension stroke. 1.8 – 3.5+
Total System Weight Rider Weight + Bike Weight kg 62 – 170+
Gravity Standard acceleration due to gravity. m/s² ~9.81
Effective Spring Force (N) The force required from the spring to support the Total System Weight. N Calculated
Target Spring Rate (N/mm) The calculated spring rate needed to achieve desired sag. N/mm Calculated
Recommended Spring Rate (lbs/in) Commonly used unit in the industry, converted from N/mm. lbs/in Calculated

Note: The specific Leverage Ratio can vary throughout the suspension stroke. Calculators often use an average or a ratio specific to the sag point (around 25-33% compression). For precise tuning, consulting your bike manufacturer's kinematic data is recommended.

Practical Examples (Real-World Use Cases)

Example 1: Aggressive Trail Rider

A rider weighing 85 kg with gear is riding an enduro bike that weighs 16 kg. The bike features a rear shock with a 65 mm stroke and a leverage ratio of 2.75. The shock shaft diameter is 25.4 mm.

  • Inputs:
  • Rider Weight: 85 kg
  • Bike Weight: 16 kg
  • Shock Stroke: 65 mm
  • Leverage Ratio: 2.75
  • Shock Shaft Diameter: 25.4 mm

Calculation:

  • Total System Weight = 85 kg + 16 kg = 101 kg
  • Effective Spring Force = 101 kg * 9.81 m/s² = 990.81 N
  • Target Spring Rate = 990.81 N / (65 mm * 2.75) = 990.81 N / 178.75 mm ≈ 5.54 N/mm

Result: The recommended spring rate is approximately 5.54 N/mm. This rider would look for a coil spring around this value (e.g., 550 lbs/in after conversion, as 1 N/mm ≈ 5.71 lbs/in). This rate aims to provide adequate support and sag for aggressive trail riding without being overly harsh.

Example 2: Lighter Downhill Rider

A lighter downhill rider weighing 65 kg with full protective gear is riding a downhill bike weighing 18 kg. The shock has a 75 mm stroke and a leverage ratio of 2.4. The shock shaft diameter is 28.6 mm.

  • Inputs:
  • Rider Weight: 65 kg
  • Bike Weight: 18 kg
  • Shock Stroke: 75 mm
  • Leverage Ratio: 2.4
  • Shock Shaft Diameter: 28.6 mm

Calculation:

  • Total System Weight = 65 kg + 18 kg = 83 kg
  • Effective Spring Force = 83 kg * 9.81 m/s² = 814.23 N
  • Target Spring Rate = 814.23 N / (75 mm * 2.4) = 814.23 N / 180 mm ≈ 4.52 N/mm

Result: The recommended spring rate is approximately 4.52 N/mm. This rider would seek a spring around 4.5 N/mm (roughly 260 lbs/in). This lighter rate allows for better small bump sensitivity and ensures the suspension can compress sufficiently under the rider's weight, crucial for high-speed DH tracks.

How to Use This MTB Coil Spring Weight Calculator

Using our MTB coil spring weight calculator is straightforward. Follow these steps to find your ideal spring rate:

  1. Gather Your Information: You'll need accurate measurements for your rider weight (including gear), your bike's weight, your shock's stroke length, and your bike's suspension leverage ratio. The shock shaft diameter is also important for some shock designs, though less critical for basic spring rate calculation itself.
  2. Enter Rider Weight: Input your total rider weight, including any backpack, water, tools, and protective gear, into the "Rider Weight (incl. gear)" field in kilograms (kg).
  3. Enter Bike Weight: Input your bicycle's total weight in kilograms (kg). You can usually find this information from the manufacturer or by weighing your bike on a scale.
  4. Enter Shock Stroke: Find the stroke length of your rear shock in millimeters (mm). This is the total travel of the shock absorber. Check your shock's specifications.
  5. Select Shock Shaft Diameter: Choose the correct shaft diameter for your rear shock from the dropdown menu. This helps ensure compatibility and is sometimes noted by manufacturers.
  6. Enter Leverage Ratio: Input your bike's suspension leverage ratio. This is a crucial number specific to your bike's linkage design. Consult your bike manufacturer's website, owner's manual, or suspension kinematic calculators online. For example, a value like 2.7 means the rear wheel moves 2.7 times further than the shock shaft.
  7. Click Calculate: Press the "Calculate Spring Rate" button.

How to Read Results

The calculator will display:

  • Main Result (Recommended Coil Spring Rate): This is the primary output, shown in Newtons per millimeter (N/mm). This is the target stiffness for your coil spring. Many manufacturers also list springs in pounds per inch (lbs/in), so you may need to convert (1 N/mm ≈ 5.71 lbs/in).
  • Total System Weight: The sum of your rider and bike weight, converted to force using gravity.
  • Effective Spring Force: The total force the spring needs to exert to support your weight at rest.
  • Target Spring Rate (N/mm): The calculated ideal spring rate.

The accompanying table provides a summary of the inputs used. The chart visualizes how spring rate might change with rider weight.

Decision-Making Guidance

The calculated value is a starting point. Consider these factors:

  • Riding Style: Aggressive riders hitting jumps and drops might opt for a slightly stiffer spring (towards the higher end of the recommended range or slightly above) to prevent bottom-outs, while riders prioritizing traction and comfort might prefer a slightly softer spring (towards the lower end).
  • Personal Preference: Some riders simply prefer a firmer or plusher feel.
  • Shock and Frame Design: Different shock designs and suspension linkages can have unique characteristics that might warrant slight deviations from the calculated value.
  • Spring Manufacturer Tolerances: Real-world springs can have slight manufacturing variances.

Always start with the calculated value, test ride, and make small adjustments (e.g., +/- one spring increment) if necessary.

Key Factors That Affect MTB Coil Spring Rate Results

While the calculator provides a solid estimate, several factors can influence the ideal MTB coil spring weight and your overall suspension performance:

  1. Leverage Ratio (LR) Variation: The LR is rarely constant throughout the suspension stroke. Bikes with complex, progressive, or regressive leverage curves will behave differently. A calculator often uses an average or a ratio at a specific sag point. If your bike's LR is highly progressive, you might need a slightly softer spring than calculated to achieve the same sag percentage. For precise tuning, refer to your bike's kinematic data.
  2. Rider Weight Fluctuations: Seasonal weight changes or differences in gear load (e.g., carrying more water on hot days) mean your ideal spring rate might not be static. Re-calculating periodically is wise.
  3. Riding Discipline & Terrain: Downhill requires robust suspension for massive impacts, often favoring firmer springs. Enduro and trail riding demand a balance between support for pedaling and plushness for descents, potentially leading to softer rates.
  4. Suspension Damping Settings: The spring rate determines how the suspension compresses under load. Damping controls the *speed* of compression and rebound. Incorrect damping can make even the correctly sprung suspension feel harsh or uncontrolled. Ensure your rebound and compression settings complement your spring rate.
  5. Spring Progression/Design: Some coil springs have built-in progression (they get stiffer as they compress further), while others are purely linear. Aftermarket springs may offer different characteristics. The calculator assumes a mostly linear spring.
  6. Shock Body and Air Volume Spacers: While primarily affecting air shocks, some coil shock designs incorporate internal damping or mechanisms that can influence overall spring feel. Air volume spacers (less common on coil shocks but conceptually similar to bottom-out ramps) can affect end-stroke ramp-up.
  7. Rider Technique: How a rider uses their body weight and pumps the terrain can significantly impact how suspension is loaded. Advanced riders might manage suspension forces differently.
  8. Tire Pressure and Casing: Tire pressure and construction act as a secondary suspension system. Lower pressures and supple casings can absorb smaller impacts, potentially allowing for slightly firmer suspension settings without sacrificing comfort.

Frequently Asked Questions (FAQ)

Q1: What's the difference between lbs/in and N/mm for spring rates?

Lbs/in (pounds per inch) is a common unit used by many suspension manufacturers, especially in North America. N/mm (Newtons per millimeter) is the metric standard. The conversion is approximately 1 N/mm = 5.71 lbs/in. Our calculator provides N/mm, but you can easily convert it for purchasing springs.

Q2: My bike came with an air shock, can I use a coil spring calculator?

Yes, if you are considering converting your air shock to a coil shock, or if your bike is designed to accept either. The calculator helps determine the equivalent coil spring rate needed to achieve similar sag percentages as your air shock. However, air shocks offer adjustable progression, which coils do not inherently provide without aftermarket modifications.

Q3: How do I find my bike's leverage ratio?

This is crucial information. Check your bike manufacturer's website (look for suspension kinematics data), your bike's owner's manual, or search online forums dedicated to your specific bike model. Sometimes, suspension tuners or specialized websites provide this data.

Q4: What is "sag" and why is it important?

Sag is the amount the suspension compresses under your static riding weight (rider + gear on the bike). Typically, 20-33% sag is recommended for mountain bikes. It ensures the suspension is active and ready to absorb bumps, providing traction and control. Too little sag (too stiff a spring) means the suspension can't work effectively; too much sag (too soft a spring) leads to poor support, wallowing, and potential bottom-outs.

Q5: Can I use a spring that's slightly different from the calculated rate?

Yes, the calculated value is a guideline. Springs are often available in increments (e.g., every 25 lbs/in or 4-5 N/mm). If your calculated value falls between two available spring rates, consider your riding style. Aggressive riders might choose the stiffer option, while smoother riders might prefer the softer one. Always start close to the calculated value.

Q6: Does shock shaft diameter affect the spring rate calculation?

Directly, the shaft diameter itself doesn't enter the primary force/rate calculation (which relies on stroke and LR). However, it's an important spec for shock compatibility and can influence the *volume* of the air spring chamber in air shocks, or internal damping characteristics. For coil shocks, it's more about ensuring you have the correct physical fit and type of shock for which the leverage ratio was determined.

Q7: What if I ride very differently from the examples?

The examples illustrate common scenarios. Adjust based on your specific needs: If you ride more downhill and are heavier, you'll likely need a higher rate. If you're a lighter rider focused on climbing efficiency with minimal DH use, a lower rate might suffice. The calculator provides the mathematical basis; your experience and preferences refine the choice.

Q8: How often should I check my spring rate?

You should re-evaluate your spring rate if you make significant changes to your weight (gain or lose substantial pounds), change your riding gear drastically (e.g., adding a large hydration pack), switch to a different bike with a different leverage ratio, or if you're consistently experiencing bottom-outs or feel the suspension is too harsh despite correct damping settings.

Related Tools and Internal Resources

function validateInput(id, min, max) { var input = document.getElementById(id); var errorElement = document.getElementById(id + "Error"); var value = parseFloat(input.value); if (isNaN(value) || input.value.trim() === "") { errorElement.textContent = "This field is required."; errorElement.style.display = "block"; return false; } if (value max) { errorElement.textContent = "Value cannot exceed " + max + "."; errorElement.style.display = "block"; return false; } errorElement.textContent = ""; errorElement.style.display = "none"; return true; } function updateChart(riderWeight, springRate) { var canvas = document.getElementById('springRateChart'); if (!canvas) return; var ctx = canvas.getContext('2d'); // Clear previous chart ctx.clearRect(0, 0, canvas.width, canvas.height); var dataPoints = []; var baseRiderWeight = parseFloat(document.getElementById('riderWeight').value) || 75; var baseBikeWeight = parseFloat(document.getElementById('bikeWeight').value) || 15; var baseShockStroke = parseFloat(document.getElementById('shockStroke').value) || 65; var baseLeverageRatio = parseFloat(document.getElementById('leverageRatio').value) || 2.75; // Generate data points for a range of rider weights var weights = [50, 60, 70, 80, 90, 100, 110, 120]; for (var i = 0; i p.x)); var maxWeight = Math.max(…dataPoints.map(p => p.x)); var minRate = Math.min(…dataPoints.map(p => p.y)); var maxRate = Math.max(…dataPoints.map(p => p.y)); // Add some buffer to the axes minRate = Math.max(0, minRate * 0.9); maxRate = maxRate * 1.1; minWeight = Math.max(0, minWeight * 0.9); maxWeight = maxWeight * 1.1; // Function to scale X coordinate var scaleX = function(value) { return padding + (value – minWeight) / (maxWeight – minWeight) * (chartWidth – 2 * padding); }; // Function to scale Y coordinate var scaleY = function(value) { return chartHeight – padding – (value – minRate) / (maxRate – minRate) * (chartHeight – 2 * padding); }; // Draw axes ctx.strokeStyle = '#cccccc'; ctx.lineWidth = 1; ctx.font = '12px Segoe UI'; ctx.fillStyle = '#555555'; // X-axis ctx.beginPath(); ctx.moveTo(padding, chartHeight – padding); ctx.lineTo(chartWidth – padding, chartHeight – padding); ctx.stroke(); ctx.fillText('Rider Weight (kg)', (chartWidth – padding) / 2, chartHeight – 5); // Y-axis ctx.beginPath(); ctx.moveTo(padding, padding); ctx.lineTo(padding, chartHeight – padding); ctx.stroke(); ctx.save(); ctx.translate(15, (chartHeight + padding) / 2); ctx.rotate(-Math.PI / 2); ctx.fillText('Spring Rate (N/mm)', 0, 0); ctx.restore(); // Draw X-axis labels and ticks weights.forEach(function(w) { var xPos = scaleX(w); ctx.beginPath(); ctx.moveTo(xPos, chartHeight – padding – 5); ctx.lineTo(xPos, chartHeight – padding + 5); ctx.stroke(); ctx.textAlign = 'center'; ctx.fillText(w.toString(), xPos, chartHeight – padding + 18); }); // Add Y-axis labels and ticks (e.g., 2-4 points) var rateTicks = [minRate, minRate + (maxRate – minRate) / 2, maxRate]; if (maxRate – minRate > 1) { // Ensure we have at least 3 distinct points if range is large enough rateTicks.push(minRate + (maxRate – minRate) / 4); rateTicks.push(minRate + 3*(maxRate – minRate) / 4); } rateTicks.sort(function(a,b){ return a-b; }); var uniqueRateTicks = []; rateTicks.forEach(function(tick){ if (uniqueRateTicks.length === 0 || Math.abs(tick – uniqueRateTicks[uniqueRateTicks.length – 1]) > (maxRate – minRate) * 0.05) { // Avoid clustering ticks uniqueRateTicks.push(tick); } }); uniqueRateTicks.forEach(function(rate) { var yPos = scaleY(rate); ctx.beginPath(); ctx.moveTo(padding – 5, yPos); ctx.lineTo(padding + 5, yPos); ctx.stroke(); ctx.textAlign = 'right'; ctx.fillText(rate.toFixed(1), padding – 10, yPos + 5); }); // Draw the data series ctx.strokeStyle = '#004a99'; ctx.lineWidth = 2; ctx.beginPath(); dataPoints.forEach(function(point, index) { var x = scaleX(point.x); var y = scaleY(point.y); if (index === 0) { ctx.moveTo(x, y); } else { ctx.lineTo(x, y); } }); ctx.stroke(); // Highlight the current rider's calculated point var currentRiderWeightVal = parseFloat(document.getElementById('riderWeight').value) || 75; var currentRateVal = parseFloat(document.getElementById('targetSpringRate').innerText); if (!isNaN(currentRiderWeightVal) && !isNaN(currentRateVal) && currentRiderWeightVal >= minWeight && currentRiderWeightVal = minRate && currentRateVal <= maxRate) { var currentX = scaleX(currentRiderWeightVal); var currentY = scaleY(currentRateVal); ctx.fillStyle = '#28a745'; ctx.beginPath(); ctx.arc(currentX, currentY, 6, 0, Math.PI * 2); ctx.fill(); } } function calculateSpringRate() { var isValid = true; isValid = validateInput('riderWeight', 0) && isValid; isValid = validateInput('bikeWeight', 0) && isValid; isValid = validateInput('shockStroke', 0) && isValid; isValid = validateInput('leverageRatio', 0) && isValid; if (!isValid) { document.getElementById('result-container').classList.add('hidden'); return; } var riderWeight = parseFloat(document.getElementById('riderWeight').value); var bikeWeight = parseFloat(document.getElementById('bikeWeight').value); var shockStroke = parseFloat(document.getElementById('shockStroke').value); var shockShaftDiameter = parseFloat(document.getElementById('shockShaftDiameter').value); var leverageRatio = parseFloat(document.getElementById('leverageRatio').value); var gravity = 9.81; // m/s^2 var totalSystemWeightKg = riderWeight + bikeWeight; var effectiveSpringForceN = totalSystemWeightKg * gravity; var targetSpringRateNPerMM = effectiveSpringForceN / (shockStroke * leverageRatio); // Conversion to lbs/in (common in MTB) var nPerMmToLbsPerInch = 5.71; var targetSpringRateLbsPerInch = targetSpringRateNPerMM * nPerMmToLbsPerInch; var resultContainer = document.getElementById('result-container'); var mainResultElement = document.getElementById('main-result'); var totalSystemWeightElement = document.getElementById('totalSystemWeight'); var effectiveSpringForceElement = document.getElementById('effectiveSpringForce'); var targetSpringRateElement = document.getElementById('targetSpringRate'); // Update table document.getElementById('tableRiderWeight').textContent = riderWeight.toFixed(1); document.getElementById('tableBikeWeight').textContent = bikeWeight.toFixed(1); document.getElementById('tableShockStroke').textContent = shockStroke.toFixed(0); document.getElementById('tableShockShaftDiameter').textContent = shockShaftDiameter.toFixed(1); document.getElementById('tableLeverageRatio').textContent = leverageRatio.toFixed(2); // Display results mainResultElement.textContent = targetSpringRateNPerMM.toFixed(2) + " N/mm (" + targetSpringRateLbsPerInch.toFixed(0) + " lbs/in)"; totalSystemWeightElement.textContent = totalSystemWeightKg.toFixed(1) + " kg"; effectiveSpringForceElement.textContent = effectiveSpringForceN.toFixed(1) + " N"; targetSpringRateElement.textContent = targetSpringRateNPerMM.toFixed(2) + " N/mm"; resultContainer.classList.remove('hidden'); // Update chart updateChart(riderWeight, targetSpringRateNPerMM); } function resetCalculator() { document.getElementById('riderWeight').value = "80"; document.getElementById('bikeWeight').value = "16"; document.getElementById('shockStroke').value = "65"; document.getElementById('shockShaftDiameter').value = "25.4"; document.getElementById('leverageRatio').value = "2.75"; // Clear errors var errorElements = document.querySelectorAll('.error-message'); for (var i = 0; i < errorElements.length; i++) { errorElements[i].textContent = ""; errorElements[i].style.display = "none"; } document.getElementById('result-container').classList.add('hidden'); // Optionally, recalculate with default values or clear results // calculateSpringRate(); // Uncomment to recalculate on reset // Reset table to default/empty state or recalculate document.getElementById('tableRiderWeight').textContent = "–"; document.getElementById('tableBikeWeight').textContent = "–"; document.getElementById('tableShockStroke').textContent = "–"; document.getElementById('tableShockShaftDiameter').textContent = "–"; document.getElementById('tableLeverageRatio').textContent = "–"; // Reset chart to default view updateChart(80, (80 + 16) * 9.81 / (65 * 2.75)); // Recalculate with defaults } function copyResults() { var mainResultText = document.getElementById('main-result').innerText; var totalSystemWeightText = document.getElementById('totalSystemWeight').innerText; var effectiveSpringForceText = document.getElementById('effectiveSpringForce').innerText; var targetSpringRateText = document.getElementById('targetSpringRate').innerText; var tableRiderWeight = document.getElementById('tableRiderWeight').innerText; var tableBikeWeight = document.getElementById('tableBikeWeight').innerText; var tableShockStroke = document.getElementById('tableShockStroke').innerText; var tableShockShaftDiameter = document.getElementById('tableShockShaftDiameter').innerText; var tableLeverageRatio = document.getElementById('tableLeverageRatio').innerText; var copyText = "MTB Coil Spring Rate Calculation:\n\n"; copyText += "— Main Result —\n"; copyText += "Recommended Coil Spring Rate: " + mainResultText + "\n\n"; copyText += "— Intermediate Values —\n"; copyText += "Total System Weight: " + totalSystemWeightText + "\n"; copyText += "Effective Spring Force: " + effectiveSpringForceText + "\n"; copyText += "Target Spring Rate: " + targetSpringRateText + "\n\n"; copyText += "— Key Assumptions / Inputs —\n"; copyText += "Rider Weight (incl. gear): " + tableRiderWeight + " kg\n"; copyText += "Bike Weight: " + tableBikeWeight + " kg\n"; copyText += "Shock Stroke: " + tableShockStroke + " mm\n"; copyText += "Shock Shaft Diameter: " + tableShockShaftDiameter + " mm\n"; copyText += "Leverage Ratio: " + tableLeverageRatio + "\n"; navigator.clipboard.writeText(copyText).then(function() { // Success feedback (optional) var copyButton = document.querySelector('button.success'); var originalText = copyButton.innerText; copyButton.innerText = 'Copied!'; setTimeout(function() { copyButton.innerText = originalText; }, 1500); }).catch(function(err) { console.error('Failed to copy text: ', err); // Error feedback (optional) alert('Failed to copy results. Please copy manually.'); }); } // Initial calculation and chart render on page load window.onload = function() { // Set default values and calculate resetCalculator(); calculateSpringRate(); // Ensure calculation happens with defaults on load };

Leave a Comment