I did some changes (codebase r239) to the althold and implemented the pt1 element thing (viewtopic.php?f=23&t=2624
) to support better descent.
I called it harakiri, because i expected my first coding on naze would kill my copter - but it didn't.... Since Naze is coming from Timecop in Japan i called it harakiri - really no offense.
Harakiri01: Didn't work at all - endless loop at the beginning
Harakiri02: I coded without having the Naze, it works but not very good. I already posted that code.
Harakiri03: Good working version
Harakiri03b: Added pt1 element stuff. I post it here.
I included 3 zip files.
1) The source (original r239 and harakiri03b so easy CSdiff can be done, i will not do some github stuff now.)
2) Harakiri03b_Auto.zip Hexfile for all Naze with baro. If you have no MPU you should select this. Some predefined settings (see below)
3) Harakiri03b_MPU.zip Hexfile preconfigured for Naze rev4. So MPU is already selected ("set acc_hardware = 2"). This version is tested on rev4 and works nice.
What is predefined?
looptime = 3000
deadband = 10
yawdeadband = 15
alt_hold_throttle_neutral = 50
acc_lpf_for_velocity = 10
acc_lpf_factor = 100;
minthrottle = 1150
maxthrottle = 1950
Mixer: QUAD X
Flash with "Global erase" option and redo acc-calibration in gui. Do your other settings like normal. Powercycle naze before flight.
Put some foam on your baro and shield it from (sun)light. No usable baro function without doing so!
When entering althold it will start holding hight and wait for you reaching the middleposition with the throttlestick. THAN it will accept your hightchange commands relative to throttlestickmiddle. You change the speed of rise or fall (ca +-5m/s). Wait for the reaction don't go beserk on the throttlestick until you get a feel for it.
Alt PID tuning:
P: Is the only parameter wich "knows" the targethight. It can lead to oscillation.
I: Is the variometerbrake, it will suppress the oscillations. It makes the air "thicker"-
D: Is the throttleanglecorrection. It will take effect in forward flight and increase the basethrottle with the tiltangle of the copter to compensate a hightdrop in advance.