Accelerometer measuremet of pixhawk 6X using UWAV Toolbox Support Package for PX4 Autopilots, MATLAB 2024a

I'm now trying to setup the pixhawk 6X using UAV Toolbox Support Package for PX4 Autopilots (ver. 24.12).
I successfully finished the hardware setup.
Next, I created a simple simulink file as below.
I connected the hardware and tried to see the measurement values, but I could not find the values.
(The displayed values are zero.)
Please tell me how to solve this problem.

답변 (2개)

To help you solve the issue, I would recommend you go through the documentation for deployment on unsupported PX4 Autopilots from Simulink:
You might also want to have a look at this MATLAB Answer:
If the issue persists, there can be various reasons of encountering zero value while monitoring accelerometer, few things you might want to check includes:
  1. Ensure that the accelerometer sensor on the Pixhawk is calibrated correctly.
  2. Use QGroundControlto verify that the accelerometer data is being published correctly by the Pixhawk.
  3. Ensure that the sample time of the PX4 accelerometer block is set correctly.
Hope this helps.

댓글 수: 1

Thank you so much for your kind response.
The controller 6X may be officially supported in the supported package 2023a and later according to the second url you suggested.
I could check the sensor response from the QGroundControl and the sensor may be correctly working.
The output of the status pin of the PX4 Acceleometer block is always 1, therefore, I think the values cannot be updated.
If you know how to make the status be 0, please let me know it.
Thank you,

댓글을 달려면 로그인하십시오.

When the hardware setup process using the hardware setup screens is almost finished, there is a screen at the end called "Test Connection" where you upload the PX4 Firmware to autopilot and fetch accelerometer data. Can you confirm if you could see the accelerometer data during Test Connection? Also, how are you running the Simulink Model? Is it deployed via Monitor & Tune OR it is running over Connected IO?

댓글 수: 19

Thank you for your response.
I confirmed "Test Connection" but could not get the accelerometer data as the following window.
According to the warning message, the PX4 Autopilot is in HITL mode. I don't know how to change the mode.
The simulink model is run over connected IO.
Your board has been configured in HITL mode from QGroundControl previously. in HITL mode, all onboard sensors are disabled, hence you are not getting any values when you run Connected IO simulation in Simulink. To remove the HITL mode,
  1. Connect the Pixhawk 6x board to QGC.
  2. Once the QGC is conneted, navigate to the parameters, search for SYS_HITL and set 0 as parameter value or HITL disabled.
  3. Restart the board
  4. Alternatively, you can select any non-HITL airframe in QGC and appy to the board
Thank you for your response.
I have already confirmed that the mode was "HITL and SIH disabled" in QGC.
The attached screenshot is the indication in QGC safety tab. (I'm sorry that the indication is written in Japanese.)
Is it correct setting?
Can you select any non-HITL airframe in QGC and then try?
I tried the experiments with the options "external HITL", "HITL and SIH disabled", and "SIH enabled (it maybe non-HITL)", but the problem has not been solved.
What is the aiframe selected in QGC?
I selected Quadrotor x (Generic Quadcopter).
okay. navigate to the MAVLink Inspector tab in QGC. Can you see if there is a MAVLink message called HIGHRES_IMU? If yes, what are the values in the x,y, and z field of the message. You can attach a screenshot of the MAVLink inspector tab here
I attach the screenshot of the MAVLink inspector.
The sensor values seem to be correct.
okay. seems like the board is not in HITL mode then. Can you try running the Connected IO simulation in Simulink now?
I tried to do the connected IO simmulation, but unfortunately nothing changed.
I tried to confirm the other sensor values using "uORB Read block".
The SensorGyro could not be measured as the same result as the accelerometer (status was always 1), but the SensorMag could be measured as shown in the below figure.
The problem syndrome you are mentioning seems similar to the PX4 bug discussed here, but since we dont see the issue with the Pixhawk 6x board we have, we are unable to verify this. Can you make the PX4 Firmware change for the above issue as mentioned here in your clone of PX4 Firmware? Basically, you need to increase the timeout to 1000ms from the current 500 ms. Once you do that, run the PX4 hardware setup screens again for your board and try Test Connection in setup screens or Connected IO simulation.
I increased the timeout to 1000ms, but the problem was not solved.
After that, I tried to increase it to 5000ms, but nothing changed.
In the hardware setup, when I did the test connection by clicking the button "Get Accelerometer data", I had the warning as shown in the below screenshot every time.
Shold I first solve this problem?
I also tried to do the other controller Pixhawk 4.
The simulink program is the same as one used in 6X and I could measure the accelerometer values.
(The timeout is 5000 ms.)
Therefore, the software of the test environmet may be correctly configured.
The problem occurs when I use the 6X controller.
Thanks for running the experiment. Can you reach out to MathWorks Technical Support with your issue?
OK. I will ask MathWorks Technical Support for the solution of this issue.
Thank you very much for your suggestions.
Were you able to solve this issue? I'm trying to resolve the same error.
Yes, I could solve this issue by updating both the MATLAB version and Autopilot version.
I am now using MATLAB 2024b and Autopilot 1.14.3.
Thanks for your response. Now its working.

댓글을 달려면 로그인하십시오.

제품

릴리스

R2024a

질문:

2024년 8월 9일

편집:

2025년 1월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by