This commit is contained in:
Stavros Korokithakis 2021-07-06 01:48:34 +03:00
parent 6db5f4f20f
commit b41f190bb6
No known key found for this signature in database
GPG Key ID: 26EA345ECD4C2A63
6 changed files with 101 additions and 6 deletions

View File

@ -9,7 +9,7 @@ insert_anchor_links = "right"
Click on a link in the list below to go to that page:
1. [A simple guide to PID control](../../drone-stuff/a-simple-guide-to-pid-control)
1. [Ardupilot setup checklist](../../drone-stuff/ardupilot-setup-checklist)
1. [ArduPilot setup checklist](../../drone-stuff/ardupilot-setup-checklist)
1. [E6000 hinges](../../drone-stuff/e6000-hinges)
1. [FPV frequency chart](../../drone-stuff/fpv-frequency-chart)
1. [General RC tips](../../drone-stuff/general-rc-tips)
@ -20,5 +20,6 @@ Click on a link in the list below to go to that page:
1. [Omnibus F4 V3 pinout](../../drone-stuff/omnibus-f4-v3-pinout)
1. [Omnibus F4 pro servo diode](../../drone-stuff/omnibus-f4-pro-servo-diode)
1. [QGroundControl to Mission Planner conversion script](../../drone-stuff/qgroundcontrol-to-mission-planner-conversion-script)
1. [TECS tuning calculator](../../drone-stuff/tecs-tuning-calculator)
1. [Transmitter external module pinout](../../drone-stuff/transmitter-external-module-pinout)
1. [Transportable C1 Chaser](../../drone-stuff/transportable-c1-chaser)

View File

@ -1,5 +1,5 @@
+++
title = "Ardupilot setup checklist"
title = "ArduPilot setup checklist"
weight = 2
sort_by = "weight"
insert_anchor_links = "right"
@ -203,6 +203,8 @@ You're done with this step.
After you have the above measurements, you're ready to tune things.
You can either do things manually (below), or use the [TECS tuning calculator](../../drone-stuff/tecs-tuning-calculator) to get the appropriate parameters automatically.
For the level flight measurements:
- [ ] Set `TRIM_ARSPD_CM` (cm/s) to your "comfortable cruise speed".
@ -266,6 +268,6 @@ _(Many thanks to Michel Pastor for his help with everything in this note.)_
* * *
<p style="font-size:80%; font-style: italic">
Last updated on June 22, 2021. For any questions/feedback,
Last updated on July 06, 2021. For any questions/feedback,
email me at <a href="mailto:hi@stavros.io">hi@stavros.io</a>.
</p>

View File

