User Tools

Site Tools


Max RC copter loading

rcmax.go
package main
 
import (
    "fmt"
    "math"
)
 
func Grad2Rad(value float64) float64 {
    return (math.Pi / 180.0) * value
}
 
func main() {
 
    const chassisSpeed              float64 = 50        // kmh
    const chassisAngle              float64 = 30        // grad
    const thrustReductionFactor     float64 = 0.35
 
    const chassisWeight             float64 = 300       // g
    const initialBatteryWeight      float64 = 200       // g
    const initialBatteryCapacity    float64 = 3 * 0.9   // Ah per unit
 
    const initialTotalCurrent       float64 = 12        // A
    const horizonHoweringCurrent    float64 = 6         // A
    var   initialHoweringCurrent    float64 = horizonHoweringCurrent / math.Cos(Grad2Rad(chassisAngle))            // A
    var   initialMotionCurrent      float64 = initialTotalCurrent - initialHoweringCurrent    // A
 
    const endBatteryWeight          float64 = chassisWeight * 5 // g
    const maxCurrent                float64 = 20        // A
 
    initialTotalWeight := chassisWeight + initialBatteryWeight
 
    howeringCurrentPerWeight := initialHoweringCurrent / initialTotalWeight
    capacityPerWeight := initialBatteryCapacity / initialBatteryWeight
 
    for batteryWeight := initialBatteryWeight; batteryWeight < endBatteryWeight; batteryWeight += 50 {
        totalWeight         := chassisWeight + batteryWeight
        batteryCapacity     := batteryWeight * capacityPerWeight
 
        howeringCurrent     := totalWeight * howeringCurrentPerWeight
        totalCurrent        := howeringCurrent + initialMotionCurrent
 
        totalCurrentAntiReduction := thrustReductionFactor * (totalCurrent - initialTotalCurrent)
        howeringCurrentAntiReduction := thrustReductionFactor * (howeringCurrent - initialHoweringCurrent)
 
        totalCurrent = totalCurrent + totalCurrentAntiReduction
        howeringCurrent = howeringCurrent + howeringCurrentAntiReduction
 
        estimatedFlyingTime := (batteryCapacity / totalCurrent)
        estimatedFlyingDistance := estimatedFlyingTime * chassisSpeed
        totalThrottlePercent    := 100 * totalCurrent / maxCurrent
        howeringThrottlePercent := 100 * howeringCurrent / maxCurrent
 
        fmt.Printf("%4.0fg %5.0fmah  %3.1fA %4.1fmin %4.1fkm %3.0f%% %3.0f%%  %4.1fA\n",
                            batteryWeight,
                            batteryCapacity * 1000,
                            totalCurrent,
                            estimatedFlyingTime * 60,
                            estimatedFlyingDistance,
                            howeringThrottlePercent * math.Cos(Grad2Rad(chassisAngle)),
                            totalThrottlePercent,
                            howeringCurrent)
        if totalThrottlePercent > 100 {
            break
        }
    }
}
rcloading.m
#!/usr/bin/env octave -q
 
1;
 
function main
    chassisSpeed              = 50;        # kmh
    chassisAngle              = 30;        # grad
    thrustReductionFactor     = 0.35;
 
    chassisWeight             = 300;       # g
    initialBatteryWeight      = 200;       # g
    initialBatteryCapacity    = 2 * 0.9;   # Ah per unit
 
    initialTotalCurrent       = 12;        # A
    horizonHoweringCurrent    = 6;         # A
    initialHoweringCurrent    = horizonHoweringCurrent / cos(deg2rad(chassisAngle));  # A
    initialMotionCurrent      = initialTotalCurrent - initialHoweringCurrent;                # A
 
    endBatteryWeight          = chassisWeight * 5; # g
    maxCurrent                = 20;        # A
 
 
    initialTotalWeight = chassisWeight + initialBatteryWeight;
 
    howeringCurrentPerWeight = initialHoweringCurrent / initialTotalWeight;
    capacityPerWeight = initialBatteryCapacity / initialBatteryWeight;
 
    for batteryWeight = initialBatteryWeight:50:endBatteryWeight
        totalWeight         = chassisWeight + batteryWeight;
        batteryCapacity     = batteryWeight * capacityPerWeight;
 
        howeringCurrent     = totalWeight * howeringCurrentPerWeight;
        totalCurrent        = howeringCurrent + initialMotionCurrent;
 
        totalCurrentAntiReduction    = thrustReductionFactor * (totalCurrent - initialTotalCurrent);
        howeringCurrentAntiReduction = thrustReductionFactor * (howeringCurrent - initialHoweringCurrent);
 
        totalCurrent    = totalCurrent + totalCurrentAntiReduction;
        howeringCurrent = howeringCurrent + howeringCurrentAntiReduction;
 
        estimatedFlyingTime     = (batteryCapacity / totalCurrent);
        estimatedFlyingDistance = estimatedFlyingTime * chassisSpeed;
        totalThrottlePercent    = 100 * totalCurrent / maxCurrent;
        howeringThrottlePercent = 100 * howeringCurrent / maxCurrent;
 
        printf("%4.0fg %5.0fmah  %3.1fA %4.1fmin %4.1fkm %3.0f%% %3.0f%%  %4.1fA\n",
                            batteryWeight,
                            batteryCapacity * 1000,
                            totalCurrent,
                            estimatedFlyingTime * 60,
                            estimatedFlyingDistance,
                            howeringThrottlePercent * cos(deg2rad(chassisAngle)),
                            totalThrottlePercent,
                            howeringCurrent)
        if totalThrottlePercent > 100
            break
        end
 
    end
end
 
main()

Out for initialBatteryCapacity = 2 Ah

200g  1800mah  12.0A   9.0min   7.5km  30%  60%    6.93A
250g  2250mah  12.9A 10.4min   8.7km  34%  65%    7.86A
300g  2700mah  13.9A 11.7min   9.7km  38%  69%    8.80A
350g  3150mah  14.8A 12.8min 10.6km  42%  74%    9.73A
400g  3600mah  15.7A 13.7min 11.4km  46%  79%  10.67A
450g  4050mah  16.7A 14.6min 12.1km  50%  83%  11.60A
500g  4500mah  17.6A 15.3min 12.8km  54%  88%  12.54A
550g  4950mah  18.5A 16.0min 13.3km  58%  93%  13.48A
600g  5400mah  19.5A 16.6min 13.9km  62%  97%  14.41A
650g  5850mah  20.4A 17.2min 14.3km  66% 102%  15.35A

Out for initialBatteryCapacity = 3 Ah

200g  2700mah  12.0A 13.5min 11.2km  30%  60%    6.93A
250g  3375mah  12.9A 15.7min 13.0km  34%  65%    7.86A
300g  4050mah  13.9A 17.5min 14.6km  38%  69%    8.80A
350g  4725mah  14.8A 19.1min 16.0km  42%  74%    9.73A
400g  5400mah  15.7A 20.6min 17.2km  46%  79%  10.67A
450g  6075mah  16.7A 21.9min 18.2km  50%  83%  11.60A
500g  6750mah  17.6A 23.0min 19.2km  54%  88%  12.54A
550g  7425mah  18.5A 24.0min 20.0km  58%  93%  13.48A
600g  8100mah  19.5A 24.9min 20.8km  62%  97%  14.41A
650g  8775mah  20.4A 25.8min 21.5km  66% 102%  15.35A