Quote:
Originally Posted by Mark McLeod
We're pretty much limited to updating the pwm outputs at the slow loop speed whether regular driver mode or autonomous. While there is the potential to update a few special pwm outputs at a faster rate, the devices attached to the pwm outputs, such as Victors, aren't designed to receive the updates very much faster than the current slow loop speed.
|
Those "special outputs" are 13-16, right? The ones our code has to generate the PWM signal for?
Quote:
Originally Posted by Mark McLeod
In any case the response of the downstream systems such as the Victors, motors, and drivetrain will lag and swallow the milliseconds we might save.
|
OK. That makes sense, as setting an output to max for only 26.2ms outputs a pulse that barely tensions the chain, let alone moving the drivetrain. I just thought that polling the gyro really fast was a good idea, but I didn't realize how short 26.2ms is.
Quote:
Originally Posted by Mark McLeod
To work properly PID feedback control depends on regular feedback not just speed and to make correct decisions needs previous decisions to be acted upon. It'll quickly lose track of things if the outside world is ignoring 99% of it's requests for motor changes and only acting on a random 1%.
|
I knew this would be damaging to the algorithm if the victors weren't getting the updated signal, but I didn't think that they were only updated every slow loop. Now that I know this, I have a little more info on why our PID loop was so broken last year (it oscillated beyond control in about 3 seconds. I know how to tweak it now; I didn't then).
Quote:
Originally Posted by Mark McLeod
Typically, use the fast loop of Process_Data_From_Local_IO to sample sensors, especially polled sensors, and collect data for use in making decisions later in the slow loop.
|
So you mean poll the sensors if I want an average over that 26.2ms instead of an instantaneous reading during the slow loop?
Quote:
Originally Posted by Mark McLeod
The default code slow loop in main() is just used to kickoff the separate autonomous slow loop. The way the autonomous slow loop is coded doesn't allow anything else, including the main.c loop, to run again until the Master signals the end of autonomous mode. We eliminate the separate autonomous loop and only allow the main loop.
|
Oh, I forgot it was a separate loop. I ripped that out of last year's code, but in hindsight I could've left it just like it was. About the part that's bolded above: what do you mean? Do you mean that your team has ripped out the separate loop and let main() loop like normal?
Thanks
JBot