Developer

Arducopter 2.0 Beta first release!

3689405696?profile=originalMark Grennan


We're finally comfortable enough with Arducopter 2.0 to release it as a beta!

AC2 is a complete system for a range of Multi-Copters. It started out as a side project for me and turned into an obsession. Oh Well! Copters turned out to be even more addicting than I ever thought. 

AC2 doesn't bring over any code from NG, but I tried to make the transition fairly easy. It should fly virtually the same and the default PID values are equivalent. 

I think it's pretty close and fairly bug free, but I know there are a few left and that's why we need the community to help us find them and submit patches that improve performance. If you have an issue or something to contribute, please use the Google Code Issues list for prompt responses. I won't be tracking bug related comments in this thread. If you can, please include a log file from you flight with an indication how many seconds in you had a problem.

 

Google Code issues list

 

And one last note before we talk features: Safety first! Don't load this and expect it to work exactly like NG or that it will work out of the box with no issues. Don't calibrate your ESCs with the props on. Don't turn off your radio while it is armed. Test in your hand before adding props. Test in your hand after adding props. Always be prepared to put it back into stabilize in case an Auto mission behaves unpredictably. etc... Simple stuff, but you are in control and take the responsibility of flying when you load this code. 

 

Now that's out of the way: Download here [UPDATE: The Mission Planner now supports direct AC2 firmware uploading, so please use it to get the code instead. No need for Arduino or compile source code anymore! That said, if you want to fiddle with the code, you can always get it here and use Arduino as usual.]

 

The full ArduCopter 2 Manual is here. Please read it before using the code!

 

What's New:

Simple mode allows the user to save the orientation of the copter while arming the motors. This means the copter can yaw in any direction and the sticks will reference the original orientation. Great for learning or  - emergencies in the air.

Position Hold is now called Loiter to be compliant with Mavlink Ground control stations.

RTL will fly the copter home and hold the position

Auto will fly a mission stored in EEPROM.

 

Copters supported:

+, x, tri, hexa+, hexax, y6

 

AutoPilot commands supported:

MAV_CMD_NAV_TAKEOFF   - Copter will takeoff and rise to a defined altitude.

MAV_CMD_NAV_WAYPOINT - Copter will navigate towards a waypoint. (Beta 1 disabled options: altitude minimum, time delay)

MAV_CMD_NAV_LAND - Copter will immediately go into Loiter (position_hold) and begin a controlled decent.  Mission scripting ends after this command.

MAV_CMD_NAV_LOITER_UNLIM - Copter will Loiter at current location.  Mission scripting ends after this command.

MAV_CMD_NAV_LOITER_TIME - Copter will Loiter for N seconds. (disabled for this version)

MAV_CMD_NAV_RETURN_TO_LAUNCH - Copter will return to Launch (home position) 

 

MAV_CMD_CONDITION_DELAY - will delay the execution of next conditional command

MAV_CMD_CONDITION_DISTANCE - will delay the execution of next conditional command until the copter is within a minimum distance to next waypoint

MAV_CMD_CONDITION_CHANGE_ALT - will send copter to desired altitude, overrides next waypoint altitude.

MAV_CMD_CONDITION_YAW - controls how the copter will yaw. Angle (relative or absolute), speed, and direction are inputs. 

 

MAV_CMD_DO_JUMP - sets the next waypoint to the desired index - for conditional loops

MAV_CMD_DO_SET_HOME - changes the home location

MAV_CMD_DO_SET_SERVO - outputs servo channel number to desired PWM

MAV_CMD_DO_SET_RELAY - sets the relay to postion 1 or 2

MAV_CMD_DO_REPEAT_SERVO  - toggles servos

MAV_CMD_DO_REPEAT_RELAY - toggles the relay

 

In flight tuning:

 

You can tune aspects of flight with your channel 6 flaps knob. To enable this, you need to compile and update AC2 directly with Arduino.

 

See AP_Config for options.

 

How to setup your radio:

ch1 = roll

ch2 = pitch

ch3 = throttle

ch4 = yaw

ch5 = mode switch - use your 3 position switch

ch6 = used for in-air tuning - not currently active, see AP_config.h for options

ch7 = use to set throttle hold value while hovering (quick toggle) - default position should be a low PWM value!

ch8 = NOT used!!! - this is the hardware manual - it's dangerous to use for quads BEWARE!!!

 

How to use the CLI:

You must go through each item and set the values to match your hardware

 

"setup" menu:

erase - when installing AC2 for the first time, run this to erases bad values from EEPROMS – just in case

reset - Performs factory reset and initialization of EEPROM values

radio - records the limits of ALL radio channels - very important!!!

pid - restores default PID values - only needed if you have changed them in flight with CGS, not for setup.

