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

 
   Home
   Projects
 

   Articles
 

   Donation
         
 
 
 
 

 
Bain page: Explaining the YMFC-32 autonomous setup program.

Explaining the YMFC-32 autonomous setup program

Table of contents

1.General information
2.a = Read the receiver input pulses
3.b = I2C scanner to detect any I2C sensors attached
4.c = Read the raw gyro values
5.d = Read the raw accelerometer values
6.e = Check the IMU angles
7.f = Test the LEDs
8.g = Read the battery voltage input
9.h = Check barometer
10.i = Check GPS
11.j = Check HMC5883L compass

1. General information

TOP

The setup program can be used for:

  • Testing the individual sensors
  • Balancing the propellers
  • Calibrating the ESC’s


2. a = Read the receiver input pulses

TOP

With this tool you can setup your transmitter for the YMFC-32 flight controller. The goal is to set the first 4 receiver channels (roll, pitch, throttle and yaw) as follow:

  • Minimum = 1000 (+/-5)
  • center position = 1500 (+/-5)
  • maximum 2000 (+/-5)
The ^ , v , < and > indicate the stick direction.
  • -+- = center position
  • ^^^ = away from the pilot
  • vvv = towards the pilot
  • <<< = left
  • >>> = right
If your stick is moving in the opposite direction you need to invert that channel. Please check the manual of the transmitter on how to invert a channel, set the end points and center position.

Channel 5 is used for the flight modes and has 3 different positions:

  • between 1000 and 1200 = flight mode 1 (auto level)
  • between 1200 and 1600 = flight mode 2 (altitude hold)
  • between 1600 and 2000 = flight mode 3 (altitude and GPS hold)

Channel 6 is used for the heading lock:

  • between 1000 and 1200 = normal control
  • between 1200 and 2000 = head lock activated

And finally you can test the start sequence by moving the throttle stick bottom left and back to the center position. The start should now be set to 2. Next you can test the stop by moving the throttle stick bottom right.

Please note: S=start, R=roll, and so on. Otherwise it could not fit the frame width.

Reading receiver input pulses.
You can exit by sending a q (quit).
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:999
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1499 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1499 CH5:1000 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:999
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1508 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1724 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1903 P:-+-1499 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1995 P:-+-1500 T:-+-1499 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:>>>1995 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1995 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1995 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1995 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1995 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1995 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:>>>1780 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1378 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:1000 CH6:1000
S:0 R:<<<1139 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1005 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1005 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1005 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1005 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:<<<1004 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1005 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1054 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:<<<1439 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:vvv1652 T:-+-1500 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:vvv1817 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:vvv1923 T:-+-1500 Y:-+-1500 CH5:1000 CH6:999
S:0 R:-+-1500 P:vvv1995 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:vvv1995 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:vvv1995 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:vvv1995 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1501 P:vvv1995 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:vvv1764 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:^^^1342 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1099 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1501 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:^^^1005 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1090 T:-+-1500 Y:-+-1499 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1307 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:^^^1460 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1531 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1728 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1876 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:-+-1500 T:^^^1995 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:^^^1995 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1995 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1995 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1996 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:^^^1995 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:-+-1500 T:^^^1565 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:vvv1269 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1499 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1498 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1049 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:>>>1526 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1703 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1978 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1996 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1996 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1499 T:-+-1500 Y:>>>1996 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1996 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:>>>1648 CH5:1000 CH6:999
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:<<<1301 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1056 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1005 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1006 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:<<<1243 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1499 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1484 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:vvv1058 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:<<<1214 CH5:1000 CH6:1000
S:1 R:-+-1500 P:-+-1500 T:vvv1005 Y:<<<1006 CH5:1000 CH6:1000
S:1 R:-+-1500 P:-+-1500 T:vvv1005 Y:<<<1237 CH5:1000 CH6:1000
S:2 R:-+-1501 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1501 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1499 T:vvv1024 Y:-+-1500 CH5:1000 CH6:1000
S:2 R:-+-1501 P:-+-1500 T:vvv1005 Y:-+-1499 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1000
S:2 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1514 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:>>>1995 CH5:1000 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:vvv1005 Y:>>>1933 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:vvv1005 Y:-+-1500 CH5:1000 CH6:1001
S:0 R:-+-1500 P:-+-1500 T:vvv1271 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1501 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1999 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:2000 CH6:999
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:2000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:2000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:2001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:2000 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:2000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:2000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1501 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1500 CH6:1000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1499 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:999 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1501 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2001
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:2000
S:0 R:-+-1500 P:-+-1500 T:-+-1499 Y:-+-1500 CH5:1001 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1501 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1500 CH5:1000 CH6:1000
S:0 R:-+-1500 P:-+-1500 T:-+-1500 Y:-+-1501 CH5:1000 CH6:1000

 



