Skip to content

Commit 49a072f

Browse files
committed
add fritzing diagrams
1 parent 2dab966 commit 49a072f

File tree

10 files changed

+27
-9
lines changed

10 files changed

+27
-9
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
# ServoFlappingControl
22
This Arduino sketch is the servo controller for an RC ornithopter (Flapping MAV) powered and controlled by two servos. Each servo is connected to a wing and flapped independently.
33

4+
## How it works
45
The program is designed to receive 4 PWM inputs from an RC receiver operating in [MODE 2](https://www.rc-airplane-world.com/rc-transmitter-modes.html) and outputs 4 PWM signals for off-the-shelft hobby servos. Two servos control the wings and two servos control a V-tail. The aileron (1) and elevator (2) channels are used to modify the motion of the wings and to control the tail. The dihedral angle of the wings is altered in unison with elevator, while the aileron rotates them in opposite directions. Simultaneously, the frequency of the wing-oscillation can be modulated, such that the wings move faster during the downstroke or during the uptroke. Depending on whether this is done symmetrically or assymetrically, one can obtain pitch or roll control.
56

6-
<img src = "img/triangle-fmod.png" width = "70%">
7+
<p align="center">
8+
<img src = "/images/plot/triangle-fmod.png" width = "70%">
9+
</p>
710

811
The throttle channel (3) control the amplitude of a fixed-frequency oscillation. By the default, the waveform is a triangle-wave, but the throttle can also be used to trucante the wave so it looks more like a square wave. Using a square wave allows the servo to output more mechanical power, but the transition between strokes is abrupt. The truncated-wave eases this transition.
912

10-
<img src = "img/triangle-truncation.png" width = "70%">
13+
<p align="center">
14+
<img src = "/images/plot/triangle-truncation.png" width = "70%">
15+
</p>
1116

1217
Lastly, rudder channel (4) is used to assymetrically vary the amplitude of the wings. While the program was written for an Arduino Nano but it should be compatible with other boards. See the attached schematic for an example of the required circuit:
1318

14-
<img src = "img/schematic.png" width = "80%">
19+
## Schematics
20+
__Nano__:
1521

22+
<p align="center">
23+
<img src = "images/diagrams/nano/schematic-nano.png" width = "80%">
24+
</p>
25+
26+
__ATTiny__:
27+
28+
<p align="center">
29+
<img src = "images/diagrams/nano/schematic-attiny.png" width = "80%">
30+
</p>
31+
32+
33+
## Example
1634
See this video to watch the controller in operation: [servo controller](https://youtu.be/T6NfZD_iuEs)

controller-nano/controller-nano.ino

100755100644
File mode changed.

controller-nano/parameters.cpp

100755100644
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* CONSTANT | VALUE | UNIT | DESCRIPTION */
22
/*=========================================================*/
33
// 1. Flapping waveform
4-
#define FREQ 2.8 // hz // Wingbeat frequency [hz]. Use lowest frequency that achieves flight
5-
#define GAIN_WAVE 12.0 /* Triangle wave to square wave gain (truncation).
4+
#define FREQ 3.1 // hz // Wingbeat frequency [hz]. Use lowest frequency that achieves flight
5+
#define GAIN_WAVE 6.0 /* Triangle wave to square wave gain (truncation).
66
A larger gain makes the waveform become more square-like with more throttle */
77
// 2. Control inputs [negate to reverse direction]
88
// I. Base inputs:
@@ -18,14 +18,14 @@
1818
#define GAIN_ROLL_FM 0.0 // Roll: One wing falls faster than the other
1919

2020
// 3. Servo trims
21-
#define TRIM_LEFT 0 // us // left wing
22-
#define TRIM_RIGHT -60 // us // right wing
21+
#define TRIM_LEFT -80 // us // left wing
22+
#define TRIM_RIGHT 50 // us // right wing
2323
#define TRIM_TLEFT 0 // us // left tail
2424
#define TRIM_TRIGHT 50 // us // right tail
2525

2626
// 4. Pitching moment correction
27-
#define PITCH_TRIM_X 200 // us // Throttle PWM when trim reaches maximum value
28-
#define PITCH_TRIM_Y -350 // us // Maximum pitch trim. Negate to reverse deflection
27+
#define PITCH_TRIM_X 250 // us // Throttle PWM when trim reaches maximum value
28+
#define PITCH_TRIM_Y -35 v0 // us // Maximum pitch trim. Negate to reverse deflection
2929

3030
// 5. Low voltage cutoff [voltage divider]
3131
#define RESISTOR_1 67000 // ohm // Resistor from ground -> middle
8.02 KB
Binary file not shown.
51.6 KB
Loading
9.37 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)