frame - sets your frame config: [x, +, tri, hexax, hexa+, y6]

motors - interactive setup of your motors, (X, +, or tri supported) Point your stick towards the motor to make it spin, throttle is passthough.

level - sets initial value of accelerometers - hold copter level, don't move it.

modes - sets the flight modes assigned to each switch position (you have 6 available), toggle roll to change, enter to save.

current - enables an Attopilot current sensor: [on, off, milliamp hours]

compass - enables the compass [on, off]

declination - sets your local declination value – lookup online for accuracy [decimal degrees!]

sonar - Sonar hooks to the "pitot" port which is an analog input [on, off]

show - a formatted output of all the settings

 

"test" menu:

pwm - outputs the pwm values of all 8 radio channels

radio - outputs the control values of all 8 radio channels in degrees * 100 or other value (see radio.pde)

gps - outputs GPS data

rawgps - outputs raw, unparsed GPS data

adc - outputs raw adc values

imu - outputs euler angles

battery - outputs voltage readings to analog in 0-3

current - outputs voltage and current from an AttoPilot current sensor

relay - toggles the relay

sonar - outputs sonar data in cm

waypoints - dumps stored waypoint commands

airpressure - raw output of absolute presure sensor

compass - outputs compass angles in degrees (0 = north)

xbee - outputs an XBEE sequence used for range testing

mission - writes a default mission to EEPROM [null, 'wp']

- choosing 'wp' option will send the copter 15 meters North and back again.

eedump - raw output of bytes in eeprom

 

"logs" Menu:

See the APM wiki to better understand how to dump logs and how to set the types of data you want to record.

 

AC2 Flight modes:

All of the modes allow the user to control the copter with the normal controls. You can get yourself out of a jam sometimes by simply nudging the copter while in AUTO or LOITER modes.

 

Options include:

ACRO - rate control only. not for beginners

STABILIZE - copter will hold -45 to 45° angle, throttle is manual.

SIMPLE - Remembers the orientation of the copter when arming, allowing the user to fly more intuitivey. Manual Throttle.

ALT_HOLD - Altitude is controlled by the throttle lever. Middle is hold, high = rise, low = fall.

LOITER  - When selected, it will hold the current altitude, position and yaw. Yaw is user controllable. roll and pitch can be overridden temporarily with the radio. Altitude is controlled by the throttle lever. Middle is hold, high = rise, low = fall.

RTL  - Will try and fly back to home at the current altitude.

AUTO  - Will fly the mission loaded by the Waypoint writer

GCS_AUTO - Not implemented

 

 

Special notes:

The props will NOT spin in stabilize when throttle is in the off position, even when armed.

Arming is Yaw right for 1 sec, disarm is yaw left for 1 sec. Just give it some juice to confirm arming.

 

Auto modes will NOT engage until the throttle is above neutral. So if you put the control switch to positio hold while it's on the ground, it will no spin up. Or at leat it shouldn't ;)

 

Good luck,

Jason

 

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Developer
    it's altitude in the CLI, reports Barometric pressure and Sonar.
  • Wayne, yes, I found the "Sonar" command was missing too.
  • Hi everyone.Great work Jason thanks for all your hard work. Just loaded the AP2 code went through the set up in CLI activated sonar and mag went into the test menu and sonar was missing. I have tried it a couple of times with the same result any ideas? I went for a test fly and my quad was very stable and responsive on the default PID settings
  • just got back from using my quadcopter at a competition, and it was a blast, now its gona be even better..
  • hello

    first fly with the new code,very good stabilisation,congratulation.

    altitude too reactive

    to morrow i will test GPS

    HB

     

  • Developer

    On the current implementation of Nav - pitchmax is your friend. During Sparkfun I had pitch_max tied to my CH6 knob for tuning.

     

    The next version of nav is fully rate controlled for speed, so it won't have these issues by nature. It's just not tested well enough. It's in the code if anyone wants to play.

     

  • I'm going to go do a normal controlled flight this afternoon and see if it records to the log after I have hit the erase button in the Mission Planner Log Download GUI. Lets hope that works.

    Also, is there any documentation of good values to use of NAV PID and waypoint radius etc? I found that while in AUTO, my quad was extremely aggressive. I'd like for it to hover to a point and not dart to a point like it's running from the computer recycler. 

  • Developer
    You may need to erase the logs. If something isn't right the logs have no way to repair themselves.
  • Is there support for X 45º? If not, how do I build the arducopter frame to get the board right?
  • Moderator

    Robert, that's a serious bummer.  :(   Sorry!   For everyone who still has their copter, be sure to test Jason's fix from the repository (disabling auto-trim).

    Once I've got my quad stable again, it's test mania at my place...

This reply was deleted.