HILSIM on UDB5

190 views
Skip to first unread message

Leonardo Garberoglio

unread,
Jan 10, 2016, 3:56:39 PM1/10/16
to uavde...@googlegroups.com
Hi, I'm trying to setup a hILSIM on a custom UDB5 board.

First I have some doubt:
I'm using branch MatrixPilot_wjp_helicalTurns. Is it ok?
What kind of GPS do I need to configure? I saw this options.h file https://github.com/MatrixPilot/MatrixPilot/blob/MatrixPilot_wjp_helicalTurns/MatrixPilot/example-options-files/options.HILSIM-Cessna-ben.h and saw that it is GPS_UBX_4HZ, so I use that is this ok?

I conect my Rx receiver on input channel 1 and configure PPM input (I have 8 channel Tx and PPM receiver).

Is the prebuild plugin on https://github.com/MatrixPilot/MatrixPilot/tree/MatrixPilot_wjp_helicalTurns/Tools/HILSIM_XPlane/prebuilt-plugins ok or I need to build the C project?

I configure X-Plane the same way that the wiki and use this file for X-Plane config:
https://github.com/MatrixPilot/MatrixPilot/blob/MatrixPilot_wjp_helicalTurns/Tools/HILSIM_XPlane/HILSIMSetup-Simple.txt (renamed to HILSIMSetup.txt)

I attached my options.h and HILSIMLogFile.txt

When I start X-plane and reset udb board, green led is on (radio link ok), red led toggle for a couple of second, then servos waggle once, red led turn off and nothing else.
I connect my oscilloscope on uart2 (gps will be on uart1, right?) and saw a lot of data coming out of udb board. I check Tx on USB-TTL converter and there is a 3.3 V and no data.

any help will be much apretiate!

br, Leo
HILSIMLogFile.txt
options.h

Peter Hollands

unread,
Jan 10, 2016, 5:35:35 PM1/10/16
to uavdevboard
Hi Leonardo,

HILSIM with branch MatrixPilot_wjp_helicalTurns is probably the most tested HILSIM of the last year. Both Bill and myself completed a great deal of testing with that branch,
and with Bill's help, and the original author of X-Plane 10, we fixed a long standing and important bug in the C++ code for the HILSIM plugin to correct the orientation of accelerations.

You should look back on the commit log for that branch to check that the standard supplied binary for X-Plane 10 for Windows was updated by Bill last year, after we made the fix.
If not, then you really should get a new binary compiled for the HILSIM plugin. HILSIM will work with the old binary from before the fix, but it will introduce some slight errors in orientation for the UDB / DCM.

Using GPS_UBX_4HZ is correct.

The HILSIMLogFile.txt shows that your PC and X-Plane10 is not receiving any data from the UDB5.
Opened serial port COM9
Opened UDP server on port 14551
serial read failed
ReadFile() failed
Closed serial port
Closed udp port

Also the serial link from the X-plane 10 on the PC (Windows) to your UDB5 will be into the GPS port of the UDB5. Is that how you have it wired ?
No physical / real GPS will be plugged into when using HILSIM; just the link from the Windows PC on COM9 to the GPS Socket on the UDB5.
You will need a special adapter made up for that. (I enclose a photo of my adapter connected to a UDB4 which is similar to the UDB5 for connection purposes).

The other telemetry serial port remains available for telemetry output (and input when using MAVLink) and is not directly used for HILSIM.

If your wiring is connect, I would suggest double checking that the correct port is actually COM9. 

Best wishes, Pete

P.S. FYI:- I enclose link to  video that I did of the MatrixPilot_wjp_helicalTurns branch working with X-Plane 10. 




--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

20160110_222234.jpg

Philip Giacalone

unread,
Jan 10, 2016, 5:54:19 PM1/10/16
to uavdevboard
Hi guys,

This video of a UDB HILSIM setup might help with the wiring, too. It shows the pin associations between the UDB's GPS port and the FTDI adapter. 

Jump to ~45 seconds in the video below. 


Best regards,
Phil

Leonardo Garberoglio

unread,
Jan 10, 2016, 6:31:03 PM1/10/16
to uavde...@googlegroups.com
Guys, thank for your answers!

I made a mistake, I connect X-Plane to uart2 insted of uart1 (GPS).
I'm using Xplane 9. Now, my connections are ok, I see data from and out to udb board. But I have new problem, after a few seconds my board reboot.
If I disable plugin on Xplane my board works ok, it start, wagle servos once and wait for Xplane (gps lock). I enable plugin and after receive a few data my board reboot

I will check xplane plugin...
must I use xplane 10?

thank again

Robert Dickenson

unread,
Jan 10, 2016, 9:36:34 PM1/10/16
to uavdevboard
I don't expect the version of x-plane will matter. I pretty much always use 9 as it loads so much faster, however 10 should work too. The crashing may be a problem with the MP code, however please ensure you have a good clean power supply before looking for software issues.

Leonardo Garberoglio

unread,
Jan 10, 2016, 9:55:48 PM1/10/16
to uavde...@googlegroups.com
robert how are you?
I test rollpichyaw with 3 servos connected and rotate the board fast from one side to the other. i don't get any reset on that test.
I think that I have something wrong with my options.h or so. right now I don't have reboot on my board but don't get lock from x-plane neither.
I compile plugin just in case, but nothing change.

I test the code without hilsim and with my nmea gps and don't get lock. I know that the gps has fix, but i don't have 4 waggle on servos.

i have a futaba 8up tx and i have to use reverse throttle channel. What will be options configuration in this case?

thank, Leo

Leonardo Garberoglio

unread,
Jan 11, 2016, 5:43:35 PM1/11/16
to uavde...@googlegroups.com
I think I making some progress.
Currently I'm working with MatrixPilot_wjp_helicalTurns brunch without hilsim.
I connect GPS (NMEA, 38400), 5 PWM channel (remove PPM input just in case) and usb-ttl on uart 2.

I have 3 pos switch, but don't know wich channel is it, so I use 2 pos switch on channel 5.
My channel config is as follow:



#define USE_PPM_INPUT                       0
#define PPM_NUMBER_OF_CHANNELS              8
#define PPM_SIGNAL_INVERTED                 0
#define PPM_ALT_OUTPUT_PINS                 0


#define NUM_INPUTS                          5

#define THROTTLE_INPUT_CHANNEL              CHANNEL_3
#define AILERON_INPUT_CHANNEL               CHANNEL_1
#define ELEVATOR_INPUT_CHANNEL              CHANNEL_2
#define RUDDER_INPUT_CHANNEL                CHANNEL_4
#define MODE_SWITCH_INPUT_CHANNEL           CHANNEL_5

#define NUM_OUTPUTS                         4

#define THROTTLE_OUTPUT_CHANNEL             CHANNEL_3
#define AILERON_OUTPUT_CHANNEL              CHANNEL_1
#define ELEVATOR_OUTPUT_CHANNEL             CHANNEL_2
#define RUDDER_OUTPUT_CHANNEL               CHANNEL_4

#define MODE_SWITCH_THRESHOLD_LOW           2600
#define MODE_SWITCH_THRESHOLD_HIGH          3400

I configure MODE SWITCH to TWO POSSITION switch
#define MODE_SWITCH_TWO_POSITION            1