3. b = I2C scanner to detect any I2C sensors attached

TOP

The I2C scanner is added so you can check what devices and sensors are connected correctly to the I2C bus. When started the scanner sends a beginTransmission signal to I2C address 1. After that it will end the transmission with the endTransmission function. If a sensor is connected it will respond to the endTransmission function and it's address will be printed on the screen.

When there is no sensor responding to the endTransmission function it's address will not be shown on the serial monitor.

The YMFC-32 needs the following devices:

  • 0x1E = HMC5883L compass
  • 0x68 = MPU-6050 gyro/accelerometer
  • 0x77 = MS5611 barometer

These sensors should appear on the serial monitor. If this is not the case you need to double check the wiring and you need to make sure that the connected devices are working correctly.

Starting the I2C scanner.
The YMFC-32 needs the following devices:
0x1E = HMC5883L compass
0x68 = MPU-6050 gyro/accelerometer
0x77 = MS5611 barometer
They should appear in the list below.

Scanning address 1 till 127...

I2C device found at address 0x1E
I2C device found at address 0x68
I2C device found at address 0x77
done

 



4. c = Read the raw gyro values

TOP

This function is used to show the raw but calibrated gyro values. In the ideal world a gyro that does not move should output 0 degrees per second as an output. This however is never the case. Temperature changes and mechanical stress and simply the design will result in a small offset.

After selecting this function the gyro is calibrated and the offset is removed. Calibration means that 2000 raw gyros are taken from the gyro. The average of the 2000 samples is used to subtract the offset. This will result in a raw calibrated value of 0 (+/-10).

The calibration values that are used for removing the offset are also shown. These values can be anything. According to the datasheet of the MPU-6050 the maximum offset should be +/- 1310.

If the output is all zero's the you need to double check the connections of the MPU-6050.

 

Reading raw gyro data.
You can exit by sending a q (quit).
Calibrating the gyro.................
X calibration value:-2
Y calibration value:71
Z calibration value:-69
Gyro_x = 0 Gyro_y = -2 Gyro_z = 0
Gyro_x = 3 Gyro_y = 1 Gyro_z = 3
Gyro_x = -2 Gyro_y = 3 Gyro_z = -3
Gyro_x = 3 Gyro_y = 6 Gyro_z = -1
Gyro_x = -2 Gyro_y = 0 Gyro_z = -6
Gyro_x = 8 Gyro_y = 3 Gyro_z = 1
Gyro_x = -1 Gyro_y = -3 Gyro_z = 4
Gyro_x = -2 Gyro_y = 1 Gyro_z = -2
Gyro_x = 0 Gyro_y = -2 Gyro_z = -2
Gyro_x = -14 Gyro_y = 4 Gyro_z = 1
Gyro_x = -3 Gyro_y = 2 Gyro_z = 1
Gyro_x = 2 Gyro_y = 2 Gyro_z = -6
Gyro_x = -1 Gyro_y = 0 Gyro_z = 1
Gyro_x = -1 Gyro_y = 3 Gyro_z = 1
Gyro_x = 1 Gyro_y = 5 Gyro_z = 0
Gyro_x = 5 Gyro_y = -4 Gyro_z = -3
Gyro_x = -2 Gyro_y = 1 Gyro_z = -5
Gyro_x = -1 Gyro_y = -2 Gyro_z = -4
Gyro_x = 2 Gyro_y = 3 Gyro_z = 1
Gyro_x = -1 Gyro_y = 0 Gyro_z = 1

 



