AQ Simulator (HILS) info/discussion

Ground Stations and utilities for Windows, Linux, Android, & others

Re: AQ Simulator (HILS) info/discussion

Postby Max » Sat Apr 30, 2016 4:38 am

Hi Angel,

afernan wrote:I´ve tested "jMAVSim-v160406" and "jMAVSim-v160409" and in both I got circling.

OK, the newer versions (0412+) should be working better at least on faster systems which can handle more concurrent threads. So that result makes sense.

afernan wrote:But the "good" version I have is also "jMAVSim-v160409" but dates are different:
- bad jMAVSim-v160409 is from 9-04-16
- good jMAVSim-v160409 is from 12-04-16 (the first you´ve send me)

Looks like I neglected to update the version number before sending to you. The latter should be similar to (or same as) the v160412.1 release. Which is now superseded by v160424.0 (latest). :)

Thanks,
-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: AQ Simulator (HILS) info/discussion

Postby Max » Sat Apr 30, 2016 4:39 am

More on performance tuning:

The two main jMAVSim options which can affect performance in the latest releases (v160412.1+) are:

  • -r <Hz> - This is the rate at which the simulated world gets updated. This should mostly affect CPU load on PC. Default is 400Hz.
  • -rs <Hz> - This is the rate at which the simulated IMU readings are sent to AQ. This can directly affect stability/precision of AQ control. Default is 400Hz. Increasing this to 600 or 800 Hz may considerably improve stability. (This is basically like "oversampling" the IMU inputs which can provide a steadier average.)

Also, adding -no-gimbal to the startup options will improve performance on the PC side.

-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

v160430.0 - starting position option

Postby Max » Sat Apr 30, 2016 8:50 pm

You can now easily set a geographic location of your choosing when starting the sim. You could plan a real mission, fly it in the sim, then verify the altitudes/etc in Google Earth (either right in Windows QGC while flying, or by exporting a log file to KML format).

The new options are
Code: Select all
-pos Lat,Lon,Alt
-mag Incl,Decl


Example usage:

Code: Select all
java -jar jmavsim_run.jar -serial COM4 2400 -pos 42.533037,-76.6452384,287.25 -mag 68.53,-11.94

Those are all in decimal degrees (except altitude which is in meters). The mag inclination/declination has to match the location. Note, no spaces between the commas.

You can also look up the mag field automagically (assuming the PC is online) by using "-automag" option, like so:

Code: Select all
java -jar jmavsim_run.jar -serial COM4 2400 -pos 42.533037,-76.6452384,287 -automag

Remember to set the AQ mag inclination/declination params to match. Inclination needs to be reversed in AQ settings, as usual. You can always check the current sim settings by showing the reporting panel ("R" key while in the sim).

https://github.com/mpaperno/jMAVSim/rel ... /v160430.0

Cheers,
-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: AQ Simulator (HILS) info/discussion

Postby afernan » Wed May 04, 2016 10:33 pm

Hi Max: I´ve test the version "jMAVSim-AutoQuad-v160430.0".
Same results for me: all working fine, except the "Toileting" in PH but only in my LapTop i7, but not in the NUC i5 that works fine (as before).

I´ll try other M4 I have to see if it repeats this behaviour. Is it possible to compile the aq fw for v6? so we can search for other clue.

Angel
afernan
 
Posts: 1214
Joined: Sat Jul 07, 2012 5:24 pm
Location: Madrid, Spain

Re: AQ Simulator (HILS) info/discussion

Postby chschmid » Thu May 05, 2016 1:23 pm

Hi Max

Supercool. I flew a bit this morning. Thanks for the huge effort to make this happen.

A special remark on the Incl/Decl. I used the values for incl directly from AQ (= *-1). This screwed the sim. Use unchanged values.
How did you say to connect GCS. Is there a way to share the USB connection or listen/send at the JMavSim side?

Cheers
Christof
chschmid
 
Posts: 1800
Joined: Wed Jul 11, 2012 7:41 pm
Location: Herrliberg, Switzerland

Re: AQ Simulator (HILS) info/discussion

Postby LPR » Thu May 05, 2016 6:53 pm

Christof

I connected an FTDI to the serial port on the M4 and have it connected to the PC. I use USB for the HILS connected to my laptop.

I have some practice on the HILS and now flying in ACRO is quite easy after you get the timing for flips down.

Larry
LPR
 
Posts: 1323
Joined: Tue Jun 26, 2012 1:29 pm
Location: MN, USA

Re: AQ Simulator (HILS) info/discussion

Postby Max » Thu May 05, 2016 8:17 pm

afernan wrote:Is it possible to compile the aq fw for v6? so we can search for other clue.

Hi Angel,

I've yet to test a recent version of HILS with a serial (UART) connection (vs. USB). In my initial tests it didn't do very well at all, but that was many versions ago and pretty much all parts have been re-written since then to improve efficiency.

But I've been meaning to try it, and if you want to give it a shot, that would be great. Firmware attached. It does require some of the DIMU code (and I've never tried running DIMU version w/out a physical DIMU installed).

To use: Basically same as M4 version, but you have to set up the serial protocol on AQ manually.
QGC -> Misc. Settings -> Serial Port (1 or 2): Baud Rate = 230400 (minimum, could try higher); Protocol = "CLI" (never mind the name, it actually forces a HILS connection).

Then when starting jMAVSim, specify the same baud rate as in the AQ Serial Port settings (vs. always 2400 for USB). And of course the correct COM port which your TTL adapter is connected to.

Don't use the same HILS COM port for regular Mavlink telemetry, it won't work. A separate serial link is still required for that.

afernan wrote:... all working fine, except the "Toileting" in PH but only in my LapTop i7, but not in the NUC i5 that works fine (as before).


As for the i7 laptop being slower than the i5 NUC, my guess would be that there's some process, peripheral (driver) or power save feature preventing the system from performing better. That seems like the only logical explanation at this point. As mentioned, Larry is running it on some "ancient" Core Duo machines, so I don't think CPU is major a bottleneck. Are you getting 60 FPS on the i7? I know the graphics driver settings on my i3 NUC can affect the performance quite a bit, even w/out being obvious visually (eg. the rendering quality in JMAVSim looks the same).

Cheers,
-Max
Attachments
aqfc-mp-v7.1.1924-hwv6.1-dimu1.1-quatos-hils.zip
Experimental version for HILS on AQ6/DIMU. Note this version contains changes to nav functions which are not fully tested. Among other things, adds support for "go to" feature in QGC map view (r-click on map).
(156.54 KiB) Downloaded 111 times
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: AQ Simulator (HILS) info/discussion

Postby Max » Thu May 05, 2016 8:32 pm

Hi Christof, glad you like it!

Yes as Larry says, just use a separate serial connection for telemetry data (BT, wired FTDI, XBee, whatever... I mostly use an M4 on an N4 w/on-board BT).

Even though jMAVSim has a Mavlink pass-through feature (eg. to forward all messages to QGC via UDP), it's not useful for AQ because the HILS connection type doesn't send any of the normal telemetry data, only what is required for a stable HILS. Actually using Mavlink for HILS at all is a temporary convenience and will probably be replaced by a more efficient protocol in the future.

The fact that we have to reverse the mag. incl. setting in AQ is a bit absurd... I wish there was an easy way to change that requirement at this point. Only clean way I can think of would be replacing the existing param with a new one, but that's still far from ideal.

Cheers,
-Max
Max
 
Posts: 2814
Joined: Mon Aug 13, 2012 9:45 pm
Location: Near Ithaca, NY, USA

Re: AQ Simulator (HILS) info/discussion

Postby afernan » Fri May 06, 2016 5:41 pm

Thanks Max: I´ll try that along this WE. Yesterday I tested on a different M4 board (my first M4, so v1, r8.5) and performed the same than before in both NUCi5 and LapTopi7. So same behaviour in M4v2 (8.6) and M4v1(8.5)

In the LapTop (HP-Spectre X-360 i7) I get 64fps in full screen and similar in a medium size window.

Angel
afernan
 
Posts: 1214
Joined: Sat Jul 07, 2012 5:24 pm
Location: Madrid, Spain

Re: AQ Simulator (HILS) info/discussion

Postby afernan » Sat May 07, 2016 6:36 pm

I´ve tested with a aqv6.1 using FTDI cable to serial port 1 at 115200 and 230400 bad. It oscilated a lot but I still could fly, even doing a PH (although very bad). Much better with 230400 that with 115200.

Short video here: https://youtu.be/mNbu9dxGifw

Angel
afernan
 
Posts: 1214
Joined: Sat Jul 07, 2012 5:24 pm
Location: Madrid, Spain

PreviousNext

Return to AQ Software

Who is online

Users browsing this forum: No registered users and 4 guests

cron