-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System Identification using the log data #19
Comments
I would recommend you stay away from the matlab sysid toolbox. Sysid isn't baked to the point you can just send in data and it spits out a model. Plot your signals, you will see the inner loop after debiasing is just a pure delay and gain. Hope that helps. |
Thank you for your comments @jgoppert , yes that is helpful. But I would be grateful if you could answer a few specifics of my problem. First, I am not using the matlab sysid toolbox. I have written my own code for System Identification following the Output Error Method in which I give Inputs to the model I already derived for my system and I get a few Estimated Parameters as output. That's all. The problem where I'm stuck is my code produces output for simulated data but not for this real data which I collect from the pixhawk. As I said I was using MAVROS to store data earlier but it didn't work and I suspect that data sampling has to do something with it. So, I am now thinking to use the data I get from the px4log and perform sysid with it through my code. That is still feasible right? Can you help me on two things, if you can, please!
Thank you again for all of your help and comments. I've been stuck for a long time and it would be great if you could help me on any of this. @mhkabir would appreciate a word a two for help from you as well. |
Resampling is beneficial to estimate what the values were at the same timestamp, you can never get uinform sampling without post processing. You need at least 100 hz for data to get a decent fit. Why not try coding your method in python and comparing go mine. If it does better I would be happy to take a PR. I also do automatic pid gain tuning bases on the model for you in px4tools. |
That's great! But as much as I would like to do that, my project has a deadline to be honoured. And yes, I noticed you also evaluate PID gains, pretty useful. Thank you for all your comments though. I noticed later that the data is not recorded at a constant frequency so I need to make it at uniform timestamp, as you suggested. Maybe once my reports are done, I can share my results (If I'm able to get something, finally) with you and compare. Thanks again for all your help and will let you know if I'm able to solve my problem! |
@jgoppert I've another question for you if you may. I did what you do but all in MATLAB code and not in the toolbox. Collected the data from logs, resampled them before using, but my system didn't behave correctly. I was later pointed out that there is a time_delay which also plays a role and I saw that your code also calculates the time delay and the PID gains. So, my question is What does this time_delay represent? Is it between the commanded input and the response time it takes for the UAV (or more accurately, motors) to follow? Because, then I was not taking any delay time into consideration in my code and maybe that's why it didn't work. You think this time_delay has that major of a role? And, even you collect the PWM signals and convert them in order to get the inputs, right? as there is no way to measure the actual inputs. I would be really grateful if you could clear my query! Thanks |
Yes, the time delay has a major role. I'm not 100% sure what the cause is, gain and delay are the primary components of the signal. No, I don't use the PWM, I use the actuator controls topic, it is the pre-mixed input signal, it is easier that way, but should yield the same results. |
ok on everything, but I don't get how you use actuator control topic. And you get this data from the px4log? How exactly do you measure the input motor RPM? and thanks again |
As pointed out by @mhkabir I followed this thread to collect the data from the px4log file to perform System Identification of the tricopter. But, I am running into some difficulties and I think the sampling of the inputs I'm giving has something to do with it. I'm using my own MATLAB code following the Output Error Method to perform the system identification. Earlier, I was collecting the data directly from MAVROS and it didn't work out, probably because of the sampling time. In your python script "logsysid.py" I noticed that you resample and then interpolate the data before sysid. Why do you do so? If you could help me, would be a great help!
Thanks
Sid
The text was updated successfully, but these errors were encountered: