MicroPilot

MicroPilot Autopilot Users Group

Hello Everyone!

I try to run the autopilot MP2128HeliG2 in trueHWIL setup. After load a simulation to the xPC Target computer I run the Autopilot and I got a lots of errors from sensors. The message gathered from Terminal is:
[1B][2J[1B][0;0HFATAL ERRORS:
Watchdog CRC Mismatch[1B][K
x accl failed [1B][K
Accl Temperatures Failed[1B][K
GPS config error[1B][K
Compass is enabled but is not installed.[1B][K
[1B][K
WARNINGS:
Autopilot loaded with non-release code.[1B][K
[1B][K
Lockd 11.3V 0.0V
spd= 17
z acc=854
compass hdg=0 0 0 0
I tried to run the calibration trueHwil Control Centre program to calibrate sensors. When I load the callibration_2128.thprj file and tried to load it to run the simulation I got the error of different numbers of parameters between downloaded model to target PC and parameter file. In result I cannot load the model to xPC Target computer to run the calibration. In xPC Target I have this message:

Download started...
Download finished
Mismatch between model and kernel versions


Is the calibration proces necessary for those Horizon fatal errors? If Yes then how I can solve the problem with calibration program problem? 

Thanks for any advices
Regards

Janusz

Views: 1298

Attachments:

Reply to This

Replies to This Discussion

Hi Janusz,

Let's trace the altitude VOUT signal from the sensorless autopilot to the analog interface board.

Sensorless autopilot green 16 pin connector pin 12 is altitude Vout. This goes to J19 pin 2. Then J24 pin 2. This goes to the analog acquisition board. It comes out of the analog acquisition board on J28 pin 2. Then to J31 pin 4. Then J32 pin 4. Then in to the front of the analog interface board. Then out the back on J30 pin 22. See if you have voltage on all these lines.  

Hi Kevin,

I measured those values of voltages on those plugs:

J19 pin 2 - 3.83V

J31 pin 4 - 5.85V

J32 pin 4 - 5.85V

J30 pin 22 - 16mV

Did those voltages levels are acceptable or something is out of range? 

And one additional explanation. The last measurement was checked on the plug at back side of analog interface after unplug the NI SH68-68-D1 Cable. When I measured the voltages directly on the NI SH68-68-D1 Cable from NI PCI-6702 card then on the pin 22 we have 5.86V. 

Regards

Janusz

Hi Janusz,

Those voltage levels are acceptable. 

Hello Kevin,
It's good news. So we can assume that the Analog Acquisition Board, Analog Interface and NI PCI-6703 generate proper voltages, at least on this chanel. Can we check other elements of TrueHWIL system in similar way? Or have you some other propositions what we could check to push the calibration properly?

Regards,

Janusz

Hi Janusz,

MPFID_PRESSURE_ALTITUDE in the calibration log refers to field [pAltitude, 1274]. 

Open Horizon, open the VRS editor, select THWIL_Fixed_Wing.vrs. Go to the datalog tab. For "Display custom fields" select 25-48. In custom field #1 enter 1085. In custom field #2 enter 1274. In custom field #3 enter 1063. Click save file. Exit VRS editor. Transmit this .vrs file to your autopilot. Power off the autopilot. 

Please perform the calibration of the altitude only again. But this time, before you click "Start calibration", open Horizon and connect to the autopilot. Let's assume you use UAV-01 to connect. Then go to tools, sensor monitor. In sensor monitor, go to setup, configure sensors, select sensor 1, in the field ID box, type 1085 and click add. Select sensor 2, in the field ID box, type 1274 and click add. Select sensor 3, in the field ID box, type 1063 and click add. Click close. In the sensor monitor window go to tools, start logging, datalog viewer format. Then fake the GPS by double clicking on the GPS indicator in the bottom of Horizon. It should turn yellow. Wait until the ready indicator in the bottom of Horizon is green. It might take a minute or two. Take a screenshot of the sensor monitor window and save as "Before calibration". Keep Horizon open.

Then click start calibration. Then connect to UAV-01 via the TCP/IP link. It should be the 2nd option in the list.

While it's auto-calibrating, look at fields 1085 and 1274 in the sensor monitor and the altitude in the monitor of the target PC. You should see both change with the simulink output. Take some more screenshots of the sensor monitor window and save as "During calibration 1", "During calibration 2", etc. Check the voltage on the sensorless autopilot green 16 pin connector pin 12 during the calibration. Let me know the results.

After the calibration, close Horizon. Send me the calibration log. Send me the sensor monitor log which can be found here: C:\Program Files (x86)\MicroPilot\Horizon3.7\logs. It will have a filename like this: UAV-1_sensorlogYYYYMMDD_HHMMSS.txt and UAV-1_sensorlogYYYYMMDD_HHMMSS.text. Send both these files. 

Then using the datalog viewer, download the datalog, VRS, and fly files from the autopilot. Then go to file, export as .zip and send me this .zip. 

Hello Kevin,

I performed this experiment twice, with a little different results, and both of them weren't the results that we were waiting for. I sorted files from those experiments in two separated packages. First of all I don't understand what You mean by: "For "Display custom fields" select 25-48.", in first Zip package I put the print screen from VRS Data Log setup, and I didn't see there anything similar to this. I added only the required custom fields. Next in Horizon I added all three sensors in sensor monitor and I started logs. But I had problem with Ready indicator in Horizon, 6 minutes after pressing the fake GPS this indicator was still Red (You can see it in the picture "2023_11_15_Before calibration"). So I run the calibration without it. In a result the ALT parameter oscilate about 13773 +- 3, and other two sensors was equal 0 during all 100 iterations, in Target PC the values of Altitude was also constantly 0. At the end of this experiment I could not download files from autopilot with logviewer (I got the error presented in 2023_11_15_DataLog_Viewer_error.png file). Logs from sensor monitor You have in zip package. 

Today I tried a little different approach, i used Terminal after power on the autopilot to apply the fake gps command. And then i switched to Horizon program to run sensors monitor. With this the Ready Indicator was green. I started the sensor monitor logs, and I run the calibration. The results are in second Zip Package. The MPFID_PRESSURE_ALTITUDE starts change its values, and Kount also starts increasing it values. But even with this at the end the altitude parameter didn't convergent. Gain value increased infinitelly. The details You will see in logs. After calibration I still cannot download files from autopilot with logviewer. And in Target PC the altitude parameter was still constantly 0.

But I figureout one difference in cable configuration based on Your description. I checked again the Green 16 pin connector and verify the order of pins with J19 plug, and there is difference:

J19 pin <--> Green 16 pin (wire color) --> Voltage

1  <--> 15 (black) --> Ground

2 <--> 14 (red) --> 3.83 V

3 <--> 11 (green) --> 2.5 V

4 <--> 13 (brown) --> 0 V

5 <--> 12 (blue) --> 2.48V

So the voltage from pin 12 at Green 16 connector i checked previously on inproper wire. Now during calibration the voltage on the J19 pin 5 was equal 2.48 V. Is this difference could be corrected in matlab model or in pins configuration. Or we should rearange the order of wires phisically? Could we check somewere the correct pins order for those wires? I checked only conductivity but i see that this could be more sirious problem.

Best regards,

Janusz

Attachments:

Hi Janusz,

"First of all I don't understand what You mean by: "For "Display custom fields" select 25-48."

You are using an older version of Horizon which doesn't have this setting. What version of Horizon are you using? Go to help, about. I believe you are using firmware 3.7.2212.0 so your Horizon version should match that. Do you have a Horizon 3.7.2212.0 installer? 

Regardless, you can replace field 2325 with 1085, replace 2326 with 1274 and replace 2327 with 1063. 

" I added only the required custom fields. "

I see you added 1085, 1274 and 1063 under "Customer data log header fields". This is incorrect. Please remove them from there by entering zeros.

"But I had problem with Ready indicator in Horizon, 6 minutes after pressing the fake GPS this indicator was still Red (You can see it in the picture "2023_11_15_Before calibration")"

Since the option "Do not erase the data log until it has been downloaded" in the VRS Datalog tab is enabled, the autopilot will not become ready until you download the datalog or mark it as downloaded by going to Horizon then Autopilot at the top then "set datalog as downloaded". Then the "Warning: Datalog not downloaded. The autopilot will not initialize: 1" will be cleared and the autopilot should initialize and ready should turn green.

"So I run the calibration without it. In a result the ALT parameter oscilate about 13773 +- 3, and other two sensors was equal 0 during all 100 iterations"

This is expected since the autopilot wasn't ready. Don't even bother running the calibration if the autopilot isn't ready because it won't work. 

"At the end of this experiment I could not download files from autopilot with logviewer (I got the error presented in 2023_11_15_DataLog_Viewer_error.png file). Logs from sensor monitor You have in zip package. "

This is happening because your Horizon version is older than your firmware version. You'll have to upgrade your Horizon version to 3.7.2212.0.

"But even with this at the end the altitude parameter didn't convergent."

Can you send the calibration log? 

The sensor monitor log shows ALT and Pressure altitude changing which is a good sign. 

"Is this difference could be corrected in matlab model or in pins configuration. Or we should rearange the order of wires phisically? Could we check somewere the correct pins order for those wires?"

First of all, your J19 to green 16 pin assignments are incorrect.

J19 pin 1 goes to green 16 pin connector pin 14 (ALT_GND, black wire)

J19 pin 2 goes to green 16 pin connector pin 12 (ALT_Vout, red wire)

J19 pin 3 goes to green 16 pin connector pin 6 (SPEED_VP, green wire)

J19 pin 4 goes to green 16 pin connector pin 10 (SPEED_GND, brown wire)

J19 pin 5 goes to green 16 pin connector pin 8 (SPEED_VN, green wire)

See attached picture.

I measured the voltages on our system while it was flying:

J19 pin 1 = 0 V

J19 pin 2 = 3.76 V

J19 pin 3 = 2.56 V

J19 pin 4 = 0 V

J19 pin 5 = 2.56 V

These are close to your voltages so I don't see an issue with your voltages so there's nothing to worry about here. 

Attachments:

Hello Kevin,

Good news, after update the Horizon program to the newest version the calibration process finished with success. I send You the all logs files with print screens. Also I performed the calibration of the rest sensors and this also finished with new parameters values, I added also the log file from calibration proces. During calibration process the values in TargetPC change according with the values in TrueHWIL_CC calibration program. So after all of those problems i'm glad that this part works. So now should we go back to 2015b_THWIL_2_Heli_with _GPS_ACK project? Or You propose to check other parameters for our Fatal errors that we have in Horizon program?

Best regards

Janusz

Attachments:

Hi Janusz,

That's great news! 

"So now should we go back to 2015b_THWIL_2_Heli_with _GPS_ACK project?"

Yes. Let me know the results / what errors you get. You can copy/paste the error monitor output. Remember not to fake the GPS. It should get a lock by itself if everything is working correctly. 

Hi Janusz,

And remember to load THWIL_Heli.vrs and THWIL_Heli.fly to the autopilot.

Hello Kevin,

I uploaded the latest THWIL_Heli.vrs and THWIL_Heli.fly to the autopilot with the help of Horizon 3.7. When I tested the vrs file before transfer to autopilot there weren't any errors. I copied the prm file after calibration to the 2015b_THWIL_2_Heli_with _GPS_ACK project and i went with the whole start procedure. In result I got those errors in Horizon program:

 2023-11-22 00:23:26 Computer battery state is normal.
2023-11-22 00:23:26 Warning: Autopilot loaded with non-release code.: 7
2023-11-22 00:23:27 Autopilot not ready!
2023-11-22 00:23:28 Runtime error: Timeout with GNSS fix rate settings
2023-11-22 00:23:28 Fatal error: AGL is out of range (could be on a bench).: 15
2023-11-22 00:23:28 Fatal error: GPS is configured incorrectly or not plugged in.: 52
2023-11-22 00:23:28 Fatal error: Pitch gyro is broken.: 90
2023-11-22 00:23:28 Caution: RC Failure Pattern is Disabled
2023-11-22 00:23:28 Caution: GPS Failure Pattern is Disabled
2023-11-22 00:23:28 Caution: GCS Communication Failure Pattern is Disabled

Every time the GPS couldn't lock even after 20 minutes of waiting. So something is still improper. When I run the calibration project the Pitch gyro was Ok, but in THWIL_2 always gives us an error. 

2023_11_21_Horizon_screen.png

RSS

Share

© 2024   Created by MicroPilotNingAdmin.   Powered by

Report an Issue  |  Terms of Service