5. d = Read the raw accelerometer values

TOP

This function is used to show the raw accelerometer values. In the ideal world an accelerometer that is place spirit level should output 0g on the X and Y axis. On the Z axis the output should be 1g. This however is never the case. The mounting method, mechanical stress and simply the design will result in a small offset.

After selecting this function the raw accelerometer values are shown on the serial monitor. Make sure that the quadcopter is spirit level! The X and Y output should have a maximum output of +/- 500. The value of the Z-axis is less important at this point but should be around 4700.

If the output is all zero's the you need to double check the connections of the MPU-6050.

Reading the raw accelerometer data.
You can exit by sending a q (quit).
ACC_x = 390 ACC_y = -38 ACC_z = 4720
ACC_x = 391 ACC_y = -54 ACC_z = 4717
ACC_x = 380 ACC_y = -45 ACC_z = 4714
ACC_x = 393 ACC_y = -44 ACC_z = 4714
ACC_x = 397 ACC_y = -44 ACC_z = 4713
ACC_x = 387 ACC_y = -44 ACC_z = 4705
ACC_x = 394 ACC_y = -36 ACC_z = 4700
ACC_x = 390 ACC_y = -33 ACC_z = 4720
ACC_x = 382 ACC_y = -42 ACC_z = 4722
ACC_x = 398 ACC_y = -31 ACC_z = 4689
ACC_x = 388 ACC_y = -42 ACC_z = 4710
ACC_x = 391 ACC_y = -31 ACC_z = 4721
ACC_x = 386 ACC_y = -40 ACC_z = 4704
ACC_x = 389 ACC_y = -33 ACC_z = 4704
ACC_x = 389 ACC_y = -41 ACC_z = 4713
ACC_x = 394 ACC_y = -46 ACC_z = 4717
ACC_x = 402 ACC_y = -36 ACC_z = 4713
ACC_x = 386 ACC_y = -39 ACC_z = 4721
ACC_x = 393 ACC_y = -48 ACC_z = 4701
ACC_x = 397 ACC_y = -40 ACC_z = 4719
ACC_x = 384 ACC_y = -40 ACC_z = 4713
ACC_x = 393 ACC_y = -42 ACC_z = 4704

 



6. e = Check the IMU angles

TOP

When selecting the "check IMU angles" function, the gyro is calibrated and the same calculations are performed as used in the flight controller software.

This means that, if the angles are shown correctly on the serial monitor they should also be ok in the flight controller software. Because the accelerometer is not calibrated yet the output will not be zero when the quadcopter is level. Don't worry about it as you can automatically calibrate the accelerometer with the flight controller software.

Test the following quadcopter movements:

  • Nose up should result in a positive pitch angle
  • Nose down should result in a negative pitch angle
  • Left wing down should result in a negative roll angle
  • Left wing up should result in a positive roll angle
If the direction of the pitch or roll angle is inverted you need to double check the orientation of the gyro.

 

Reading the IMU angles.
You can exit by sending a q (quit).
Calibrating the gyro.................
Pitch: 5.4 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.4 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.4 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.4 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.4 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.4 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.4 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.4 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.6 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.6 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.5 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: -0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: 0 Temp: 30.0
Pitch: 5.6 Roll: -0.7 Yaw: -0 Temp: 30.0

 



7. f = Test the LEDs

TOP

This function will lights the LED's one by one. The LED's are connected to port B3 and B4 of the STM32. If the LED's fail to turn on you need to double check the connections.

Test the LEDs.
The red LED is now ON for 3 seconds

The green LED is now ON for 3 seconds

 



8. g = Read the battery voltage input

TOP

With this function you can test the battery voltage. Connect the sensor wire that is connected to the voltage divider R3 / R4 to + 5V. This way you should get approximately 5V on the Serial monitor.

