Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2114 → Rev 2115

/branches/dongfang_FC_fixedwing/arduino_atmega328/README.txt
27,3 → 27,14
 
ADC6 Battery voltage divider
ADC7 Airspeed sensor
 
 
 
To do:
- Throttle shut off in both versions
- Check rc.h in both versions
- Implement servo limiter
 
Big Wing:
- Redundant supply with separate batt and Trojan BEC
- XBee
/branches/dongfang_FC_fixedwing/arduino_atmega328/rc.c
216,15 → 216,10
return SIGNAL_LOST;
}
 
/*
* To should fired only when the right stick is in the center position.
* This will cause the value of pitch and roll stick to be adjusted
* to zero (not just to near zero, as per the assumption in rc.c
* about the rc signal. I had values about 50..70 with a Futaba
* R617 receiver.) This calibration is not strictly necessary, but
* for control logic that depends on the exact (non)center position
* of a stick, it may be useful.
*/
void RC_calibrate(void) {
// Do nothing.
}
 
int16_t RC_getZeroThrottle() {
return TIME (-0.5);
}
/branches/dongfang_FC_fixedwing/controlMixer.c
8,7 → 8,8
#include "commands.h"
#include "output.h"
 
int16_t controls[4] = { 0, 0, 0, 0 };
// The -1024 is an arbrtrary, very low value that will shut off the motor. This is default until the control mixer runs for the first time.
int16_t controls[4] = { 0, 0, 0, -1024 };
 
// Internal variables for reading commands made with an R/C stick.
uint8_t lastCommand = COMMAND_NONE;
107,7 → 108,7
*/
 
void controlMixer_periodicTask(void) {
int16_t tempPRYT[4] = { 0, 0, 0, 0 };
int16_t tempPRYT[4] = { 0, 0, 0, RC_getZeroThrottle()};
 
// Decode commands.
uint8_t rcCommand = (RC_getSignalQuality() >= SIGNAL_OK) ? RC_getCommand() : COMMAND_NONE;
/branches/dongfang_FC_fixedwing/rc.c
16,6 → 16,7
uint8_t lastFlightMode = FLIGHT_MODE_NONE;
 
#define TIME(s) ((int16_t)(((long)F_CPU/(long)8000)*(float)s))
 
/***************************************************************
* 16bit timer 1 is used to decode the PPM-Signal
***************************************************************/
227,15 → 228,10
return SIGNAL_LOST;
}
 
/*
* To should fired only when the right stick is in the center position.
* This will cause the value of pitch and roll stick to be adjusted
* to zero (not just to near zero, as per the assumption in rc.c
* about the rc signal. I had values about 50..70 with a Futaba
* R617 receiver.) This calibration is not strictly necessary, but
* for control logic that depends on the exact (non)center position
* of a stick, it may be useful.
*/
void RC_calibrate(void) {
// Do nothing.
}
 
int16_t RC_getZeroThrottle() {
return TIME (-0.5);
}