I am trying to make a foldable quadcopter for a competition. The competition consists of launching a rocket to an altitude of 5000ft, where the payload (or in this case, quadcopter) will be ejected, where 4 arms will fold out of the shell and will need to guide itself to a landing zone.
We are unsure of a few things though. Obviously, we cannot have the quadcopter running while it is inside the rocket, so we plan to use a photo-resistor to tell the quadcopter to start doing its thing (i.e fold arms out, boot and run controller) after ejection but would something like this be feasible to do with a pixhawk controller? I read that most drones require calibration on the ground before taking off, and obviously something like this isn’t realistic for us. Does this also affect us too?
Are there any other potential problems we might face if we do find a controller that can do what we want?
So PX4 does not do (or require) calibration before each flight meaning you should be able to calibrate it beforehand.
However, the estimator (e.g. EKF2) on PX4 requires some time to initialize, as well as the GPS needs some time to get a 3D lock. Therefore it would take too long to boot PX4 mid-air. Instead, you should be able to initialize everything on ground and then arm PX4 once the arms are unfolded, etc.
This might still be tricky because the estimator might not be tested/tuned for high accelerations that you might encounter. Also, the tuning on 5000 ft might be slightly off due to the thinner air.
That’s a good point. The payload should be seeing a maximum of 10gs on the flight. Not sure if this would mess anything up with the fc, sensors, or motors.
Sorry to start this old topic again. Just to confirm
@JulianOes Does it mean the biases are only set once during calibration and then corrected by the EKF? I know other FCs, which average the first hundred readings to get the bias starting value. This strategy would not be possible with the thread owner’s project. Would that mean, once calibrated at rest and booted up on a moving platform the code could cope with that ? ( Of course the Gs should be in a reasonable range as well as the rates).
Yes, the EKF can start while moving and will adjust the IMU biases using the other sensors while running; it doesn’t need to be completely static to initialize.
However, the measured gravity should be ~1g ±20% for the coarse tilt alignment to pass (so it can’t start during free fall for example).
@bresch@JulianOes Awesome, thanks for confirming. Do you have any recommendation on how to improve the tilt alignment in that scenario? E.g. in that rocket scenario I might have a carrier state estimator, is there any way to use the carrier’s orientation as initial value or would this require some custom modification?
Transfer alignment is something commonly done in the aerospace industry for sub-vehicles but it’s currently not possible in PX4. I don’t think it would be difficult to do; just need to send a message (e.g.: through mavlink) with the current attitude/vel/pos.
Otherwise, why not starting the autopilot before takeoff, place the drone in a pre-armed state (like when in throw-launch mode) so it can directly fly when released. This is IMO a safer approach as you can ensure everything is in a sound state before takeoff.
@bresch TA is exactly the thing I’m after. I’m just wondering what would be the least invasive modification in the original code base. I think running an external alignment filter could be the way forward, as I can directly consume all subsystem’s standard Mavlink messages, as well as the master ones. The missing puzzle piece is, how do I feed my converged TA filter solution into the PX4 EKF (e.g. via Mavlink)? Is there any existing functionality I could use?
Initializing before flight is, of course, also a very nice solution, of course with it’s drawbacks.