Has anyone used the system identification toolbox to model a quadcopter? I would like to generate a model using system identification, either using black box modeling or grey box modeling.
I can utilize some suggestions to get started.
Thank you very much! :)
i have been investigating this issue and am currently working on an USB based flight data recorder in order to get data. The problem is that you have to identify the platform including the control system if you want to do it in flight. Alternatively you could try open loop experiments by fixing the quad to isolate a single axis. In the first approach the problem is that there is no guarantee that the data you get from the sensors is sampled in equidistant time intervals and that the information from the various sensors match. You will need to run the quad using your own code based on assembly which means rewriting APM software. the second approach yields results quickly but leaves out interaction between the various degrees of freedom. Which approach are you considering?
I am also interested in knowing how to model the quadcopter. Are you doing this for modelling the control system or is it something else?
@Jan: Is it also possible to do the same using Hardware In Loop (HIL)?
@kate: Have a look at this. This guy does some cool stuff with modelling quadcopter.
what do you mean by hardware in the loop? I am investigating means to write sensor data using a serial protocol (SPI/UART) and write it to an usb stick using a vdrive2.
Do you mean to say that you want to get raw sensor data from the IMU (Like gyro, accel, etc) and get in a text file format and write it into USB stick? Would you like to do this on flight or put it into usb stick offline (like writing it programatically)?
Btw, if you wish to do it in using USB in flight, there is an easier way out! One possible option is to rather use a SD card slot to the APM via the SPI ports (pin #50,51,52,53) that are on the Red APM board. You would have to disable the data flash usage in code. You can solder the pins to these connections and use a SD card breakout board. Alternatively, USB compatible connectors can be attached to these SPI pins too!
I took quite a while figuring this out, and guess what the proprietor of APM refused that it can be used this way. It is all in software at the end of it, anything's possible!
Maybe, If I understand correctly, your needs might be somewhere close to my description?
I have seen almost all the papers related to modeling :D Thanks though.
Yes, I was planning to use the HILS data for the start. I wanted to start with HILS data you can easily log and then do the system identification.
Thanks for the reply. I am a little confused right now. The data logs that we will get from the non-volatile memory isn't good enough? What I was planning to do is:
I am not very familiar with the System Identification toolbox. So, I was planning to use the data from the Hardware in the Loop simulation (if possible, I am yet to explore that option) and get accustomed to the SI tool. Then from the data logs we get from the NVmem could then be used for identifying the model.
I also have to figure out the sampling rates of the various sensors on the IMU board. Do have any idea about it?
I found this paper.
you can run the data you have now through the system identification toolbox but my guess is that the results will be questionable. Especially if you try data from a flight. the toolbox assumes a fixed sample rate and assumes that the sample instances have a fixed latency. It will however be well worth a try.
Right now the other problem I am facing is the data logs. The sample logs that I have from the flight are in ".log" format, and for system identification requires data which is in ".mat" , also I wasn't really able to import this log data into Matlab either.
I am a little poor with this, can you please help me?
the best thing to do is open the log file in a text editor like notepad (TextEdit on mac) your log might contain lines like this:
52.9620361328,4.7732505798,-4.6900000572 GSP:1.18 COG:0.0000000000 SAT:0 FIX:1 TIM:402647250
52.9620361328,4.7732505798,-4.6900000572 GSP:0.15 COG:0.0000000000 SAT:0 FIX:1 TIM:402647250
or something similar. the trick is to separate each column using comma's. e.g search and replace "GSP" with ",GSP". If you have this fixed you can import it in excel as a comma separated file and then delete all columns that you do not want. After this you export or save the file as a comma separated file .csv. which you can in turn import in matlab using :
M = csvread(filename, row, col, range)
(for more info google csv import matlab.)
once this is done you have to select the parts of the data you want to store as vectors by extracting columns form M. The last step is saving as a .mat or importing it from the command line into the ident toolbox.
i hope this helps,