All your other locals should not be inside the loop. That would leave you with something like:
local K_THROTTLE = 70 --Throttle function (centre only)
local throttle_channel = SRV_Channels:find_channel(K_THROTTLE) --Looks for the Servo channel controlling THROTTLE
local PWM = 900 --Servo function disabled
local TIMEOUT = 100
function update () -- periodic function that will be called
if quadplane:in_vtol_mode() then
SRV_Channels:set_output_pwm_chan_timeout(throttle_channel, PWM, TIMEOUT) --disable throttle by a timeout
end
return update, TIMEOUT * 0.5
end
return update, 1000
I bumped up the loop rate, that will make more responsive. If your feeling fancy you could also read the min pwm out of the param for that servo output.
That tightens it up nicely. This is the first code I’ve written since 2004 when I did coding for a living… definitely going to play more and exercise this old brain. I’m using v4.2.0 Dev so I will make changes suggested.
I just proced to autotune the Roll Axis ( precisons by @hwurzburg & @Satoru_Sasaki some days ago) with the function Q_AUTOTUNE_AXIS = 1
In my case, the AUTOTUNE sequence was succesful, but the values founded by autopilot was not good . If somebody are interesting , this is the logs : https://drive.google.com/file/d/1swKC0D8tUUxk7rL1c9HtE5658vzDQP1u/view?usp=sharing
If somebody can help to understand why the news values are not good , I’ll take it
After update to with V4.2.0dev (2251293e) version, made a manual tune, find and set Q_TAILSIT_DSKLD value, yesterday I made : the first sucesfull sequence QSTABILIZE > FBWA > QHOVER > LANDING THANKS TO ALL COTRIBUTORS, GREAT JOB
your transition angle is 45deg, with a target rate of 50deg/s of up pitch for the transition which you are not getting ,so it times out after ~1.4sec when you have only reached <20 deg up pitch…it then goes into QHOVER and drops the throttle a bit since you are still coasting up in alt a bit…this compounds the problem of getting the nose up to 90deg…you start to drop in alt so QHOVER raises the throttle to stop the drop, while you raise the stick demanding even more climb rate…this creates enough airflow that the elevons now get effective and pull the nose to 90deg and you hover…my guess is that your elevons are too small…
issues: your control effectiveness is low raising the nose to 90deg for VTOL and can only command a low up pitch rate in the initial part of the transition, so it times out…
you can lower the backtransition angle to 20 degs, but you will still be in the same boat…I think you need to increase the area of the elevons…for a non vectored tailsitter they are usually 33-50% of the wing chord to obtain sufficient control effectiveness…you can also fly much faster in fixed wing before the transition, but that will also create zooming…and not having enough control authority will bite you when you try to move in VTOL modes…pitch is especially susceptible to getting the “leans” in hove where you pitch it forward or back to move and it gets “stuck” and cant be brought back to 90 deg unless you give it high throttle to increase the airflow over the control surfaces…this is why vectored thrust is popular since it gets a lot of direct control for pitch and yaw
Hi @melc good to see the progress. Looks like you lost control during QHover descend in the second flight. Log shows elevon saturated and AP cannot correct then.
Q_A_THR_MIX_MAX and Q_A_THR_MIX_MAN to 0.9
This set throttle vs attitude control prioritization to high. Throttle will kick in when the plane lost attitude to recover.
Check Eclipson E VTOL thread and other VTOL Plane threads for detail.
Good to see the progress. I see you had scary moment in the first 15 seconds until you exit to FBWA. Noticed you have very PWM range set for RCOUT.C4, 900 to 2200. Does the servo really move to that?
One advice I got that could apply here is to raise q_a_rat_yaw_I and Imax, as high as 1. I see you struggled to point wingtip to the wind a few times?
I see you had scary moment in the first 15 seconds until you exit to FBWA
yes, strange, but with 4.2dev version, the wing it’s like a spinning-top, it’s a real joke , at the limit of the fun / afreid ! I really think this experience very interesting and Great Thanks of the DEV IMPLEMENTATION EFFORTS
Noticed you have very PWM range set for RCOUT.C4, 900 to 2200. Does the servo really move to that?
HI to everyone!
I’m going to make a Duo Tailsitter with vector thrust, and also is a Belly sitter. I start developing using PX4, I’m new with Ardupilot because this Airframe Configuration is not support by PX4. But I see works almost the same way or exactly the same.
My question is, any recommendation related to parameters of this configuration, what are the most important ones, I already read all the documentation from the Ardupilot related to Tailsitters, but the expertise of you devs sometimes is more important that the documentation.
looks like a bit larger version of one of mine: C1 Chaser TVBS conversion
doing a comparison of the Q_ params might give you some insight…if you use the “latest” ArduPlane firmware there are some new params like Q_TILT_ENABLE and Q_TAILSIT_ENABLE that need to be set to 1 since they now hide the tilt and tailsit parameter tree…
Awesome! Perfect, yes I see that some are hide and I need to set 1 both and then reboot to be available that extended parameter tree, I’ll let you know my advances to everyone!
Thanks a lot!
Battery: LiPo 4S 6000mAh 25C, Li-ion 4S 10500 mAh 25C
I already do the Bench test, I have all the orientations and movements in the correct direction, about flight modes, which ones you recommend me? And about the PID tunning, what parameters you believe are the most important?