Logging more parameters

News, Setup, Compiling, Flashing, Development

Logging more parameters

Postby nplayle » Thu Jul 04, 2013 12:29 am

Hi,

I'm wondering how we can get more logged parameters on the board? For example, logging euler angles rather than quaternions, and desired and current pitch/roll/yaw. It'd be a pretty big help during PID tuning and the like. Would it require a custom version code?

Also is there a way to get the log file to show time in seconds rather than samples? A time of 80 000 doesn't particularly mean much to me.

These options may already be there, but I cant find any, and the search function doesnt return anything for 'log'.. i think it kicks out short search terms :(

Thanks,
Nick
nplayle
 
Posts: 7
Joined: Sun Jun 30, 2013 11:07 pm

Re: Logging more parameters

Postby bn999 » Thu Jul 04, 2013 3:04 pm

All of the items you mentions can be derived from the logged data. On the ground, you can extract Euler angles from the quats, calculate desired attitude from the radio channel data and calculate time offsets from the microsecond clock count. It is better to have the raw values than to re-transmit custom manipulations of them onboard.
bn999
 
Posts: 1559
Joined: Thu Jun 21, 2012 11:40 pm

Re: Logging more parameters

Postby Max » Fri Jul 05, 2013 12:21 am

Nick, I think most of what you're looking for can already be extracted using the LogDump tool, or right from QGC log viewer using the Export button. Except desired attitude... not sure how to calculate that offhand but as Bill says, the necessary data is already logged. You can always export everything to a CSV file and play with it in Excel/Matlab/etc.

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

Re: Logging more parameters

Postby nplayle » Mon Jul 08, 2013 5:16 am

Yes, I agree it's possible to get all the data from the logged parameters, but if you start tweaking the code to perform different functions it's desirable to log custom parameters. Or say if you were changing how the PID loops were structured - you can calculate what the desired velocity is, but you don't necessarily know that the code is actually using your calculated value.

Writing a script in matlab wouldn't be particularly difficult to do that, but I'd imagine most people don't have access to (or time to) write interpreters like that. Also (I haven't looked at this part of the code) don't the controllers use calculated Euler angles for control or is it direct from quaternions? If that's the case, you'd have a var with the data, it'd just have to be logged. Plus I'm thinking more along the lines of:
Say you're in position hold, but there's an offset, you're blown around by wind or something. The controller will generate a desired velocity and desired attitude to get the craft back to where it should be. These velocities arent really a function of any inputs (arguably GPS position but it's not really something you can calculate easily either), and would be hard to come up with. It also makes it harder to tune your gains because it's not immediately apparent which loop needs tuning. It would be neat to see a feature where you could specify what is logged to the card, but it would probably take a decent amount of work to implement.

I took a quick look at the code that does the logging. It'd probably take me a couple days do become familiar with it enough to add more parameters to it though. Which probably means I won't look into it much further for awhile unfortunately.
nplayle
 
Posts: 7
Joined: Sun Jun 30, 2013 11:07 pm


Return to AQ Firmware

Who is online

Users browsing this forum: No registered users and 11 guests

cron