Subversion Repositories FlightCtrl

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2059 - 1
Dongfang FC Rewrite
2
 
3
Goal: A neat, modular, analysable, reliable and easily extendable code base for Mikrokopter FC and later NC.
4
Experience and good design ideas from the original code are reused.
5
The project is personal. Only the parts that were of immediate use for myself were included.
6
The feature set is smaller than that of the original code, but the addition of features is much easier. It is more of a developer's firmware than a consumer's.
7
 
8
Features:
9
- Will run as compiled with any AVR-GCC version.
10
- Will run with any hardware version, and easily adapt to nonstandard hardware. Will run with or without ACC sensor, and with sensors in any orientation.
11
- Will run without a bootloader.
12
- The fc.c code monster has been killed and cut up. Global variables have been kept at a minimum. Abstractions are used where they should be.
13
- Controls have been abstracted and separated. RC, navigation, serial control, failsafe flight etc. are all in separate modules.
14
- NaviCtrl is not yet implemented (the strategy will probably be: First integrate to existing NaviCtrl code, then rewrite that as well). For simple requirements, navigation by directly connected GPS is possible.
15
 
16
 
17
Configuration and diags tool
18
 
19
Description of modules
20
 
21
ControlMixer:
22
The control mixer makes a composite control vector of four virtual RC sticks, based on the output of all features exercising control on the flight. The logic to mix the inputs is kept simple and free from side effects.
23
The component inputs include: RC, serial control, navigation, height control, compass-fixed heading control and failsafe emergency flight.
24
 
25
Commands:
26
Commands by RC stick gestures (calibrate, select parameterset, start and stop motors) have been abstracted into this module. Ultimately, serial control should also have commands capabilities.
27
 
28
Attitude:
29
All code related to determining the flight attitude of the MK (as opposed to determining control input and output) has been placed here. This relies heavily on data from the analog module.
30
Gyroscope calibration data is storen in EEPROM like accelerometer calibration data. There is thus no need to calibrate before each flight.
31
 
32
Flight:
33
This module calculates the motor output vector based on data from the attitude module, and composite stick input from the controlMixer module. This is the functionality fc.c minus all the things that were moved away.
34
 
35
Output:
36
The two LED outputs on the FC have a more advanced control and can be used as debugging signals etc.
37
 
38
 
39
Parameterset changes:
40
- The RC channel mapping is global and accessed through new serial commands.
41
- Gyro and accelerometer sensor attitudes added. These will also be made global at a later time.
42
- The parameter sets are incompatible with all MK-Tool versions and the dongfang tool must be used instead. The tool will currently only read and write to an XML paramerset format, but that is easy to overview, read, compare and write.
43