This is just part of the ZMR250 build log, Drone kit -Building a ZMR 250. It was moved to a separate post, in order to reduce the size of the original blog.
Setup the Naze32
This flight controller is a bit of a beast. I looked for a simple setup and found Afroflight Naze32 Setup Guide For Dummies, like myself.
1) Plug in your board via USB to the computer. This should run through a fast series of flashes of the LEDs, and then the blue LED (power) LED should stay lit.
2) Find out which COM port your board is connecting with. For me, it was COM3. It looks like TC’s was COM11. This will vary, and can be found by looking under Control Panel/Administrative Tools/Computer Management/Device Manager. In there, it should list your board either under Ports or USB devices. This should tell you what COM port it is using.
3) In Hercules, click on the “Serial” tab.
4) Under “Name”, select the COM or USB port that your board is using.
5) Set Baud (Speed) to “115200”, Data Size to “8 bit”, Parity to “none”, Handshake to “OFF”, Mode to “Free”. Note, TC says to set it to 1 stopbit. I could not find this setting, and thus did not set it. If you have it, set it to 1.
6) Click on “Open”. This should open a session with your COM port, and should say so in the text box.
7) On the bottom of the screen is an input box, where it says “Send”. Type in the letter “R”, without the quotation marks. Be sure it is uppercase. Do not hit enter, rather click send. This should light up all 3 LEDs and keep them lit up. If they light up, then you are good, if not, see TC’s thread on what to do if the standard process does not work. Mine worked just fine.
8) Close Hercules.
9) Now open the STM32 Flash Loader I had you download earlier. Unlike Hercules, it should show up in your programs list, if you installed it earlier.
10) Set “Port Name” to the COM port your board has been using, otherwise don’t change anything else.
11) Then click “Next”. The board should be recognized by the Flash Loader. If it isn’t, be sure your board still has all 3 LEDs on. If not, go back to step 1. If so, but the Flash Loader won’t find it, restart the Flash Loader. This happened to me, and restarting the Flash Loader fixed the problem.
12) Continue clicking “Next” until you get to the page that has the option of Erase, Download, or Upload.
13) Click on Download.
14) Also click “Jump to User Program” and “Global Erase”
15) Use the browse feature under the download section to find the latest firmware you downloaded earlier. This should be something along the lines of “baseflight…”
16) Click Next
17) When the board has been reflashed, the board will go through the normal start up sequence of flashes. It shouldn’t take long, and you may miss it. Mine worked on the first try. TC says if it doesn’t, to “unplug usb, and replug”
18) Close the Flash Loader program and unplug your board.
Your board should now have the latest firmware. You should not have to update this firmware to change settings. That will be done via the GUI or via inputting code to the controller, but that will be explained in the next few steps.
- Hercules v.3.2.8
- MultiWii v 2.4 – Google Code Archive (alternative – MultiWii GUI)
- stm32-stm8_flash_loader_demo.zip from afrodevices
- baseflight-20131126.zip from afrodevices (a bit out of date)
I found that the Windows driver was not required, as the Naze32 was recognised in Device Manager, as a CP210x
multiwiiconf.exe app in the
application.windows32 directory requires
javaw.exe. Trying to open the Processing
MultiWiiConf.pde file instead, I found that it was not working with 1.5.1, giving the error, controlP5 does not exist. Trying again with Processing 3.2.3, gives
My time is too valuable to waste my time with shoddy software. I tried turning to FreeFlight, which mentioned in the dummies link, but FreeFlight, as a Windows application, doesn’t seem to exist anymore and is owned by Parrot and is a iOS/Andriod app.
So turning back to MultiWii, just add the environment variable
PATH=C:\Program Files\Arduino\java\bin and then try to run the
application.windows32/multiwiiconf.exe again. It should now work. Select the COM port. However, moving the FC around did not change any graphics. Maybe I really did need to update the firmware, as the Naze32 didn’t seem to work just out-of-the-box.
Going back to the Dummies instructions and following steps 1- 18, this seemed to have updated the firmware. Don’t forget to close Hercules after sending the R, as the STM flash will not be able to communicate with the Naze32 otherwise. It is necessary to unzip the baseflight firmware, and select .hex files in the STM flash uploader browse dialog, on the Upload screen.
After that, reopen MultiWii, and select the COM port, and hit Start. Move the FC and the graphs should indicate changes in the readings. However, the graphics of the horizontal, compass and quadcopter do not animate.
This could be due to the fact that the firmware from AfroDevices was so out of date that maybe it did not adequately control the newer Naze32 v6.
Looking for a more up to date build of the baseflight firmware led me to Baseflight Automatic Builds (from github:multiwii/baseflight). However, it is not easy to see which is a stable tested build, so the Baseflight configurator Chrome app (also linked to in the githib page) could be better for you to use.
You need to quit MultiWii windows application before using the configurator, else the configurator will not be able to connect to the COM port, because it is still in use by MultiWii.
The configurator told me that my firmware (which I had uploaded from the afrodevices link above) was not supported, that I had to upgrade to v 2.31 and dropped me in to CLI mode. I performed a dump:
aux 0 0 aux 1 0 aux 2 0 aux 3 0 aux 4 0 aux 5 0 aux 6 0 aux 7 0 aux 8 0 aux 9 0 aux 10 0 aux 11 0 aux 12 0 aux 13 0 aux 14 0 aux 15 0 aux 16 0 aux 17 0 aux 18 0 aux 19 0 mixer QUADX feature -PPM feature -VBAT feature -INFLIGHT_ACC_CAL feature -SERIALRX feature -MOTOR_STOP feature -SERVO_TILT feature -GYRO_SMOOTHING feature -LED_RING feature -GPS feature -FAILSAFE feature -SONAR feature -TELEMETRY feature -POWERMETER feature -VARIO feature -3D feature -SOFTSERIAL feature VBAT map AETR1234 set looptime = 3500 set midrc = 1500 set minthrottle = 1150 set maxthrottle = 1850 set mincommand = 1000 set mincheck = 1100 set maxcheck = 1900 set deadband3d_low = 1406 set deadband3d_high = 1514 set neutral3d = 1460 set deadband3d_throttle = 50 set motor_pwm_rate = 400 set servo_pwm_rate = 50 set retarded_arm = 0 set flaps_speed = 0 set serial_baudrate = 115200 set softserial_baudrate = 19200 set softserial_inverted = 0 set gps_type = 0 set gps_baudrate = 0 set serialrx_type = 0 set telemetry_softserial = 0 set vbatscale = 110 set vbatmaxcellvoltage = 43 set vbatmincellvoltage = 33 set power_adc_channel = 0 set align_gyro = 0 set align_acc = 0 set align_mag = 0 set align_board_roll = 0 set align_board_pitch = 0 set align_board_yaw = 0 set yaw_control_direction = 1 set acc_hardware = 0 set moron_threshold = 32 set gyro_lpf = 42 set gyro_cmpf_factor = 600 set gyro_cmpfm_factor = 250 set pid_controller = 0 set deadband = 0 set yawdeadband = 0 set alt_hold_throttle_neutral = 40 set alt_hold_fast_change = 1 set throttle_angle_correction = 0 set rc_rate = 90 set rc_expo = 65 set thr_mid = 50 set thr_expo = 0 set roll_pitch_rate = 0 set yawrate = 0 set failsafe_delay = 10 set failsafe_off_delay = 200 set failsafe_throttle = 1200 set failsafe_detect_threshold = 985 set rssi_aux_channel = 0 set yaw_direction = 1 set tri_unarmed_servo = 1 set gimbal_flags = 1 set acc_lpf_factor = 4 set accxy_deadband = 40 set accz_deadband = 40 set acc_unarmedcal = 1 set acc_trim_pitch = 0 set acc_trim_roll = 0 set baro_tab_size = 21 set baro_noise_lpf = 0.600 set baro_cf_vel = 0.995 set baro_cf_alt = 0.950 set mag_declination = 0 set gps_pos_p = 11 set gps_pos_i = 0 set gps_pos_d = 0 set gps_posr_p = 20 set gps_posr_i = 8 set gps_posr_d = 45 set gps_nav_p = 14 set gps_nav_i = 20 set gps_nav_d = 80 set gps_wp_radius = 200 set nav_controls_heading = 1 set nav_speed_min = 100 set nav_speed_max = 300 set nav_slew_rate = 30 set p_pitch = 40 set i_pitch = 30 set d_pitch = 23 set p_roll = 40 set i_roll = 30 set d_roll = 23 set p_yaw = 85 set i_yaw = 45 set d_yaw = 0 set p_alt = 40 set i_alt = 25 set d_alt = 60 set p_level = 90 set i_level = 10 set d_level = 100
These settings were anything special, as I had not done any configuring, but I thought that it would be wise to save them regardless.
I wasn’t able to access any of the other tabs, until I upgraded, as my firmware was not supported.
Note that if you quit the configurator, before disconnecting the COM port, then if/when you relaunch the configurator it will not be able to be reconnect to the flight controller as it thinks that the COM port is still in use. It is then necessary to unplug the FC from the USB and then plug it back in.
To update the firmware, from Naze32Wiki/GetStarted/SoftwareInstallation/3rd Step – Flashing the Firmware
- Open Baseflight Configurator
- Do NOT click Connect, instead, click Firmware Flasher
- Click Load Firmware [Online] to download the latest firmware
- * Optionally you may choose not to do a Full Chip Erase, however, if you are updating from a much older version, it might be a good idea. You can also back up your settings by using the CLI dump command to display your settings, then saving the output to a text file.
- Click Flash Firmware to flash the firmware to the naze, wait for the chip to finish verifying, then it will reboot.
- Select the correct COM port (usually the last in the list) from the dropdown list at the top left, then click Connect
This is a much easier method than the Dummies method used previously.
I connected briefly and the configurator recognised the Naze32 now. As a sanity check, I disconnected and quit the configurator, and then relaunched the MultiWii application. This time the graphics were animated. So, the original issue, of the unanimated graphics, was due to the fact that the firmware was out of date.
Then I returned to the confgurator and calibrated the accelerometer and the megnetometer.
Baseflight or Cleanflight?
See Oscar Liang’s Baseflight vs Cleanflight – Which is better?