Documentation sections
Battery Runtime (Motor Load)
POSThttps://rftools.io/ api/ py/ v1/ calculate
Slug battery-runtime-motor. Calculate battery runtime for motor-driven systems accounting for motor current draw, efficiency, and depth of discharge.
Inputs
Send every one of these in inputs, in the units shown. Most are required: a call without one is refused (400) and costs nothing; one the calculator can do without takes the default shown. An input outside its range is still computed and flagged in the provenance.
| Name | Unit | Range | Default | Description |
|---|---|---|---|---|
| batteryCapacityMahnumber | mAh | at least 1 | 2000 | Battery Capacity |
| batteryVoltagenumber | V | at least 0.5 | 3.7 | Battery Voltage |
| motorCurrentAnumber | A | at least 0.001 | 0.5 | Motor Current (avg) |
| efficiencynumber | % | 10 … 100 | 85 | Motor driver + motor combined efficiency |
| depthOfDischargenumber | % | 1 … 100 | 80 | Depth of Discharge |
| motorDutynumber | % | 1 … 100 | 100 | Share of the time the motor runs at its average current. 100% = continuous. |
| numLoadsnumber | none | 0 … 5 | 0 | Loads on the battery beside the motor: more motors, servos, a controller board (0–5) |
| load1Currentnumber | A | 0 … 100 | 0.5 | Average current additional load 1 draws while on, referred to the battery voltage |
| load1Dutynumber | % | 0 … 100 | 100 | Share of the time additional load 1 is on |
| load1Efficiencynumber | % | 10 … 100 | 85 | Efficiency of the drive or converter between the battery and additional load 1 |
| load2Currentnumber | A | 0 … 100 | 0.5 | Average current additional load 2 draws while on, referred to the battery voltage |
| load2Dutynumber | % | 0 … 100 | 100 | Share of the time additional load 2 is on |
| load2Efficiencynumber | % | 10 … 100 | 85 | Efficiency of the drive or converter between the battery and additional load 2 |
| load3Currentnumber | A | 0 … 100 | 0.5 | Average current additional load 3 draws while on, referred to the battery voltage |
| load3Dutynumber | % | 0 … 100 | 100 | Share of the time additional load 3 is on |
| load3Efficiencynumber | % | 10 … 100 | 85 | Efficiency of the drive or converter between the battery and additional load 3 |
| load4Currentnumber | A | 0 … 100 | 0.5 | Average current additional load 4 draws while on, referred to the battery voltage |
| load4Dutynumber | % | 0 … 100 | 100 | Share of the time additional load 4 is on |
| load4Efficiencynumber | % | 10 … 100 | 85 | Efficiency of the drive or converter between the battery and additional load 4 |
| load5Currentnumber | A | 0 … 100 | 0.5 | Average current additional load 5 draws while on, referred to the battery voltage |
| load5Dutynumber | % | 0 … 100 | 100 | Share of the time additional load 5 is on |
| load5Efficiencynumber | % | 10 … 100 | 85 | Efficiency of the drive or converter between the battery and additional load 5 |
Outputs
Returned in values, by key. A value that is unbounded or undefined is null.
| Field | Unit | Description |
|---|---|---|
| runtimeHoursheadline | h | Runtime |
| runtimeMinutes | min | Runtime |
| usableCapacityMah | mAh | Usable Capacity |
| energyWh | Wh | Battery Energy (est.) |
| batteryCurrent | A | Average current drawn from the battery: each load’s current × duty cycle ÷ its efficiency, summed |
Calling it
- Calculate: one call, the request and response in full, and its errors.
- Batch: this calculator with others, or a sweep, in one request.
- Solve for a target: the value of one input that brings an output to a target.