Hardware in the loop simulation

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Hardware in the loop simulation

Post by treym »

TL;DR : This is about hardware in the loop simulation : having an multiwii flight controller running in a flight simulator .

Baseflight and Multiwii are supported along with FlightGear simulator .

There is a new msp_set_attitude message in the private range of the protocol.

You will find some more detailed information in the multiwii-mavlink-gc wiki. feel free to comment .

Here is a short maiden flight in horizon mode and some switch to accro mode .




Image
Last edited by treym on Fri May 09, 2014 2:49 pm, edited 1 time in total.

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Hardware in the loop simulation

Post by brm »

very nice!
need to play with it.

User avatar
Dilbert66
Posts: 45
Joined: Fri Apr 04, 2014 6:09 pm

Re: Hardware in the loop simulation

Post by Dilbert66 »

Liking it. Nice work

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Hardware in the loop simulation

Post by brm »

the latest git stuff does not compile.
neither windows nor linux...

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Hardware in the loop simulation

Post by treym »

what does it says ?

if this is about __STRICT_ANSI__and -pedantic .. i wont change that ;)

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Hardware in the loop simulation

Post by brm »

treym wrote:what does it says ?

if this is about __STRICT_ANSI__and -pedantic .. i wont change that ;)


MAVLINK_SRC_CFLAGS := -lm

ähh!?
you mean linker flags, isn't it ;-)

adminuser@adminuser-VirtualBox:~/multiwii-mavlink-gc$ make
cc -lm -o src/mwgc/mwgc-1.1 src/mwgc/mwgc.o src/serial/serialport.o src/mwi/mwi.o src/utils/utils.o src/mwgc/conf.o
src/mwgc/mwgc.o: In Funktion `callBack_mwi':
/home/adminuser/multiwii-mavlink-gc/src/mwgc/mwgc.c:720: Nicht definierter Verweis auf `lrintf'
/home/adminuser/multiwii-mavlink-gc/src/mwgc/mwgc.c:720: Nicht definierter Verweis auf `lrintf'
/home/adminuser/multiwii-mavlink-gc/src/mwgc/mwgc.c:728: Nicht definierter Verweis auf `lrintf'
/home/adminuser/multiwii-mavlink-gc/src/mwgc/mwgc.c:732: Nicht definierter Verweis auf `lrintf'
/home/adminuser/multiwii-mavlink-gc/src/mwgc/mwgc.c:732: Nicht definierter Verweis auf `lrintf'
src/mwgc/mwgc.o:/home/adminuser/multiwii-mavlink-gc/src/mwgc/mwgc.c:509: Weitere nicht definierte Verweise auf `lrintf' folgen
collect2: error: ld returned 1 exit status

you should not use this function in an mcu.
it is a pain what it uses in terms of resources.

edit:
before i forget it - write a cmake file.
make files are shit.

m3us
Posts: 6
Joined: Thu Mar 06, 2014 6:53 pm

Re: Hardware in the loop simulation

Post by m3us »

Great work on the groundcontrol mate,thanks for all the help in getting me up to pace with the workings :)
@brm the windows version should compile now ,i could put up the exe if needed
Ill soon edit this with a video of my quads

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Hardware in the loop simulation

Post by treym »

i removed lib math , please tries again

what mcu are you using ?


ps : make is everywhere .. cmake is not everywhere

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Hardware in the loop simulation

Post by brm »

treym wrote:i removed lib math , please tries again

what mcu are you using ?

ps : make is everywhere .. cmake is not everywhere


oh, all mcu's which are decent.
8 bit is braindamaged to a certain extend.
but event with 32 bits it can happen to run out of cpu cycles.
and this happens often ;-)

love it to have a pelican in my hands...

and yes. it compiles :)

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Hardware in the loop simulation

Post by brm »

@treym
hmm,
je vriend uit amersfoort benut zo een flexbot.
is dat ding goed?

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Hardware in the loop simulation

Post by treym »

i dont knwo anything about that flexbot , but as far as it look , it dont look attractive to me .

koenkooi
Posts: 13
Joined: Sat Apr 19, 2014 8:31 am

Hardware in the loop simulation

Post by koenkooi »

I'm not using this for the flexbot yet, that needs a Bluetooth LE to serial bridge first.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Hardware in the loop simulation

Post by timecop »

koenkooi wrote:I'm not using this for the flexbot yet, that needs a Bluetooth LE to serial bridge first.


flexbot sounds really dumb.
3D printing 100 frames was OK idea, proceeding with that plan after getting 10K+ orders was beyond retarded.
Using obsolete hardware on new product in 2014, even more so.

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Hardware in the loop simulation

Post by treym »

old 8bit 328p can now run in simulation
Image

36h long fly away .....
Image

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Hardware in the loop simulation

Post by PatrikE »

Can someone please share a runnable version for windows?
I can't get it to compile.

Patrik

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: Hardware in the loop simulation

Post by Plüschi »

PatrikE wrote:Can someone please share a runnable version for windows?


+1

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Hardware in the loop simulation

Post by treym »


universam
Posts: 14
Joined: Thu Nov 20, 2014 4:41 pm

Re: Hardware in the loop simulation

Post by universam »

Hi,

we have an issue with MWII that we cant reproduce in lab, so I'm curious if it could be simulated with HIL simulation?

As posted here http://www.multiwii.com/forum/viewtopic.php?f=8&t=364&start=450#p59144
flying an airplane acrobatic on a roll with several turns the plane doesn't stop but keeps on rolling :roll:
So I wanted to ask kindly if anyone having a working HIL could try that once which would be of great benefit?

THANKS! :P

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Hardware in the loop simulation

Post by treym »

i did not see anything weird yet , i am not using the most suitable planes for acro .. will do extensive testing later


Post Reply