Terms of service
Brokking
 
 
.net
Let's keep it simple
 

 
   Home
   TL-blog
   Projects
 

   Articles
 

   Contact
   Donation
             
 
 

 
YMFC-3D V2 - The easy Arduino quadcopter - official main page.

Project YMFC-3D V2

Home   Q & A   Downloads   Media

How to get started fast? Click on question 1 on the YMFC-3D V2 Q and A page.

The YMFC-3D video series helped a lot of people to build their own Arduino quadcopter. I mainly started this video series for advanced Arduino users with RC experience. But it turned out that people with minor Arduino and RC experience start building the YMFC-3D quadcopter. And that of course is great!

I kept the YMFC-3D code a simple as possible. This means that it takes more effort to get the quadcopter to fly. I filtered the YouTube comments and questions and made a list of the main problems that people experience when setting up the software.

1) Setting up the transmitter endpoints

Some transmitters don't support endpoints / limits. This means that the source code needs to be modified by the user.

2) The MPU-6050 cannot be used

A lot of people would like to use the all in one MPU-6050 gyro / accelerometer. The YMFC-3D code does not support the MPU-6050 gyro.

3) Changing the I2C address of the gyro

When using the L3GD20H it is necessary to change the gyro address in the source code.

4) Motors don't start / LED keeps blinking

When the transmitter does not support endpoint / limits it's not possible to setup the endpoints correct and the motors cannot be started.

For an advanced Arduino user these points are easily overcome. But for beginners it's a complex challenge to get the YMFC-3d quadcopter to work.

And that is something I want to end!

To do this I'm starting to build the YMFC-3D version 2. This version will be 'smarter' and the setup procedure will be as simple as possible.


===================================================
Blinking LED
===================================================
9 8 7 6 5 4 3 2 1

===================================================
Transmitter setup
===================================================
Checking for valid receiver signals...
OK

Place all sticks and subtrims in the center position within 10 seconds.
9 8 7 6 5 4 3 2 1
Center positions stored.
Digital input 08 = 1504
Digital input 09 = 1504
Digital input 10 = 1504
Digital input 11 = 1504


Move the throttle stick to full throttle and back to center
Throttle is connected to digital input 9
Channel inverted = no

Move the pitch stick to simulate nose up and back to center
Pitch is connected to digital input 10
Channel inverted = no

Move the roll stick to simulate left wing up and back to center
roll is connected to digital input 7
Channel inverted = no

Move the yaw stick to simulate nose right and back to center
Yaw is connected to digital input 8
Channel inverted = no

Gently move all the sticks simultaneously to their extends
When ready put the sticks back in their center positions
Measuring endpoints....

Channel values found during setup
Channel 1 values:1004 - 1504 - 2004
Channel 2 values:1004 - 1504 - 2004
Channel 3 values:1004 - 1504 - 2004
Channel 4 values:1000 - 1504 - 2008

===================================================
Gyro search
===================================================
Searching for MPU-6050 on address 0x68/104
Searching for MPU-6050 on address 0x69/105
Searching for L3G4200D on address 0x68/104
Searching for L3G4200D on address 0x69/105
Searching for L3GD20H on address 0x6A/106
L3GD20H found on address 0x6A

===================================================
Gyro register settings
===================================================
Register 0x20 is set to:1111
Register 0x23 is set to:10010000

===================================================
Gyro calibration
===================================================
Don't move the quadcopter!! Calibration starts in 3 seconds
Calibrating the gyro, This will take +/- 8 seconds
Please wait....................
Axis 1 offset=-73.08
Axis 2 offset=178.98
Axis 3 offset=-97.04

===================================================
Gyro axes configuration
===================================================
Lift the left side of the quadcopter to a 45 degree angle within 10 seconds
OK!
Angle detection = 2
Axis inverted = no
Put the quadcopter back in its original position within 10 seconds
9 8 7 6 5 4 3 2 1

Lift the nose of the quadcopter to a 45 degree angle within 10 seconds
OK!
Angle detection = 1
Axis inverted = no
Put the quadcopter back in its original position within 10 seconds
9 8 7 6 5 4 3 2 1

Rotate the nose of the quadcopter 45 degree to the right within 10 seconds
OK!
Angle detection = 3
Axis inverted = yes

===================================================
Storing EEPROM information
===================================================
Writing EEPROM
Done!
Verify EEPROM data
Verification done

Setup is finished.
You can now upload the YMFC-3D V2 code.

In short it means that the setup will be automated:
- automated gyro detection
- MPU-6050, L3G4200D and L3GD20H gyro's are supported
- automated roll, pitch and yaw axis recognition
- automated receiver stick movement recognition
- software calculated endpoints / limits
- and anything else that I can think of to make life easier

All the settings are saved in the EEPROM. The main YMFC-3D V2 flight controller code will use these settings to calculate the gyro and receiver inputs.

I'm currently testing the setup program so it can work with different gyro's. From left to right: MPU-6050, L3G4200D and the L3GD20H.

Automating the code means that I have to modify a large part of the code. The basic principle will stay the same. But reading the EEPROM and automatically adapt the gyro and receiver data will be a challenge.

12-01-2016

I'm making some nice progress. The setup program is almost done and the ESC calibration program is finished.

To test the software I need a new test quad. And to make it as realistic as possible I ordered some cheap ESC's and motors from DealExtreme: 30A esc + motor combo

In the title they make references to the DJI Flamewheel and 2212 motors. So they should be suitable for multirotors. But after the first test I noticed that the reaction speed is absolutely not the same as the DJI ESC. On the other hand, what should we expect for this amount of money.

Let's not be too hasty with conclusions. They work and first I need to complete the quad so I can test the software and see if it fly's.

16-01-2016

The Arduino sketches are ready! There are now three sketches that need to be uploaded one after the other:

1) Setup program for gyro and transmitter
2) ESC calibration and motor balancing
3) Final flight controller

I already did a lot of software testing to make sure that everything is working as it supposed to. The upcoming day's I will try to do some flying with all the gyro's. The weather unfortunately is pretty bad at the moment.

17-01-2016

Today I flew my quadcopter with the MPU-6050 and L3GD20H gyro in my backyard. The ESC's worked fine and the software performed without any glitches. A real milestone for this project. But I'm not finished yet.

The thing that I already have done with the L3G4200D and L3GD20H is a 'noise' test. This means that I make a graph to visualize the output of the gyro with running motors. The quad does not move and the motors vibrate because I did not balance the props.

Here you see the output of the L3GD20H and the MPU-6050. Both graphs are scaled form -15 to + 15 for comparison.

 

As you can see the L3GD20H is producing less noise with the same amount of vibrations. The thing that I have to do now is to find the correct MPU-6050 register setting so the noise rejection is optimal for flying.

18-01-2016

19-01-2016

Most of the suggestions in the YouTube comments are implemented in the software. I also like to thank Varad who volunteered to tested the YMFC-3D V2 software and came up with some good ideas and useful feedback.

I hope that most of you will understand that a project like this takes time.... a lot of time. The code is getting more complex and I want to test it as good as I can before I release it. A lot of people will use this code and it has to be perfect.

Despite all that I'm currently working really hard on my website and an introduction video. If all goes well I will release the software on (European) Friday January 22, 2016.

21-01-2016