Comments on: Profiling Cleanflight and speeding up the Naze32 https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/ Wed, 04 May 2016 04:28:27 +0000 hourly 1 https://wordpress.org/?v=7.1.3 By: Anthony https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-755 Wed, 04 May 2016 04:28:27 +0000 http://flysherlockair.com/?p=56#comment-755 Wow, Brilliant post. Thanks for sharing.

]]>
By: nick https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-75 Sun, 20 Sep 2015 06:31:15 +0000 http://flysherlockair.com/?p=56#comment-75 In reply to Scott.

That ability has not been added yet, but yeah that would be an interesting idea for the Blackbox. It doesn’t seem like that would be a useful feature for the Configurator since the 3D model would just be window-dressing at that point (wouldn’t reveal the actual attitude estimate of the FC so doesn’t reveal anything about potential flight problems).

The skipping of the IMU happens here:

https://github.com/cleanflight/cleanflight/blob/master/src/main/flight/imu.c#L304

imuCalculateEstimatedAttitude() is never called when an accelerometer sensor is not present.

]]>
By: Scott https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-72 Thu, 17 Sep 2015 22:25:49 +0000 http://flysherlockair.com/?p=56#comment-72 Has anyone added something so we can get accSmooth in the Blackbox but not run the IMU attitude code? Couldn’t we also use the Blackbox viewer’s IMU code in the Configurator so it still worked without the FC’s IMU? When looking at the code it appears it still runs but all acc inputs are 0. Is that correct or am I missing where the code is skipped?

]]>
By: nick https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-68 Wed, 16 Sep 2015 11:14:48 +0000 http://flysherlockair.com/?p=56#comment-68 In reply to Colby.

Which ESCs are you using? I think some of them don’t like sub-1000 looptimes.

]]>
By: Colby https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-65 Mon, 14 Sep 2015 20:54:26 +0000 http://flysherlockair.com/?p=56#comment-65 In reply to nick.

I disabled the accelerator and lowered my looptime….now my quad falls out of the sky 🙁

]]>
By: nick https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-51 Tue, 18 Aug 2015 12:33:11 +0000 http://flysherlockair.com/?p=56#comment-51 In reply to Zap Andersson.

There is a bunch of time involved in just simple multiplies, divides and additions as well, so speeding up the trig functions isn’t everything. But yes, there is speedup to be had from improving the trig. Check out this PR for a faster trig approximation solution: https://github.com/cleanflight/cleanflight/pull/1092

]]>
By: nick https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-50 Tue, 18 Aug 2015 12:31:44 +0000 http://flysherlockair.com/?p=56#comment-50 In reply to ingmar.

Yes, it does currently avoid reading the accelerometer I2C registers when the acc is disabled, so there will be a speedup from that.

]]>
By: ingmar https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-49 Mon, 17 Aug 2015 16:57:33 +0000 http://flysherlockair.com/?p=56#comment-49 I don’t know the current state of the source code, but shouldn’t the i2c-Read in the last scenario be faster because there are less registers to read without the acc? if not it should be the place for your next optimization

]]>
By: nick https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-47 Mon, 17 Aug 2015 03:49:50 +0000 http://flysherlockair.com/?p=56#comment-47 In reply to Edward Rosales.

You mean the speedup from disabling the accelerometer? Yep, that’ll work fine!

If you mean the profiler, I haven’t included it into the target.h file for CC3D, but it should work (however you need to assign the right timers to the profiler).

]]>
By: Cleanflight Looptime | quadyearbook https://flysherlockair.com/2015/07/how-does-cleanflight-spend-its-time-lets-profile/#comment-46 Sun, 16 Aug 2015 02:20:58 +0000 http://flysherlockair.com/?p=56#comment-46 […] the ungoverned looptime of the flight controller in rate mode was about 900us.  According to this article, if you are running in rate mode, the accelerometer hardware can be disabled with “set […]

]]>