RCmags / GlideLock

:bird: Glide lock of an RC ornithopter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Glide Lock for a radio-controlled ornithopter 🐦

This Arduino sketch is the glide lock for a crank-driven ornithopter. It's meant to stop the wings at a small dihedral angle when the motor is turned off.

How it works

The system works by iddling the motor below a certain throttle until the crankshaft reaches a known position. The position of the rotor is measured using a hall sensor and a magnet attached to the crank shaft. When the magnet passes in front of the sensor, the motor turns off. However, the motor will continue to spin even after the throttle is set to zero. To work around this, one can continue to spin the motor for a short time interval after the magnet passes the sensor. If this delay is tuned correctly, the crank will stop in more or less the desired position.

Schematics

Arduino nano:

The code can accommodate either an analog or digital hall sensor as both use the same circuit.

DigiSpark ATTiny85:

Due to some odd behaviour, the input pin for the hall sensor has to change depending on whether it is analog or digital. Use P0 for digital and P4 for analog.

Dependencies

The ATTiny code requires ATTinyCore to compile.

Example

See: Video explaining the Glide Lock and how it operates

About

:bird: Glide lock of an RC ornithopter


Languages

Language:C++ 100.0%