You are here

Max thread rate for simple app?

1 post / 0 new
clazarowitz
Offline
Last seen: 1 year 10 months ago
Joined: 2022-04-20 02:28
Posts: 1
Max thread rate for simple app?

Not sure if this is the right forum, and I'm getting ahead of myself here as I've not even powered on a single controller.  I have the fsesc 6.6 based on a stm32f405.  Rather than a skateboard though, I'm controlling a dual motor device with a dynamic moment of inertia.  (Sounds cooler than it is).  I want to adjust the commanded speed on the fly based on the angular position and the statically changing moment of inertia, thus giving me a constant angular momentum mode.  

The "app" method seems to be an easy way to do this, and the example shows an app with a thread running at 500Hz.  For just reading an encoder and setting commanded speed, is that a strenuous task on this 168MHz processor, or can I expect to go to a higher frequency?  How much higher?  In reality, I think 10kHz is probably the upper limit I would want.  That gives 120 updates per revolution at 5000rpm...yes...dynamic moment of inertia at 5krpm.  Don't ask :). I'm probably crazy...and the device will run inside a large mass of lexan at least for the first several runs...safety first!  Is this even close to reasonable or should I temper my expectations and designs?  If 10kHz is unreasonable, what would you guess to be reasonable?  Not looking for accurate numbers, just a guess to get me in the right order of magnitude :)