Tradheli enthusiasts,
Writing to provide an update on my progress. Currently I am still testing to see what combination of Ang_P and Rate PID gains provide the best tune for a helicopter. I think Iāve got a good idea now and hope to start hacking away at the autotune feature.
In my previous post, I was attempting to show the importance of the Ang_P gain versus Rate P or Rate D in providing good adherence to the desired attitude as well as good disturbance rejection. That is still my belief and I have adjusted my plots to better show the this. Previously I was conducting the analysis using the pilot stick commanded angle to the actual aircraft angle. I realized that although this shows what the pilot would perceive as the aircraft response, the judge of a good tune is how well the aircraft responds to the attitude command after the shaping or command model. You set the INPUT_TC and ACCEL_MAX parameters to adjust the āfeelā of the aircraft and keep the requested response within the capabilities of the aircraft. The ANG_P and rate PIDs are designed to drive the aircraft to that command model output and doing the analysis with respect to the command model input provides a best assessment of the goodness of the tune.
I revisited the effects of Ang_P, rate P and rate D on the response. Mostly I looked at individual contributions of rate P and rate D to the tune in both pitch and roll axes. Below is the bode plot for the pitch axis showing just Angle P, Angle P with rate P, Angle P with rate D, and then the final tune with rate PID. Angle P was set at 8.
synpcm8 - just angle P
synpcm8p - angle P and Rate P =0.03
synpcm8d - angle P and rate D=0.0025
syntpcm8 - angle P with PID gains
First I will note that when I attempted the angle P with rate P gain, I got pretty large oscillations which forced me to abort the sweep. I am not sure why the bode plot looks that way unless the large oscillations excited response across the frequency spectrum but I would have expected the gain and phase to drop off about the point where I aborted the sweep which was probably around 20 rad/s. Regardless my take away was that P gain alone with Angle P increases the amplitude at the flap regressive mode. The desire is to reduce the peak that in the plot of angle P alone. You can see that rate D does exactly that. Now the plot of angle P with rate PID does not exceed the peak of angle P alone but if no rate P was used, then that peak would be lower and proved a better response.
The next plot is for roll axis. The sequence of signals is the same. Angle P was set to 6.
synrcm6 - just angle P
synrcm6p - angle P and Rate P =0.05
synrcm6d - angle P and rate D=0.001
syntrcm6 - angle P with PID gains
This shows similar trends. Adding P gain does not help reduce the peak compared to angle P alone. Adding D gain does reduce the peak however I learned that it also excites the lead-lag regressive at around 60 rad/s (you can see the rise in the magnitude plot as it goes out to 60 rad/s). So that is something that will have to be watched when raising D gain. you can really see the lead lag regressive peak in the plot of angle P with rate PID where the peak in the magnitude is about 50 rad/s.
So based on what Iāve done to this point, the goal for the tuning of pitch and roll is to raise the Angle P gain to at least 6 or more. I donāt know if I would recommend going above 10. I expect as the angle P gain is raised with no rate PID, youāll excite the flap regressive and it is fine to leave the response a little oscillatory. Then you can raise the rate D gain and that should remove some of the oscillatory behavior until you start adding too much and get instability. Iām not convinced that rate P gain is beneficial to a heli tune.
I know I havenāt considered phase much in this analysis. rate P gain certainly reduces the phase loss but my thought is that phase loss could be reduced by increasing angle P too and using rate D gain to keep the peak of the magnitude down. Thus you would not need to use rate P and I think there is more benefit in disturbance rejection to having more angle P vice having any rate P at all.