Strange Flight Behavior Of UDB3

7 views
Skip to first unread message

Bobby

unread,
Oct 9, 2011, 7:18:34 AM10/9/11
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

datapolo

unread,
Oct 9, 2011, 3:40:36 PM10/9/11
to uavde...@googlegroups.com
Bobby,
I lost my plane today when it behaved in a weird way but I suspect that it is either some radio interference or the UDB was invisibly damaged after a recent bad crash. C'est la vie!

I am not an expert but you have set roll stabilisation as being both by ailerons and rudder yet the rudder is not connected to the board. Did you fly the plane around a bit before going into WAYPOINT mode? You need to do this to get YAW LOCK or the plane will behave strangely when you switch to WAYPOINT mode as it does not know which way is north. It can only work that out if you fly a couple of decent long runs and a couple of circles will help get a wind estimation - you can then switch to WAYPOINT mode. It takes a little bit of experience to get the timing right but its easy enough. When I started with UDB and later moved to patterns I always set the first waypoint as HOME and switched to WAYPOINT mode when the aircraft was pointing away from HOME. So when I switch to WAYPOINT mode if the aircraft goes off in some unexpected direction I know that I have not yet achieved YAW LOCK.

There were some issues with the Mediatek GPS in a recent thread so I recommend you take a look at that.

Did you keep the aircraft very still after powering up until the UDB signalled it has taken initial readings? Any movement at the end of this initial period can cause problems.

Try and get either XBee telemetry or an OpenLog installed so that you can record data and people can help you analyse it to find reasons for unexpected behaviour.

You have got roll stabilisation set as being by both ailerons and rudder but rudder is not connected.

You have the HW reversing Switch connected the rudder but rudder is not connected.

You have YAW stabilisation by both ailerons and rudder but rudder is not connected.

After powering on and getting GPS lock on the ground does the stabilisation mode work as expected - if you roll the plane do the ailerons do the right thing?

Which version of MatrixPilot are you using?

Good luck!

Mike
Reply all
Reply to author
Forward
0 new messages