why most options.h have MODE_SWITCH_INPUT_CHANNEL on channel 4 and RUDDER on channel 5?

I configure Console uart and debug io:

#define SERIAL_OUTPUT_FORMAT                SERIAL_NONE
#define CONSOLE_UART                        2

// Define USE_DEBUG_IO to enable DPRINT macro to call printf(..)
#define USE_DEBUG_IO

And I enable #define DEBUG_NMEA on gpsParseNMEA, I do this becouse I want to know if dsPIC get GPS chars and if it parse the chars.

I build and program UDB.
I have a few warning, someone becouse of DEBUG_NMEA, but there is one that always appear and is that I have MIPS=16 selected. Is it a problem?
I must add one more thing. I have 710 dspic insted of 710A, would it be source of trouble?

Well, I connect everithing, reset de board and it start to boot, red led flash, green led is on. After a few second red led turn off, green is on and blue start to blink at the same frequency as the GPS LED, about 1 pps. So dsPIC is recognizing NMEA msg, right?
Then I go to terminal program and get this:
è>â‰C[08]ìÿ:Ô[00]startS()
ent_calibrateS
calib_timer 20 
calib_timer 19 
calib_timer 18 
calib_timer 17 
calib_timer 16 
calib_timer 15 
calib_timer 14 
calib_timer 13 
calib_timer 12 
calib_timer 11 
calib_timer 10 
calib_timer 9 
calib_timer 8 
calib_timer 7 
calib_timer 6 
calib_timer 5 
calib_timer 4 
calib_timer 3 
calib_finished
calib_timer 2 
calib_timer 1 
calib_timer 0 

ent_acquiringS
init_finished

That init_finished msg I printed when dsPIC get lock on GPS, right?

Well, from here I start to get problems. The first thing is that I don't get the 4 waggle. The second thing is that I can move servos with my Tx transmitter, but I cant change flight mode, I switch ON, OFF, ON, OFF switch on chanell 5 and nothing happend on red LED. I can't move from Manual mode. If I turn off my radio green led turn off, but no change on red led...

So I think I have some problem on SWITCH configuration. Any help on it?
am i making some mistake?
is there a way to get message from udb on uart2 that tells me PWM input channel, and flight mode?

thank


Leonardo Garberoglio

unread,
Jan 11, 2016, 6:46:29 PM1/11/16
to uavde...@googlegroups.com
I have to add one more thing, at the end of mcu_init on mcu.c I found this:

#if (CONSOLE_UART != 0)
    init_uart();
    DPRINT("\r\n\r\nMatrixPilot " __TIME__ " " __DATE__ " @ %u mips\r\n", MIPS);
    if (_SWR == 1)
    {
        DPRINT("S/W Reset: trap_flags %04x, trap_source %04x%04x, osc_fail_count %u\r\n",
            trap_flags,
            (unsigned int)(trap_source >> 16),
            (unsigned int)(trap_source & 0xffff),
            osc_fail_count);
    }
#endif // CONSOLE_UART

But whatever I define for CONSOLE_UART on options.h, this block of code is on gray color. And if I press right click over CONSOLE_UART and select Navigate the options "Go to Declaration/Definition" and "Go to implementation" are disabled. So I think that it can't found CONSOLE_UART definition and this code never execute. You could confirm that on the previouse Terminal messages.
In the same file I have red line on _LATE1 and others definitions. The code build and make ok, but I don't know why do I have this unresolved reference...


Robert Dickenson

unread,
Jan 11, 2016, 8:08:05 PM1/11/16
to uavdevboard
i suspect mcu.c is not including options.h

try adding it directly, or via changing

#include "libUDB_internal.h", to

#include "libUDB.h", which i believe includes options.h somewhere along the line.

Robert Dickenson

unread,
Jan 11, 2016, 8:10:27 PM1/11/16
to uavdevboard
i don't think init_finished indicates gps lock has been acquired - iirc some message with the word 'acquired' should appear when it does.

and you can't change modes until gps lock is achieved.

Leonardo Garberoglio

unread,
Jan 11, 2016, 8:24:54 PM1/11/16
to uavde...@googlegroups.com
Oh, I see.
take a look at this:

Imágenes integradas 1

I have CONSOLE_UART defined as 2 but apears that uart.c don't see that... Is it normal?

and take a look at this:

Imágenes integradas 2

I have a lot of red lines. Code compile ok. I attached a build log.

Is it normal what I get on uart2 when it boot?:

è G([18]`ç*Ä[00]startS()

I think that there is missing mesages that could imply I have some extrange software issue....


heli_clean_build.txt

Robert Dickenson

unread,
Jan 11, 2016, 10:41:17 PM1/11/16
to uavdevboard
mmm, one of the reasons i rarely use MPLAB-X  )-:

the binary characters could be a result of poor serial cable connection (floating ground or ground loops have done this to me), or maybe that some other part of the code is also sending characters

otherwise i would suggest things are looking pretty good.

Leonardo Garberoglio

unread,
Jan 12, 2016, 4:34:30 AM1/12/16
to uavde...@googlegroups.com
Ok, I can't figure out why udb don't get lock from GPS... I see rec led blink on GPS and this indicate that GPS have lock...
I will start a debug session on gpsParseNMEA to see where the problem could be...

Is GPS_PPS a must signal? I have not wire this signal becouse my GPS don't have that signal...


thank

Leonardo Garberoglio

unread,
Jan 13, 2016, 5:51:33 AM1/13/16
to uavde...@googlegroups.com
Robert, once again your were right!
There was an unsolder "wire via" that connect bottom to top GND plane, so there was a poor GND connection on GPS and UART2 :-(

I fix this and now MP, master branch, is working ok.

This night (GMT -3) I will try HILSIM with MatrixPilot_wjp_helicalTurns.

One last thing. What is the main differences between master and MatrixPilot_wjp_helicalTurns?
What branch do I have to use to fly on my RC plane?

Thank!!!

Robert Dickenson

unread,
Jan 13, 2016, 8:53:22 AM1/13/16
to uavdevboard, Mehrotra, Vanya MS
thank-you Leo for realising my revelation, please believe this was somehow offered from something somewhat seemingly from my own above - truly beautiful eh..

sometimes loosing oneself to trusting in our innate births ability to connect with that which may be true to ground is can be so spectacular, it is often beyond what we may otherwise truly have learnt to regularly trust in - unless you can accept to occasionally perhaps perplexingly trust in.

the only difference in our codebases evolution, may be my mistake, in something somehow missed. however i doubt not, and despite all popular option otherwise, i get paid a shitload for seemingly nothingness, so should you choose to fly with it, all my efforts to merge upon our inherent shoulders of our giants. so thank-you once again for your feedback.

i would ask that you take the medium (12) risk, in going with anything that represents the latest in which i publish.. it's kinda how the world seems to go around, if only once more again, maybe this one last time ((-;, heheh, be best for the once...

as i oft do,. = breathe deep, in order to fly high...

Robert Dickenson

unread,
Jan 13, 2016, 8:58:15 AM1/13/16
to uavdevboard, Mehrotra, Vanya MS
aka, group please clarify for me, are we now working with googlecodes repository of helical_turns, or are you guys working with a git checkout of its ported 'branch' - like William, i suspect i've grown too old for keeping up with us -- and i'm moving on?

Leonardo Garberoglio

unread,
Jan 18, 2016, 12:24:01 PM1/18/16
to uavde...@googlegroups.com
I can't make hilsim to work yet.
I have my udb5 board working ok with a 4800bps nmea GPS, both on master and on MatrixPilot_wjp_helicalTurns.
I have some random problems with a uBlox working at 38400 with nmea.

But I can't get GPS lock when I try hilsim, connecting GPS port to FTDI
I would like to try slowing downd PC-UDB serial connection. If I configure HILSIM_BAUD to 4800 and change this line
Comm,COM4, 4800
on hilsimsetup, then connection should slow down?

I would like to try to debug GPS data coming from X-plane, so what would be the entry point for data coming from Xplane plugin?

thank

Robert Dickenson

unread,
Jan 18, 2016, 7:49:06 PM1/18/16
to uavdevboard
Hi Leo,

Presuming you have a short direct cable connection, I would not bother with trying 4800. It should work fine at 38400.

Perhaps post the contents of your HILSIMSetup.txt.

Mine is at "C:\X-Plane 9 Demo\HILSIMSetup.txt", and contains:

-------------------------------------------------------------------------------------------
Comm,COM8,38400
Port,14551
Overide,sim/operation/override/override_flightcontrol
Control,1,sim/joystick/FC_roll,3000,1000,1000,-1,-1
Control,2,sim/joystick/FC_ptch,3000,1000,1000,-1,-1
Control,4,sim/joystick/FC_hdng,3000,1000,1000,-1,-1
Engine,3,255,2061,1770,0,1,-1
-------------------------------------------------------------------------------------------

The plugin should be at, for example "C:\X-Plane 9 Demo\Resources\plugins\HILSIM.xpl"

Also, I recommend you delete or clear the contents of "C:\X-Plane 9 Demo\HILSIMLogFile.txt" and look for what gets recorded after you try a connection.

HILSIM uses an extended version of the binary UBX protocol, which should be automatically selected by override when you configure a HILSIM build.

Upon completion of parsing a GPS packet, the function at:

gpsParseCommon::gps_parse_common(void) // Received a full set of GPS messages

Should be called.

In order to check if any characters are being received, you could place a breakpoint within function:

gpsParseCommon::udb_gps_callback_received_byte(uint8_t rxchar) // Got a character from the GPS

I am unable to setup any hardware to confirm this right now, however hope this helps you confirm the communications channel.

It may also be prudent to confirm a SILSIM setup.

Best wishes, Robert.

Leonardo Garberoglio

unread,
Jan 18, 2016, 9:44:37 PM1/18/16
to uavde...@googlegroups.com
Robert, thank for your answer.
I do have short connection (about 10cm).
I have the same hilsimsetup.txt as your (COM9 in my case.)
I attached my hilsimlog file. You will see several open serial port becouse I enable and disable the plugin a few times.
I have configured console_uart and get feedback from UDB. I saw everithing normal until standby_timer. It start from 95 and on a very random time it get decremented. It took 10 minute to reach 0 and get lock on the UDB.
I am on MatrixPilot_wjp_helicalTurns branch right now.

I will try a debug session.
HILSIMLogFile.txt

Leonardo Garberoglio

unread,
Apr 8, 2016, 7:31:24 AM4/8/16
to uavde...@googlegroups.com
I'm trying HILSIM again on my udb5 clon.
Is there a way to test HILSIM without a Radio Controller?

Thank!

Leonardo Garberoglio

unread,
Apr 9, 2016, 3:25:39 PM4/9/16
to uavde...@googlegroups.com
I'm testing HILSIm and can't get stabilized and waypoint to work

I can fly manually, but as soon as I switch to stabilized or manual the plane go to ground.

I attached options.h and other log files.
any help will be apretiate.

thank!
HILSIMSetup.txt
HILSIMLogFile.txt
options.h
log01.txt

William Premerlani

unread,
Apr 10, 2016, 11:09:17 AM4/10/16
to uavdevboard
Leonardo,

Unfortunately, I am not able to analyze your flight, somehow whatever recorded your log01.txt file chopped the longer lines into 80 character segments, so the flight analyzer cannot parse it. I am not sure how that would have come about if you were using an OpenLog. Perhaps you were using some sort of tool on your computer? In any case, most of the lines in the log file are around 300 characters, and in order for the flight analyzer to process them, they cannot be chopped up.

There were also extra blank lines between the lines, they probably would not cause any trouble, but you should suppress them if you can.

So, if you could please figure out how to generate the flight data file without chopping up the lines, I will analyze your flight.
I suggest that you figure out why the lines were chopped and fix that and repeat your flight. Or, if it is easier for you, figure out how to process the log file that you already have to put the pieces back together, and resend me that.

Finally, I noticed in your options.h file for your HILSIM flight:

#define AILERON_CHANNEL_REVERSED 1 #define ELEVATOR_CHANNEL_REVERSED              1
#define RUDDER_CHANNEL_REVERSED                  0

For HILSIM, that should be:

#define AILERON_CHANNEL_REVERSED 1 #define ELEVATOR_CHANNEL_REVERSED              1
#define RUDDER_CHANNEL_REVERSED                  1

Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 10, 2016, 9:31:12 PM4/10/16
to uavde...@googlegroups.com
Bill thank for your answer!

yes I use a terminal software and it seems that it is not configured ok
I will try to config it the right way and flight again
Thank for the reversed channel setup I didn't know how to config them for HILSIm

Leonardo Garberoglio

unread,
Apr 13, 2016, 7:08:27 PM4/13/16
to uavde...@googlegroups.com
Bill I made a new flight with revrsed control as you said and log the flight without line break I attached it

I fly a litle on manual mode and it seems to have too much control a litle stick movment generate a big plane response
Then I goes to stabilized mode and again it seem a litle unstable
Finally I got to waypoint mode and the plane crash
I attached options.h and waypoint.h

any help will be apretiate!
log_01.txt
options.h
waypoints.h

William Premerlani

unread,
Apr 13, 2016, 8:45:58 PM4/13/16
to uavdevboard
Leonardo,

I analyzed your latest HILSIM flight and have several comments, some for you, some for the rest of the development team, I am hoping they might help because there is a lot going on:

1. What HILSIM plane were you using? I noticed the top speed was 167 miles per hour, which suggests you were not using an RC HILSIM plane, rather it was probably a full size plane of some sort. The default gains were for an EasyStar, which flies much slower than that. Using the EasyStar gains on a full size plane will result in gross instability. Most of the gains have to be turned down for a full size plane, particularly the rotation rates have to go down from the 30-60 degree per second to 3-6 degrees per second. I suggest that you start out with some sort of an RC HILSIM model if you want to use the default gains. Otherwise, tell me what plane you are using, I will send you some gains for that one.

2. I notice that the GPS LONG/LAT was bouncing all over the place, particularly prior to the flight. (See attached photo). This made it hard for me to even find the flight! Were you searching around for an airport to take off from? Anyway, it would help if you decided where to take off from and set up your Xplane to default to that location.

3. There was conclusive evidence that there was some sort of communications issue between Xplane and your board. For example, the status should always be either 110 or 111. The second bit indicates communications is working. Instead, sometimes there was status 100 or 101, which indicates MatrixPilot was waiting for GPS messages which never arrived. Also, the HDOP was sometimes reported as something other than 5 (the hardwired value in HILSIM) such as 11. Also, sometimes values that MatrixPilot received from Xplane "froze".

4. CPU loading was a little bit high, it was 35%, whereas I see 22% when I run a UDB5 with HILSIM with default MIPS of 16. 35% itself is not too high, but I have no explanation why it is higher than 22%. (This comment is mostly for the other developers.)

5. The flight analyzer crashed when I included the waypoint file, so I had to redo the analysis without the waypoints. (This comment is for Peter.)

So, the next steps I suggest for you are:

A. Either use an RC HILSIM plane with the options.h that you are using, or tell me which plane that you are using, and I will prepare an options.h file with appropriate gains for that one. This will give you a flight that is much more stable.

B. Track down the communications problem. (Easier said than done.)

With respect to "B", I suggest you learn how to use the flight analyzer so that you can easily look at the status flags. You can also look for them in the log file, but it is harder to read manually.

Also, with respect to "B", you could do some ground testing with a real GPS, and see if those communications are working ok. It they do, then there is some issue with Xplane. If not, there is some issue with your board.

For the convenience of other developers who decide to help, (Peter?) I have attached the csv and kmz files from your HILSIM flight.

Best regards,
Bill
log_01.jpg
log_01.csv
log_01.kmz

Peter Hollands

unread,
Apr 14, 2016, 2:41:41 AM4/14/16
to uavdevboard
Bill,

Flight Analyzer cannot process the current waypoint files, because some key information like USE_FIXED_ORIGIN has been commented out, and moved from waypoints.h to flightplan.h  in the Master branch.

A quick workaround is simply to re-include that information back in the waypoints.h file when submitting waypoints.h to flight analyzer. The python script can then find the defines that it needs.

My own view is that the correct fix for this issue will be to move USE_FIXED_ORIGIN, FIXED_ORIGIN_LOCATION, WAYPOINT_RADIUS, and CAM_VIEW_LAUNCH back into the main waypoints.h in Master. I think those variables should be in the waypoints.h file that the use is editing for their flight plan. Robert had been trying to put data that was common to waypoints.h and flightplan-logo.h in one file (flightplan.h), in preparation for having MatrixPilot be able to use both types of flight planning (waypoints specifications and Logo specification) in one flight.

Best wishes, Pete

The following is now in flightplan.h (and so not active in waypoints.h) ....

////////////////////////////////////////////////////////////////////////////////
// Waypoint handling

// Move on to the next waypoint when getting within this distance of the current goal (in meters)
#define WAYPOINT_RADIUS         25

#define CAM_VIEW_LAUNCH         { 0, 0, 0 }

// Origin Location
// When using relative waypoints, the default is to interpret those waypoints as relative to the
// plane's power-up location.  Here you can choose to use any specific, fixed 3D location as the
// origin point for your relative waypoints.
//
// USE_FIXED_ORIGIN should be 0 to use the power-up location as the origin for relative waypoints.
// Set it to 1 to use a fixed location as the origin, no matter where you power up.
// FIXED_ORIGIN_LOCATION is the location to use as the origin for relative waypoints.  It uses the
// format { X, Y, Z } where:
// X is Longitude in degrees * 10^7
// Y is Latitude in degrees * 10^7
// Z is altitude above sea level, in meters, as a floating point value.
// 
// If you are using waypoints for an autonomous landing, it is a good idea to set the altitude value
// to be the altitude of the landing point, and then express the heights of all of the waypoints with
// respect to the landing point.
// If you are using OpenLog, an easy way to determine the altitude of your landing point is to
// examine the telemetry after a flight, take a look in the .csv file, it will be easy to spot the
// altitude, expressed in meters.

#define USE_FIXED_ORIGIN        0
//#define FIXED_ORIGIN_LOCATION   { -1219950467, 374124664, 30.0 }    // A point in Baylands Park in Sunnyvale, CAs

Leonardo Garberoglio

unread,
Apr 14, 2016, 7:43:26 AM4/14/16
to uavde...@googlegroups.com
Bill, thank for your answer!

I want to use a RC HILSIM plane, but I have to say that I don't know where to finde the model.
I'm taking off on the default airport of X-Plane 9. But there is some thing wierd on the X-Plane and HILSIM. When I reset to runaway the plane sit on the ground and if I have HILSIM plugin enabled it starts to move. It yaw slowly even with the break on.
Regarding to communication, I see some errors on HILSIMLog, there is 3 o 4 write or read error, I have that file on my home, so in a couple of hour I will attached.
I will try to debug comm erro...

Thank again!

Robert Dickenson

unread,
Apr 14, 2016, 8:07:57 AM4/14/16
to uavdevboard
The yawing motion has always been evident when I run SILSIM flights. I've just started up XPlane-9 with no SILSIM or HILSIM connection (ie. just plain X-Plane) and the yaw is still there.

Interesting, if I disable the plugin, the yaw ceases. More interesting, when I re-enable the plugin, the yaw does not reoccur!

Leonardo Garberoglio

unread,
Apr 14, 2016, 11:53:53 AM4/14/16
to uavde...@googlegroups.com
Here is the log file
There is a few write error
HILSIMLogFile.txt

Leonardo Garberoglio

unread,
Apr 17, 2016, 10:56:54 AM4/17/16
to uavde...@googlegroups.com
Well it seems that I have some isue with my board.
I attached a log file with a real GPS and bit 2 of status flag is toggling

I will try to track down the problem

I have some warning on flan could some one tell me if it is normal?

thank
log_mp.txt

Peter Hollands

unread,
Apr 17, 2016, 11:26:12 AM4/17/16
to uavdevboard
Leo,

There should not be 1/2 an F2 statement at the very start of your telemetry file. The file should start with the F15: statement.

It is not serious. I have also noted the same issue in Master. It will probably generate a warning in flan.pyw. 
I'm not sure if that is the warning that you are talking about. I would suggest that you cut and paste the warning message from the flan.pyw into a reply on this thread, then I can probably help more.

Best wishes, Pete
F2:T0:S100:N0:E0:A0:W0:a16384:b-4:c-52:d0:e16384:f0:g52:h0:i16384:c0:s0:cpu17:as0:wvx0:wvy0:wvz0:ma0:mb0:mc0:svs0:hd0:F15:IDA=Not Defined:IDB=Not Defined:
F16:IDC=Not Defined:IDD=http://www.diydrones.com:

Leonardo Garberoglio

unread,
Apr 17, 2016, 11:52:57 AM4/17/16
to uavde...@googlegroups.com
thank Peter I make a new log file
I attached flan warning and log file
have you got any idea waht issue related to status flag could be ?
I use a neo6 GPS configured as nmea and 38400 bps
my board is very simple on uart's connections
I have another GPS configured as nmea and 4800 bps I could try with it

thank again
log_mp.txt
flanLOG.txt

Leonardo Garberoglio

unread,
Apr 17, 2016, 12:08:53 PM4/17/16
to uavde...@googlegroups.com
Well I change de GPS I put a 4800bps nmea protocol and now everithing works ok

flan message
The following text is a log of the conversion process:

Processing files, log level 0 ...
Analyzing telemetry and creating flight log book
Unknown Telemetry Format at line 11
Error parsing telemetry line  11
Writing to temporary telemetry kml file
Using origin information received from telemetry
Using IMU Locations for plotting waypoint routes
GPS Delay Correction is set to  0
Zipping up KML into a KMZ File
Elevator Trim Value set to  3087 (UDB PWM Units)
Using Nominal Cruise Speed from options.h of  12.0  m/s
Writing CSV file...
Flight Analyzer Processing Completed

so taking into account that HILSIM don't work and real GPS don't work with 38400bps could it be soething related with My board?
I will try serial port 2 communication at 57600 with the pc (currently is 19200 and works ok) and could try hilsim with slower bps too
Is hilsim working ok with slow comm ?

thanks!
log_mp.txt

William Premerlani

unread,
Apr 17, 2016, 2:53:15 PM4/17/16
to uavdevboard
Leonardo,

Your serial communications issue with your board at 38400 bps is probably related to your board, such as a supply voltage issue or crystal frequency issue, for example.
Regarding supply voltage and HILSIM, it may be that the serial voltage coming off your board does not match the voltage that your FTDI is expecting. If your supply voltage to the CPU is 3.3 volts, the serial interface is running at 3.3 volts. The signal levels at your USB are 5 volts. So, you need an FTDI that will accept the 5 volt signals on the computer side, and 3.3 volt signals on your board side. Also, you have to be careful not to connect the FTDI power to your board power.
Regarding the baud rate needed by HILSIM, there are approximately 30 bytes transmitted about 40 times per second from Xplane to UDB. With about 10 bits needed for each byte, that requires at least 12000 bps.

You might try 57600 bps for HILSIM, but if 38400 is not working, I doubt that 57600 is going to work.

19200 bps might be just enough for HILSIM, so if you cannot get 57600 working, you can try 19200. Remember to set the baud rate in both your Xplane setup file and your MatrixPilot options.h file.

Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 17, 2016, 3:08:16 PM4/17/16
to uavde...@googlegroups.com

Bill, I have two ftdi. Both are identicall to each other. Both can be configured for 3.3v or 5v. I have both on 3.3v. I connect tx, rx and gnd. One of them are always connected to uart 2 and is used as serial log. This ftdi and this uart works at 19200 and works fine at 57600.
The other uart, uart 1 has another ftdi. It just work at 4800 on a real gps.
I test hilsim on that uart at 9600, 19200 and 38400. The plane only respond when I run at 38400. I get gps coordinates but status flag, bit 2 is always 0 and dont get gps look.
I would like to try swaping uarts cinnections. May I have serial data on uart1 and gps/hilsim on uart2?
Its a litle confuse to me that I have uart2 working at 57600...

William Premerlani

unread,
Apr 17, 2016, 3:19:30 PM4/17/16
to uavdevboard
Leonardo,
Did you remember to set the HILSIM communications baud rate in both your HILSIMSetup.txt file and your options.h file? Obviously, they have to match.
Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 17, 2016, 3:26:16 PM4/17/16
to uavde...@googlegroups.com

Yes, I remember that. I have hilsimlog file for each baud rate on my home, there is some errors on it.
I think that the best thing that I could test is swap uarts, becouse I have uart2 communicating with the pc at 56700.
Im not at home right now, but as soon as I came back home I could try that.
Is there a way to swap uart1 with uart2? I mean, use uart2 for gps and uart1 for serial logging?

William Premerlani

unread,
Apr 17, 2016, 4:28:01 PM4/17/16
to uavdevboard
Leonardo,
There is a moderate amount of work to swap uart1 with uart2, but it is not too complicated. It involves editing the software for gps and logging serial communications. If you want to do it, I could point you to where to get started.
But I am not sure what you would gain. The recommended serial logging option requires 56700 bps for the logging port.
So, for HILSIM, the minimum requirement is one serial port working at at least 19200 bps and the other working at 56700 bps.
I suggest you first take a look at getting both of your serial ports working at full capacity. Do you have access to a scope to look at the signals?
Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 17, 2016, 5:55:04 PM4/17/16
to uavde...@googlegroups.com
ok I'll folow your advice
I measure 17,25 useg of pulse width for 57600 bps (uart2 and PC logging data)
and 26useg for 38400bps
So I have 0,64% error and 0,16%
am I right?
There is some high frequency noise (ripple) on Tx signal from PC on uart1
would you like pictures of my setup?

William Premerlani

unread,
Apr 17, 2016, 7:19:35 PM4/17/16
to uavdevboard
Leonardo,
Both of those errors (0,64% and 0,16%) are acceptable. The phase shift over 10 bits is 6,4% and 1.6% of the period, which is not enough to cause trouble, since the serial ports sample at the center of the pulse, you would need 50% error over 10 bits (5% per bit) to cause trouble. So, most likely the problem is the noise and/or voltage levels.
If I am understanding you correctly, you are seeing noise on the signal going from your PC to your board?
I wonder if there is a problem with your board?
Did you build a clone of a UDB5?
I would like to see pictures of your setup, also if you can do it, pictures of the scope traces.
Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 17, 2016, 7:43:19 PM4/17/16
to uavde...@googlegroups.com
Bill you are right I made a 2 layer clone of udb5 (there is a few post last year about it) just to me and my plane
This is a video of my setup https://youtu.be/dMROnUA88bU and here you have a screen of uart's route https://www.dropbox.com/s/8cxkpktx1on2tvf/Captura%20de%20pantalla%202016-04-17%2020.32.55.png?dl=0
in the video you can see the two FTDI one for data logging using a terminal program on the PC and the other for HILSIm
First I measure Tx from the board to the FTDI for uart2 (data logging)
next I measure Tx from the board to the FTDI for uart1
finally Tx from FTDI to uart1 RX here there are a noise on the data from the Xplane to my board

Any idea?
Thank you very much for your time!

William Premerlani

unread,
Apr 17, 2016, 8:29:34 PM4/17/16
to uavdevboard
Leonardo,
Thanks, I looked at your video.
The noise did not seem to be strong enough to cause a problem.
That said, I wonder if you have a ground loop. You might have one if you are connecting the grounds of both FTDIs to your board and if the grounds of both FTDIs are connected to your PC ground.
I suggest disconnecting the ground between your data logging FTDI and your board and take another look at the signals at your board.
If the noise seems less, and the pulses look about right, then you might try a HILSIM flight.
If that does not help, we will have to think a bit harder about this.
Of course if it is a ground loop, that does not explain why you had trouble with your GPS.
Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 17, 2016, 8:57:18 PM4/17/16
to uavde...@googlegroups.com
Bill the source of the noise is the USB supply I mean the voltage provided by the computer to the FTDI, I see the same noise with the FTDI without external connection, just the USB cable
I remove one ground connection and there is a degradation on Rx signal (the signal that were ok on the video). It start to have some overshoot on each 0 to 1 and 1 to 0 transition
So the problem will be on another place It's too weird that one uart works ok and the other don't
If I swap the uarts on firmware we could have one more evidence
we will have HILSIm communicating ok and data logger will loos data
If it doesn't append there will be a problem outside of my board, right?

BTW I could forget this problem, connect my 4800bps GPS, mount the board on the plane, connect my datalogger and try to fly (or I should write flight?)... I could try to get an original UDB5 board on a few month...

If you want to spend more time on solving this issue, I will be with you. But feel free to give up whenever you want, I know that there is a big chance that the problem is my design...

William Premerlani

unread,
Apr 19, 2016, 6:32:33 AM4/19/16
to uavdevboard
Team,
Leonardo and I finally figured out what was causing the communications issue with his UDB5 clone:
He was using the xx710 CPU rather than the xx710A. The 710 has a known serial port issue with BRGH = 1.
The work around was to use BRGH = 0, change the scaling in the computation of the baud rate generation register, and run at 32 MIPS instead of 16 MIPS.
Best regards,
Bill

Leonardo Garberoglio

unread,
Apr 19, 2016, 12:13:00 PM4/19/16
to uavde...@googlegroups.com
I made a new fly using your options and waypoint for cessna
I attached the log file
I think that I have a problem with the mountain around the airport jeje
I'm downloading xplane 10 to try easy star2
I'm very exaited to mount the board on my sail plane and try to fly
I will open a new post for that

thank
log_HILSI_OK.txt

Leonardo Garberoglio

unread,
Apr 22, 2016, 10:30:03 PM4/22/16
to uavde...@googlegroups.com
Hello, this is the last post on this thread, I think that I have the basic config working ok. I can fly in stabilized, waypoint and rtl mode, I could setup new waypoint and rtl (base on other examples and looking at the explanation on waypoint.h).
I attached a log file just in case that you see something wrong.
I finish my serial datalogger and use it to log this flight.

I will start to mount the board on my plane and hope that tomorow could fly.

Thank
LOG0004.TXT
Captura de pantalla 2016-04-22 22.50.15.png
LOG0004.kmz

Peter Hollands

unread,
Apr 23, 2016, 4:01:34 AM4/23/16
to uavdevboard
Leo,

That is great to see that you got it all working. HILSIM is super useful.
Nice to see the logging / telemetry all working as well.

Thanks for sharing your success and good luck with the real flights. 

Best wishes, Pete

David

unread,
Aug 1, 2017, 3:03:28 AM8/1/17
to uavdevboard
Hi All,

I'm glad I found the discussion on HILSIM here.
I just started using Xplane 9 to work with my UDB5 setup, and I'm using the latest code of Matrixpilot-master (5.0.2)
I followed the instructions as specified at https://github.com/MatrixPilot/MatrixPilot/wiki/HardwareInLoop

But, once I place HILSIM-win7-64.xpl (from C:\MyProject\MatrixPilot-master\Tools\HILSIM_XPlane\prebuilt-plugins) to C:\X-Plane 9\Resources\plugins, I can't flight the plane in Xplane 9. I haven't even connected UDB5 to PC yet.
I brought Xplane 9, but I only installed DVD Disc 1 in my PC (Windows 7, Enterprise version)
I placed ReloadPlugins.xpl and HILSIMSetup.txt (renamed) into C:\X-Plane 9\Resources\plugins   

Does the latest Matrixpilot-master (5.0.2) work with Xplane 9? 

Any help will be appreciated.

David

Peter Hollands

unread,
Aug 1, 2017, 3:43:23 AM8/1/17
to uavdevboard
David,

The Matrix Pilot firmware for the UDB5 (i.e. the actual code running in the UDB5) should be compatible with X Plane 9; but I personally have not tested that. There is no reason why it should not work, as the interface ( via the GPS cable into an FTDI cable and into the PC) is still the same. It has not changed for many years.

However, I do not know whether the pre-built plugin that you are using was made for the for X-Plane 9 or X-Plane 10. That could be an issue. I would expect any binary plugin to be specific to a given version of X-Plane (9, 10, or 11).

You should note that when the plugin is working, you will not longer be able to fly X-Plane with the mouse. The plugin will take over control, so that you have to use the UDB5, MatrixPilot, and your Radio transmitter to control flight in X-Plane.  The HILSIMLogFile.txt in your main X-Plane directory can be a useful source of information about whether the plugin is working.

By the way:  I am not aware yet of anyone using MatrixPilot with X-Plane 11 yet.

Best wishes, Pete


--
--
---
You received this message because you are subscribed to the Google Groups "uavdevboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

Robert Dickenson

unread,
Aug 1, 2017, 4:10:14 AM8/1/17
to uavdevboard
The most recent development work I did with the X-Plane plugin was all tested with version 9. I also occasionally did a test with version 10, however given it was always so much slower to load up, I did most of my work with 9. I can't think of anything in our plugin which is version specific.

That said, I often had trouble getting my MatrixPilot <-> X-Plane connections up and running. It seemed that whenever I took an extended break from development work, I'd be faced with going through this cycle again. I'd encourage you to perservere, check the logfile as Peter suggested, ensure you've got both ends configuration at the same baud rate, etc etc.. Once I get it working, it is then usually very reliable.

I should mention that I've also added a feature which supports HIL/SIM testing without requiring an R/C unit. There's now support for keystrokes (numeric keypad) input to X-Plane in order to manually command MatrixPilot, which is turn commands X-Plane - when the plugin is active. Sorry but you'll have to consult the source code to work out the key mappings:

https://github.com/MatrixPilot/MatrixPilot/blob/master/Tools/HILSIM_XPlane/HILSIM.cpp#L317

https://github.com/MatrixPilot/MatrixPilot/blob/master/libDCM/hilsim.c#L88

IIRC, when first getting my connection going good, i'd often disable/enable the plugin multiple times (from the x-plane plugins menu). never did figure out what was the key issue here.

Guy-François MESNIL

unread,
Aug 1, 2017, 3:45:44 PM8/1/17
to uavdevboard
Hi Ansuz,
I am not sure that my following remark could help, but I leave you the link where I explain more deeply the problem encountered with the telemetry RFD800:

If you use an UDB5 board, you could observe undesirable UART pulses during the first 250ms of boot of the board.
My solution to fix it was to wait for the PLL lock before continuing the boot.
I have added for the UDB5 version the same instruction that is done in the AUAV3'one, that is to say in the mcu_init routine :

//Change GFM#9: in accordance with Microchip recommandation to avoid wrong UART data transfer rate
// Cf. DS70188E-page 17-16   
while(OSCCONbits.LOCK != 1) {}; // Wait for PLL to lock

Best regards,
gfm

David

unread,
Aug 2, 2017, 3:05:33 AM8/2/17
to uavdevboard
Hi Pete, Ansuz,
Thanks for the inputs.
I checked HILSIMLogFile.txt and Data.txt files, both files are empty, nothing is logged.
I'm using FTDI Breakout board (from Sparkfun, FT232R Breakout board), RXI (on FT232R) connects to Pin 3 on EM406 connector, and TXO (on FT232R) connects to Pin 4 on EM406 connector, and GDN to Pin 1 on EM406 connector. I was using this FT232 board for the serial output to PC (Hyper Terminal, Telemetry).
And I set the serial port TX rate as 38400 in Options.h and HILSIMSetup.txt

Best,

David
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard...@googlegroups.com.

Peter Hollands

unread,
Aug 2, 2017, 3:34:13 AM8/2/17
to uavdevboard
David,

Your HILSIMLogFile.txt should have information in it, regardless of the serial setup. For example it should have lines from debug statements that it prints while parsing your HILSIMSetup.txt file. As the plugin parses each line of  HILSIMSetup.txt it prints out a debug statement for that line into the log file: For example:-

Found File Line: # HILSIM setup file - loads from HILSIMSetup.txt in the X-Plane executable directory

Found File Line: #

Found File Line: #  Matthew Coleman - 10-05-05

Found File Line: #

Those lines, taken from the HILSIMLogFile.txt on my Mac,  are all comments in the HILSIMSetup.txt file. If your plugin is reading the HILSIMSetup.txt file, it should print each configuration line into the HILSIMLogFile.txt as it parses that line.  Those lines should be in your HILSIMLogFile.txt regardless of whether the serial connection is working or not.  

Either:-

a) Either your HILSIMSetup.txt file is in the wrong place, or it is not readable (from a permissions point of view), 

Or:-

b) The plugin is not working correctly. In fact it would have to be crashing, as it is creating the HJILSIMLogFile.txt, but not parsing the HILSIMSetup.txt file and writing anything to the log  file.

Best wishes, Pete



To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

David

unread,
Aug 3, 2017, 3:32:25 AM8/3/17
to uavdevboard
Hi Pete,
Thank you for the reply.
As you pointed out, HILSIMSetup.txt was placed in the wrong folder
After I moved it to the root directory of XPlane folder, I got the data in HILSIMLogFile.txt file and I can take off the plane. Thanks a lot !!!

Now the problem is the plane got up side down right after it took off. 

I attached a few files and hope you could help on (why the plane turns up side down).

Regards,

David
options.h
HILSIMSetup.txt
HILSIMLogFile.txt
Serial Port Log 802.txt

Peter Hollands

unread,
Aug 3, 2017, 7:30:06 AM8/3/17
to uavdevboard
David,

Most probably the controls are reversed for the plane that you are flying.

What plane are you flying ?  Are you starting with a Cessna ? If you are using a Cessna, then there should be some good options.h file that other people have already setup. 

Once you have it working, I would suggest moving a radio controlled EasyStar model.
I can send you the file for that when you are ready.

In the meantime:-
It is best to first get the manual controls working correctly. Start up X-Plane 10, switch on the transmitter,
set flight control to Manual Mode, and then get X-Plane 9 viewing your plane from behind so that you can see the
elevators, rudder and ailerons. Now switch on and boot up the UDB5.  The gyro waggle should happen in about 2 seconds,
and a couple of seconds later, you should get GPS lock (These timings are shorter in HILSIM than in real flights).
Now move your aileron control on the transmitter, and watch to see that the movement on the plane's aileron is the correct direction.
Do the same for the rudder and elevator.

Then fly the plane in manual mode.

Once you have achieved a manual flight, you can then move onto Fly By Wire Mode, and check that the UDB5 channels in options.h (used in FBW mode), do not need reversing in options.h.

I have not yet run a full analysis of your files, partly because flight analyser will have a tough time parsing your log file. This is because you did not record the log file from the very beginning. You really need to switch on the logging recording, before switching on the UDB5. Then all the startup messages in the telemetry will be caught in the log, and flight analyser (Tools/flight_analyzer/flan.pyw ) will be able to create a Google Earth KMZ file, and Spreadsheet CSV file for your flights, and I will be able to help your further.

Best wishes, Pete

To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

David

unread,
Aug 4, 2017, 2:29:46 AM8/4/17
to uavdevboard
Hi Pete,
I made some correction for the servo control in the transmitter (I'm using Spektrum DX7). I followed the sequence:
- Launch Xplane (I use the default setting for airplane - CessnaJet, which has a V tail)
- Turn on Transmitter (I set Manual mode)
- Turn on UDB5

After UDB5 completed the initialization, I tried to check the surface control. Two surfaces (Elevator and Rudder) on V Tail seem follow the stick control (on the transmitter). But the Aileron surface (on the airplane) never moved on the airplane, even though I gave the Roll stick control and Aileron servo moved. Any idea, what's wrong in my setup?

You mentioned to use EasyStar model, how do you set in XPalne to use EasyStar?

Thanks

Peter Hollands

unread,
Aug 4, 2017, 3:14:40 AM8/4/17
to uavdevboard
David,

I would try switching the plane in X-Plane 9 to be a conventional Cessna Plane initially (not a V-Tail).
I.e. a plane with a normal rudder, elevator and ailerons.

The settings on your transmitter, options.h, and the HILSIM-setup all need to be correct for a given plane.
But default, most conventional planes are going to work. But anything that involves mixing, like a V-Tail is going to be more complex to setup.

Best wishes, Pete


To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

Robert Dickenson

unread,
Aug 4, 2017, 5:20:33 AM8/4/17
to uavdevboard
I'm with Peter on recommending using the conventional Cessna. I vaguely recall getting that v-tail jet to work, but there was some fiddling around with configurations in getting there - and i surely cannot remember what they were.

I would have flown at least a hundred flights with my default SILSIM/HILSIM setup as you'll find here: https://github.com/MatrixPilot/MatrixPilot/tree/master/Config/Cessna

Kind regards, Robert.

David

unread,
Aug 4, 2017, 11:53:20 AM8/4/17
to uavdevboard
Hi Pete, Robert,
I found a way to use Cessna 172S, a conventional model with normal Aileron, Elevator and Rudder. But I still couldn't control Aileron surface.
I attached a log file here, I moved Radio control on Pitch, Roll and Yaw, I saw Elevator and Rudder surfaces, but not Aileron.

Thanks

David
Log.txt

David

unread,
Aug 5, 2017, 2:28:47 AM8/5/17
to uavdevboard
Hi Pete, Robert,
I got Radio Control GP_TP_60 model from XPlane 9 (PT60RC.acf). this model has the normal Aileron, Elevator and Rudder surfaces. With this model, I have the control on all 3 surfaces (Aileron, Elevator and Rudder), and all 3 the surface reflections follow the stick commands (Roll, Pitch and Yaw) from the transmitter. The model seems a right model for me to star with.
But the new problems I encountered with this model are:
1. The model plane moves on ground and took off by itself, even though I put the throttle at lowest position after I reset it back to the runway.
2. The plane crashed right after it took off. I barely got chance to control it. 

I think I have a big setting problem in options.h. I attached a few files for the reference

Hope to get the help from you guys,

Thanks

David 
options.h
HILSIMSetup.txt
HILSIMLogFile.txt
Telemetry01.txt

Peter Hollands

unread,
Aug 5, 2017, 3:49:10 AM8/5/17
to uavdevboard
David,

I never get any errors on my serial write in the log file.  I have:-

Parse Engine Line :0:Engine 1:3 2:255 3:2000 4:2000 5:0 6:1 7:-1 New engine added: Found File Line:

Opened serial port /dev/cu.usbserial-A2003DXc

Opened UDP server on port 14551

Using serial port.  Closed udp port.

Closed serial port

The closed serial port is the last line in my log file from when I have finished with X-Plane 10 and shut it down.

At the start of your log file you have:-

Opened serial port COM12
Opened UDP server on port 14551
Using serial port.  Closed udp port.
serial write failed
WriteFile Error = 995
Closed serial port
Opened serial port COM12
Opened UDP server on port 14551
Using serial port.  Closed udp port.
serial write failed
WriteFile Error = 995
I note that in your log file, the Serial comms logs file are being written to the beginning of the file, even though they are written after the parsing of the HILSIMSetup.txt file.
I remember that used to happen under Windows for me years ago, but I'm not sure why it is at the beginning and not at the end. It may also be a feature of X-Plane 9 rather than 10.
It would be good find a way not to have serial comms errors.
I am sorry that this is not working for you yet. 
There is also a chance that your pre-built binary plugin, HILSIM-win7-64.xpl, is not compatible anymore with X-Plane 9. It is 64 bit. Did X-Plane 9 have a 64 bit binary ? That is an important question to answer.
In which case, you if X-Plane 9 is only provided as a 32 bit binary you should be using the 32 bit plugin. And of course that is a windows 7 plugin.
I wonder if anyone else, that is running Windows can confirm it is working for you.  I note from the git log that HILSIM-win7-64.xpl was committed to the repository by Bill on January 28th 2015,
when we had new understanding of how the accelerometer measurements could be used in X-Plane.

HILSIM-win32.xpl is rather old, and was committed by Ben in February 2013.

Best wishes, Pete



To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

william premerlani

unread,
Aug 5, 2017, 6:53:21 AM8/5/17
to uavde...@googlegroups.com
Team,
It has been a long time, but it seems to me that both X-Plane 9 and X-Plane 10 will work only with the 32 bit plugin, regardless of whether you have a 64 bit or 32 bit windows. At the time I thought we would need the 64 bit version, that made sense to me, but the 64 bit plugin never worked for me.
On my 64 bit windows computer, I can run both 9 and 10 with the 32 bit plugin.
In any case, David, if you have not already tried it, I suggest you try the HILSIM-win32.xpl prebuilt plugin, see what happens.
Copy it to your plugins directory and rename it to HILSIM.xpl.
Best regards,
Bill

william premerlani

unread,
Aug 5, 2017, 5:22:20 PM8/5/17
to uavde...@googlegroups.com
David,
I did a little more digging, my last email was in error. Sorry.
I have both X-Plane 9 and X-Plane 10 running under 64 bit windows 7.
I am using the 64 bit plugin for both X-Plane 9 and 10.
For X-Plane 10, I have to run the X-Plane 32 bit executable.
In your case I think you should probably match the plugin to your machine, 32 or 64 bits, depending on what you have.
Best regards,
Bill

David

unread,
Aug 7, 2017, 2:26:52 AM8/7/17
to uavdevboard
Hi Bill, Pete,
Thanks a lot for looking into the problem.
I tried HILSIM-win32 and got the inconsistent results in the log files, sometime the log file has nor error, sometime it shows ReadFile() error as attached.
The main problem I had is the plane crashed during take off before I got chance to control it. It crashed every time.
Is the crash related to the setting in options.h? or is it related to HILSIM plungin file?

Regards,
David
HILSIMLogFile 2 (No Error).txt
HILSIMLogFile 1 (Read Error).txt

Robert Dickenson

unread,
Aug 7, 2017, 4:35:52 AM8/7/17
to uavdevboard
may i suggest you try flying the Cessna-172 with the repository options file for that aircraft and see if you can manually fly it.

you may also benefit from testing your settings in a SILSIM session.

To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

David

unread,
Aug 7, 2017, 10:21:37 PM8/7/17
to uavdevboard
Hi Robert,
I tried Cessan 172 with the latest code (release 5.0.2), but I can't move the airplane at all, even though I gave full throttle, and Aileron surface doesn't move, either, even I gave Roll command. Have you seen this kind of the problem before?

Regards,

David

Peter Hollands

unread,
Aug 8, 2017, 7:02:19 AM8/8/17
to uavdevboard
David,

I've been looking at your telemetry from 3 days ago from your post on the 5th August 2017.:- (Telemetry01.txt).

I notice that Inputs channel 4 and 5 don't make sense to me ? Are they swapped over  at that time ?

In the startup Telemetry it says:-
F19:AIL=1,0:ELEV=2,0:THROT=3,0:RUDD=4,0:
That means:-.
Rudder is on channel 4 for autopilot control: and not reversed for autopilot control.

Further down your telemetry you have trim values:-
F20:NUM_IN=5:TRIM=2891,2826,2293,2227,2810,:
We have 5 input channels in total. And the Trim value for Channel 4, the rudder is 2227.
While the Mode channel is at 2810.

That to me, looks like the rudder is value from the transmitter is on the mode channel. And the mode is on the rudder channel.

Was that right ?

In which case the rudder would have been hard over, which would explain why you crash on take off. And if you move the rudder control on the transmitter, the plane will change flight mode. The centre value of the rudder channel on the transmitter would put the flight mode in FBW, if my theory is correct.

I may be wrong; but perhaps you could check carefully whether the channel 4 and 5 on the input to the UDB are correctly connected to the right pins, and that the transmitter is working on the channels that you expect.

Best wishes, Pete


To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

David

unread,
Aug 9, 2017, 2:47:54 AM8/9/17
to uavdevboard
Pete,
Thanks for looking into my problem.
I checked my setting and connection on UDB5 and Transmitter/Receiver, they matched the definitions in options.h:

#define THROTTLE_INPUT_CHANNEL              CHANNEL_3
#define AILERON_INPUT_CHANNEL               CHANNEL_1
#define ELEVATOR_INPUT_CHANNEL              CHANNEL_2
#define RUDDER_INPUT_CHANNEL                CHANNEL_5
#define MODE_SWITCH_INPUT_CHANNEL           CHANNEL_4

#define THROTTLE_OUTPUT_CHANNEL             CHANNEL_3
#define AILERON_OUTPUT_CHANNEL              CHANNEL_1
#define ELEVATOR_OUTPUT_CHANNEL             CHANNEL_2
#define RUDDER_OUTPUT_CHANNEL               CHANNEL_4

And I did the checkout on the surface controls, from the transmitter to all 3 surfaces, and to the servos. For instance, When I moved the Yaw stick, Left/Right, the rudder followed the stick movement, and the airplane turned Left/Right coordinately on the runway. I also checked Aileron and Elevator surfaces, they followed the stick movement as well.

One weird thing is: after I turned off the transmitter and UDB5, and reset the model plane back to the original place, and the model plane started running on the runway and taking off by itself. Right after it took off, it crashed to the ground.

Regards,

David

Robert Dickenson

unread,
Aug 11, 2017, 2:06:53 AM8/11/17
to uavdevboard
Is input channel 5 on your UDB wired up to channel 5 on your radio receiver?

If so, that would seem odd. In my experience, on most receivers channel 5 is the toggle switch, with channel 4 being the rudder.

I suggest you try swapping around the connections, and modifying options.h to suit.

To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard+unsubscribe@googlegroups.com.

william premerlani

unread,
Aug 13, 2017, 8:13:06 AM8/13/17
to uavde...@googlegroups.com
Team,

Just to follow up on this discussion thread...

I worked with David offline to get HILSIM working for him. Here is what we found:

1. The aileron commands from his TX were not getting through to the UDB. During the process of debugging it, it started working.
2. The deflection polarities for HILSIM had to be set to 1. The default values are 0, which creates unstable, positive feedback.

Best regards,
Bill

David

unread,
Aug 19, 2017, 9:17:42 PM8/19/17
to uavdevboard
Bill, Pete, Robert,
Thank you all for the help.
As Bill said, I have got HILSIM work now.
Reply all
Reply to author
Forward
0 new messages