Terms of service | ||||
![]() |
Brokking |
.net |
Let's keep it simple |
![]() |
|
Explaining the YMFC-32 autonomous setup programTable of contents
The setup program can be used for:
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:
Channel 5 is used for the flight modes and has 3 different positions:
Channel 6 is used for the heading lock:
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.
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:
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.
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.
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.
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:
Reading the IMU angles.
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.
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.
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.
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.
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.
|
  |