Bobby
unread,Oct 9, 2011, 7:18:34 AM10/9/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to uavdevboard
I've recently baught acouple of UDB3 development boards with MEDIATEK
GPS and programmed them with my options.h that reads like this:
#define BOARD_TYPE UDB3_BOARD
#define CLOCK_CONFIG FRC8X_CLOCK
#define BOARD_ORIENTATION ORIENTATION_FORWARDS
#define AIRFRAME_TYPE AIRFRAME_STANDARD
#define GPS_TYPE GPS_MTEK
#define ROLL_STABILIZATION_AILERONS 1
#define ROLL_STABILIZATION_RUDDER 1
#define PITCH_STABILIZATION 1
#define YAW_STABILIZATION_RUDDER 1
#define YAW_STABILIZATION_AILERON 1
#define AILERON_NAVIGATION 1
#define RUDDER_NAVIGATION 1
#define WIND_GAIN_ADJUSTMENT 1
#define ALTITUDEHOLD_STABILIZED AH_FULL
#define ALTITUDEHOLD_WAYPOINT AH_FULL
#define SPEED_CONTROL 0
#define DESIRED_SPEED 10.00 // meters/second
#define INVERTED_FLIGHT_STABILIZED_MODE 1
#define INVERTED_FLIGHT_WAYPOINT_MODE 1
#define HOVERING_STABILIZED_MODE 0
#define HOVERING_WAYPOINT_MODE 0
#define USE_CAMERA_STABILIZATION 0
#define MAG_YAW_DRIFT 0
#define RACING_MODE 0
#define RACING_MODE_WP_THROTTLE 1.0
#define NORADIO 0
#define USE_PPM_INPUT 0
#define PPM_NUMBER_OF_CHANNELS 8
#define PPM_SIGNAL_INVERTED 0
#define PPM_ALT_OUTPUT_PINS 0
#define NUM_INPUTS 4
#define THROTTLE_INPUT_CHANNEL CHANNEL_4
#define AILERON_INPUT_CHANNEL CHANNEL_1
#define ELEVATOR_INPUT_CHANNEL CHANNEL_2
#define RUDDER_INPUT_CHANNEL CHANNEL_3
#define MODE_SWITCH_INPUT_CHANNEL CHANNEL_UNUSED
#define CAMERA_PITCH_INPUT_CHANNEL CHANNEL_UNUSED
#define CAMERA_YAW_INPUT_CHANNEL CHANNEL_UNUSED
#define OSD_MODE_SWITCH_INPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_A_INPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_B_INPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_C_INPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_D_INPUT_CHANNEL CHANNEL_UNUSED
#define NUM_OUTPUTS 3
#define THROTTLE_OUTPUT_CHANNEL CHANNEL_3
#define AILERON_OUTPUT_CHANNEL CHANNEL_1
#define ELEVATOR_OUTPUT_CHANNEL CHANNEL_2
#define RUDDER_OUTPUT_CHANNEL CHANNEL_UNUSED
#define AILERON_SECONDARY_OUTPUT_CHANNEL CHANNEL_UNUSED
#define CAMERA_PITCH_OUTPUT_CHANNEL CHANNEL_UNUSED
#define CAMERA_YAW_OUTPUT_CHANNEL CHANNEL_UNUSED
#define TRIGGER_OUTPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_A_OUTPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_B_OUTPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_C_OUTPUT_CHANNEL CHANNEL_UNUSED
#define PASSTHROUGH_D_OUTPUT_CHANNEL CHANNEL_UNUSED
#define AILERON_CHANNEL_REVERSED HW_SWITCH_1
#define ELEVATOR_CHANNEL_REVERSED HW_SWITCH_2
#define RUDDER_CHANNEL_REVERSED HW_SWITCH_3
#define AILERON_SECONDARY_CHANNEL_REVERSED 0 // Hardcoded to be
unreversed, since we have only 3 switches.
#define THROTTLE_CHANNEL_REVERSED 0 // Set to 1 to hardcode a
channel to be reversed
#define CAMERA_ROLL_CHANNEL_REVERSED 0
#define CAMERA_PITCH_CHANNEL_REVERSED 0
#define CAMERA_YAW_CHANNEL_REVERSED 0
#define ELEVON_VTAIL_SURFACES_REVERSED 0
#define MODE_SWITCH_THRESHOLD_LOW 2600
#define MODE_SWITCH_THRESHOLD_HIGH 3400
#define FAILSAFE_INPUT_CHANNEL THROTTLE_INPUT_CHANNEL
#define FAILSAFE_INPUT_MIN 1500
#define FAILSAFE_INPUT_MAX 4500
#define FAILSAFE_TYPE FAILSAFE_MAIN_FLIGHTPLAN
#define FAILSAFE_HOLD 0
#define SERIAL_OUTPUT_FORMAT SERIAL_NONE
#define USE_OSD 0
#define TRIGGER_TYPE TRIGGER_TYPE_NONE
#define TRIGGER_ACTION TRIGGER_PULSE_HIGH
#define TRIGGER_SERVO_LOW 2000
#define TRIGGER_SERVO_HIGH 4000
#define TRIGGER_PULSE_DURATION 250
#define TRIGGER_REPEAT_PERIOD 4000
#define SERVOSAT 1.0
#define ROLLKP 0.20
#define ROLLKD 0.125
#define YAWKP_AILERON 0.10
#define YAWKD_AILERON 0.20
#define AILERON_BOOST 1.00
#define PITCHGAIN 0.25
#define PITCHKD 0.0625
#define RUDDER_ELEV_MIX 0.50
#define ROLL_ELEV_MIX 0.50
#define ELEVATOR_BOOST 0.50
#define INVERTED_NEUTRAL_PITCH 8.0
#define YAWKP_RUDDER 0.05
#define YAWKD_RUDDER 0.05
#define ROLLKP_RUDDER 0.06
#define MANUAL_AILERON_RUDDER_MIX 0.00
#define RUDDER_BOOST 1.00
#define HOVER_ROLLKP 0.05
#define HOVER_ROLLKD 0.05
#define HOVER_PITCHGAIN 0.2
#define HOVER_PITCHKD 0.25
#define HOVER_PITCH_OFFSET 0.0 // + leans towards top, - leans
towards bottom
#define HOVER_YAWKP 0.2
#define HOVER_YAWKD 0.25
#define HOVER_YAW_OFFSET 0.0
#define HOVER_PITCH_TOWARDS_WP 30.0
#define HOVER_NAV_MAX_PITCH_RADIUS 20
#define CAM_TAN_PITCH_IN_STABILIZED_MODE 1433
#define CAM_YAW_IN_STABILIZED_MODE 0
#define CAM_PITCH_SERVO_THROW 95
#define CAM_PITCH_SERVO_MAX 85
#define CAM_PITCH_SERVO_MIN -22
#define CAM_PITCH_OFFSET_CENTRED 38
#define CAM_YAW_SERVO_THROW 350
#define CAM_YAW_SERVO_MAX 130
#define CAM_YAW_SERVO_MIN -130
#define CAM_YAW_OFFSET_CENTRED 11
#define CAM_TESTING_OVERIDE 0 // Set to 1 for camera to move to
test angles in stabilized mode.
#define CAM_TESTING_YAW_ANGLE 90 // e.g. 90 degrees. Will try to
swing 90 degrees left, then 90 degrees right
#define CAM_TESTING_PITCH_ANGLE 90 // In degrees.
#define CAM_USE_EXTERNAL_TARGET_DATA 0
#define HEIGHT_TARGET_MIN 25.0
#define HEIGHT_TARGET_MAX 100.0
#define HEIGHT_MARGIN 10
#define ALT_HOLD_THROTTLE_MIN 0.35
#define ALT_HOLD_THROTTLE_MAX 1.0
#define ALT_HOLD_PITCH_MIN -15.0
#define ALT_HOLD_PITCH_MAX 15.0
#define ALT_HOLD_PITCH_HIGH -15.0
#define RTL_PITCH_DOWN 0.0
#define HILSIM 0
#define HILSIM_BAUD 19200
#define FLIGHT_PLAN_TYPE FP_WAYPOINTS
#define RECORD_FREE_STACK_SPACE 0
Since there were only four input and three output sockets available I
opted to declare them for Ailerons, Elevator and Throtle.I didn't use
Rudder channel because there were no extra socket for it.I programmed
a short test flight in my waypoints.h like this:
#define WAYPOINT_RADIUS 25
#define USE_FIXED_ORIGIN 0
#define FIXED_ORIGIN_LOCATION { 30.0 } //
const struct waypointDef waypoints[] = {
{ { 100,-100 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ { 100, 100 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ {-100, 100 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ {-100,-100 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ { 250,-250 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ { 250, 250 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ {-250, 250 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ {-250,-250 , 75 } , F_NORMAL, CAM_VIEW_LAUNCH } ,
{ { 0, 0 , 75 } , F_LOITER, CAM_VIEW_LAUNCH } ,
} ;
the problem is that though I programmed it for
a flight to make to squares of 100 and 250 meters and then loiter
above the launch terminal;but it made two circle like patterns and few
sharp turns and went almost 850 away from the launch location almost
180 mts. high, when it was taken into manual control with some
dfficulty and got landed. It does not seem to follow the decided
pattern of flight which is strange.Even during the entire flight it
pulled up full throtle and contineously kept gaining hight well above
the specified level of 75 mts. More than that even in the stablized
flight it tried to maintain the correct pitch but not the correct roll
unlike my CPD4 copilot with thermopiles from Revoelectrics.My aircraft
is a nextstar trainer with .46 engine.
Can anyone read my PID values and oter vital settings carefully and
help to suggest someting with it.
Thanks in advance,
Bobby