@ -0,0 +1,90 @@
+++
title = "TECS tuning calculator"
weight = 13
sort_by = "weight"
insert_anchor_links = "right"
+++
To use this calculator, first follow the steps in the [TECS tuning section](../../drone-stuff/ardupilot-setup-checklist#tuning-the-tecs) of the ArduPilot setup checklist.
<script>
function kmhToMs(kmh) { return Math.round(kmh / 3.6); }
function kmhToCms(kmh) { return Math.round(kmh / 0.036); }
function calculateParameters(event) {
var cruiseSpeed = Number(document.getElementById("cruiseSpeed").value);
var cruiseThrottle = Number(document.getElementById("cruiseThrottle").value);
var maxSpeed = Number(document.getElementById("maxSpeed").value);
var maxThrottle = Number(document.getElementById("maxThrottle").value);
var stallSpeed = Number(document.getElementById("stallSpeed").value);
var downPitch = Number(document.getElementById("downPitch").value);
var upPitch = Number(document.getElementById("upPitch").value);
var upSpeed = Number(document.getElementById("upSpeed").value);
var downSpeed = Number(document.getElementById("downSpeed").value);
var downMorePitch = Number(document.getElementById("downMorePitch").value);
var downMoreSpeed = Number(document.getElementById("downMoreSpeed").value);
var output = document.getElementById("parachuteCommand");
output.textContent = ("parachute set"
+ " \\\n TRIM_ARSPD_CM=" + kmhToCms(cruiseSpeed)
+ " \\\n TRIM_THROTTLE=" + cruiseThrottle
+ " \\\n THR_MAX=" + maxThrottle
+ " \\\n ARSPD_FBW_MAX=" + kmhToMs(maxSpeed * 0.95)
+ " \\\n ARSPD_FBW_MIN=" + kmhToMs(stallSpeed * 1.05)
+ " \\\n STAB_PITCH_DOWN=" + downPitch
+ " \\\n TECS_PITCH_MIN=-" + downMorePitch
+ " \\\n TECS_PITCH_MAX=" + upPitch
+ " \\\n TECS_CLMB_MAX=" + upSpeed
+ " \\\n TECS_SINK_MIN=" + downSpeed
+ " \\\n TECS_SINK_MAX=" + downMoreSpeed
+ " \\\n FBWB_CLIMB_RATE=" + upSpeed
+ " \\\n LIM_PITCH_MAX=" + Math.round(upPitch * 1.2)
+ " \\\n LIM_PITCH_MIN=-" + Math.round(downMorePitch * 1.2)
);
}
</script>
<form onsubmit="calculateParameters(event); return false">
<h2>Fly straight</h2>
<p><label>Cruise speed (km/h): <input type="number" min="0" id="cruiseSpeed" /></label></p>
<p><label>Cruise throttle percentage (%): <input type="number" min="0" max="100" id="cruiseThrottle" /></label></p>
<p><label>Maximum speed (km/h): <input type="number" min="0" id="maxSpeed" /></label></p>
<p><label>Maximum throttle (%): <input type="number" min="0" max="100" id="maxThrottle" /></label></p>
<p><label>Slowest speed (km/h): <input type="number" min="0" id="stallSpeed" /></label></p>
<p><label>Down pitch (deg): <input type="number" min="0" max="90" id="downPitch" /></label></p>
<h2>Fly up</h2>
<p><label>Up pitch (deg): <input type="number" min="0" max="90" id="upPitch" /></label></p>
<p><label>Up speed (m/s): <input type="number" min="0" id="upSpeed" /></label></p>
<h2>Fly down</h2>
<p><label>Down speed (m/s): <input type="number" min="0" id="downSpeed" /></label></p>
<h2>Fly down more</h2>
<p><label>Down more pitch (deg): <input type="number" min="0" max="90" id="downMorePitch" /></label></p>
<p><label>Down more speed (m/s): <input type="number" min="0" id="downMoreSpeed" /></label></p>
<p>
<button type="submit">Calculate parameters</button>
</p>
<p>
Run this command in a terminal, making sure you have [Parachute](https://gitlab.com/stavros/parachute) installed:
<code>
<pre id="parachuteCommand">
(Please fill out the values above first)
</pre>
</code>
</p>
</form>
* * *
<p style="font-size:80%; font-style: italic">
Last updated on July 06, 2021. For any questions/feedback,
email me at <a href="mailto:hi@stavros.io">hi@stavros.io</a>.
</p>

View File

@ -1,6 +1,6 @@
+++
title = "Transmitter external module pinout"
weight = 13
weight = 14
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -1,6 +1,6 @@
+++
title = "Transportable C1 Chaser"
weight = 14
weight = 15
sort_by = "weight"
insert_anchor_links = "right"
+++

View File

@ -91,9 +91,11 @@ class JoplinExporter:
new_url = self.get_resource_url_by_id(item_id)
if not new_url:
new_url = item_id
if match.group(2):
new_url += match.group(2)
return f"](../../{new_url})"
return re.sub(r"\]\(:/([a-f0-9]{32})\)", replacement, note.body)
return re.sub(r"\]\(:/([a-f0-9]{32})(#.*?)?\)", replacement, note.body)
def get_note_url_by_id(self, note_id: str) -> Optional[str]:
"""Return a note's relative URL by its ID."""