PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.26k stars 13.42k forks source link

Catapult launch: Motor delay not working #18416

Open jstrebel opened 2 years ago

jstrebel commented 2 years ago

Hi I need to open this ticket again. Initial ticket was: 18354 (it was closed. I can^t change it back via the Web GUI)

PX4 (SW 1.12.3 / HW holibro pixhawk 4)
The Motor starts immedialtely after launch is detected.
This causes damage to the propeller, because it hits the catapult.
Actual behaviour:
If Accelerometer threshold > LAUN_CAT_A then Motor starts immediately
Expected behaviour:
If Accelerometer threshold > LAUN_CAT_A then Motorstart is delayed by value of LAUN_CATMDEL waits then motors starts. Parameters: LAUN_CAT_MDEL and LAUN_CAT_T have no effect. Motor startup is not delayed as expected.

The log is made with Master https://review.px4.io/plot_app?log=06b779a9-95b5-4413-a82f-d4f5734ed81d 
It was working in 1.9.1

dagar commented 2 years ago

@Jaeyoung-Lim does this work in gazebo?

Jaeyoung-Lim commented 2 years ago

@dagar I think we weren't testing time delays in gazebo, but I can give it a try if we can surface the issue in there.

Jaeyoung-Lim commented 2 years ago

@dagar Gazebo catapult launch is broken in gazebo: https://github.com/PX4/PX4-SITL_gazebo/issues/818

jstrebel commented 2 years ago

@dagar as discussed yesterday in the call. I did a test with the current master (28oct) the bug is still there. At time 3.18.351 accelleration is detected. Engine starts immediately at 3.18.351. Your uploaded log file is available under: https://review.px4.io/plot_app?log=273b81cc-2bda-452c-bd6a-1d153ce2823e Your help is very appreciated

kevinjhur commented 2 years ago

Hi guys, Is it still remaing issue? Thank you.

ryanjAA commented 2 years ago

Also interested in if this is working.

jstrebel commented 2 years ago

Hello, I just tried 1.13.beta1. Bug is still present. @dagar . Thank you for takng this up.

Jaeyoung-Lim commented 2 years ago

@dagar Somehow this seems to be fixed in SITL now

sfuhrer commented 1 year ago

I also can't reproduce, it looks correct in SITL with current main. https://user-images.githubusercontent.com/26798987/197636340-16941240-6d50-46c8-80e3-85c99e2d6e76.mp4 Simulated with make px4_sitl_default gazebo_plane, LAUN_ALL_ON = 1 LAUN_AT_MDEL=5 LAUN_CAT_T=1 LAUN_CAT_A = -10 (to trigger "acceleration detected" when still on the ground here for testing) RWTO_TKOFF = 0

jstrebel commented 1 year ago

Hi here is the promised log. Motor starts immediately powering up when I switch to Mission mode. SW vesion main dated 26Oct

https://review.px4.io/plot_app?log=1e9bf8c8-de84-4d00-83b2-1e4cb160e8a2

Description: Launch detection test Feedback: Launch detect not working Vehicle type: Fixed Wing Airframe: Generic Flying Wing, Flying Wing Hardware: PX4_FMU_V5

sfuhrer commented 1 year ago

Thanks for the test @jstrebel ! In your log I see that the max acceleration in x measured by the system is only 4, while your set threshold is 8. And are you sure the motors powering up immediately on switching to Mission mode? Because I don't see that in the log, the thrust in x stays 0 the whole time, and also the info messages don't say anything about that the launch is detected and the motor is powering up.

image

I actually went trying it out myself yesterday, and for me it worked. With current main on a Pixhawk4 based electroglider. My colleague shook the plane, the motors spooled up 0.5s later, he threw it and it did the climbout and mission. My settings are:

https://review.px4.io/plot_app?log=eed31b3c-56f2-4182-af02-167c82d74efd image

https://user-images.githubusercontent.com/26798987/198523647-aefb5af5-f890-4cc3-8769-ac6739bb3ee0.mp4