Reading the battery voltage.
You can exit by sending a q (quit).
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V
Voltage = 4.9V

 



9. h = Check barometer

TOP

The "check barometer" function can be used to simulate the barometer altitude algorithms that are used on the YMFC-32 flight controller software.

First the 6 calibration values (C1 till C6) are shown on the serial output. After that the barometric pressure is shown on the serial monitor.

Now you can check if the response is normal. Moving the quadcopter up should lower the barometric pressure. Moving the quadcopter down should increase the barometric pressure.

Please be aware that, if it's windy outside your house the barometric value will fluctuate quite a bit.

Checking MS-5611 barometer.
You can exit by sending a q (quit).
MS5611 found on address: 77
C1 = 48008
C2 = 51863
C3 = 29520
C4 = 27516
C5 = 33112
C6 = 27361
101502
101502
101502
101502
101503
101503
101503
101503
101503
101503
101503
101503
101504
101504
101504
101504
101504
101504

 



10. i = Check GPS

TOP

This check will simulate the ublox setup procedure and output the raw NMEA lines that will be used by the YMFC-32 flight controller for the GPS hold function.

At startup the output of the GPS module is set at 9600bps with a 1Hz refresh rate. After the setup the output should be 57.6kbps with a 5Hz refresh rate and the GSV lines are disabled.

If the second output @ 57.6kbps/5Hz is not shown correctly on the serial output the GPS module does not accept the ublox setup protocol and cannot be used with the YMFC-32 flight controller code.

Checking raw GPS data.

====================================================================
Checking gps data @ 9600bps
====================================================================
GPGSV,1,1,01,04,,,27*79
$GLGSV,1,1,00*65
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GPGSV,1,1,01,04,,,28*76
$GLGSV,1,1,00*65
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GPGSV,1,1,01,04,,,29*77
$GLGSV,1,1,00*65
$GNGLL,,,,,,V,N*7A

====================================================================
Checking gps data @ 57600bps
====================================================================
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A
$GNRMC,,V,,,,,,,,,,N*4D
$GNVTG,,,,,,,,,N*2E
$GNGGA,,,,,,0,00,99.99,,,,,,*56
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*2E
$GNGLL,,,,,,V,N*7A

 



11. j = Check HMC5883L compass

TOP

This function can be used for testing the HMC5883L compass module. At startup the test function of the compass is used. This means that a small positive and negative current is injected in close proximity of the magnetic resistive sensors. This will result in a positive and negative reading. The results are printed on the screen.

The following lines will show the raw X, Y, Z outputs.

Checking HMC5883L compass.
You can exit by sending a q (quit).
Positive bias test: x: 738 y: 704 z: 675
Negative bias test: x: -734 y: -717 z: -692
X-axis:-94 Z-axis:221 Y-axis:-178
X-axis:-83 Z-axis:244 Y-axis:-175
X-axis:-87 Z-axis:235 Y-axis:-177
X-axis:-86 Z-axis:244 Y-axis:-176
X-axis:-87 Z-axis:244 Y-axis:-175
X-axis:-81 Z-axis:228 Y-axis:-174
X-axis:-83 Z-axis:229 Y-axis:-175
X-axis:-87 Z-axis:233 Y-axis:-174
X-axis:-87 Z-axis:246 Y-axis:-175
X-axis:-89 Z-axis:243 Y-axis:-176
X-axis:-86 Z-axis:248 Y-axis:-176
X-axis:-86 Z-axis:230 Y-axis:-177
X-axis:-84 Z-axis:224 Y-axis:-175
X-axis:-82 Z-axis:238 Y-axis:-177
X-axis:-88 Z-axis:245 Y-axis:-178
X-axis:-83 Z-axis:244 Y-axis:-176
X-axis:-98 Z-axis:224 Y-axis:-178
X-axis:-84 Z-axis:235 Y-axis:-177
X-axis:-93 Z-axis:225 Y-axis:-177
X-axis:-83 Z-axis:239 Y-axis:-178