![]() |
concerned about bogging down rc?
Are you concerned about using to many intterupts and other sensors all together and slowing down the entire processor??
|
Re: concerned about bogging down rc?
My team's a bit concerned about it, but we haven't had any actual trouble... yet.
We've been working with the camera and with some encoders but it's all been separate so far. Once we actually put it all together, though... |
Re: concerned about bogging down rc?
To an extent. Instead of worrying about it we just reduce them to not using too many interrupts, then hope there's not a problem.
|
Re: concerned about bogging down rc?
Last year, we used the camera with 3 encoders no problem. Custom encoder code, though. There was absolutely no issue. We also did not use pwm13-16.
|
Re: concerned about bogging down rc?
Not concerned at all. We only sense what we need; generally this means a couple of encoders at reasonable PPRs, a camera, and maybe a gyro or other analog sensor.
Even with multi-channel PID controllers, we have never had any problem with either code space or execution time. |
Re: concerned about bogging down rc?
Though not really worried about this, we were interested enough in this problem to actually get some hard numbers on this.
Using this as a guide, and with the help of the C18 library reference, we used the onboard timers to figure out how fast the Process_Data_From_Master_Function ran. Here's (more or less) what we did: Code:
void Process_Data_From_Master_uP(void)The same treatment can be applied to your autonomous code, as it uses pretty much the same loop. My line of thinking was that what really matters is how much time it takes for you to take new data from Master and turn it around to produce output. We haven't really tried much real measuring using this method, but we did find one interesting thing: the Generate_Pwms call takes a whopping 8% of your processing time. If anyone else has some improvements to make to this method, I appreciate suggestions. When we get around to actually timing some functioning code, I'll post some results here. |
Re: concerned about bogging down rc?
Orborde,
Back in 2004/2005 I calculated the processor "free time" by counting the number of times the routine "Process_Data_From_Local_IO" was called in a 1 second period. Since this routine continually gets executed as long as there is nothing better to do (and we didn't have any custom code in it), it's a good way to see how loaded the processor is. In my case it took 14 instruction clock cycles to complete the while loop in "Main.c" as well as the call/addition/return of the "Process_Data_From_Local_IO" routine as long as there wasn't new OI data. With the processor running at 10 MHz instruction clock speed, it was a simple matter to calculate a % free time. We posted this to one of the User_Bytes so we could monitor it on the dashboard, and you could see the % free time change as the number of interrupts varied due to motor speeds (drive encoders mainly). As for the 8% for the generate_pwms call, it sounds about right. My understanding is that the routine uses a loop to "wait" for the required amount of time to generate the 1-2 msec PWM pulse. Assuming a maximum 2 msec pulse, executed at about 38 times per second, that comes out to a delay of about 76 msec, or about 8% of the processor. Mike |
| All times are GMT -5. The time now is 04:12. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi