Go to Post "FIRST is like a pizza, we all think different toppings should be on it" - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 8 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 30-01-2014, 10:38
gpetilli gpetilli is offline
Registered User
FRC #1559
 
Join Date: Jan 2009
Location: Victor, NY
Posts: 285
gpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to allgpetilli is a name known to all
Thread scheduler for PID period control ?

We are trying to optimize our custom PID loop and appear to be getting conflicting data that I am hoping someone can clarify.

1) From numerous CD threads, I believe that the standard teleopPeriodic time is initiated from the drivers station at approximately a 20ms rate. However, at least two threads mention a 50ms periodic rate (older IFI rate?).
2) I have seen several threads which recommend using a separate thread based on the OS scheduler for tighter tolerance. Team 358 "Timing is Everything" white paper is an excellent reference. 10ms seems like a common period for PID.
3) The PID_control class does use the scheduler to create its own thread. I thought I saw on CD the default period was 20ms, but the Java Docs say it is 50ms.

So now here is our confusion.
4) We set up a timed PID thread with period 10ms. We set up a delta time measurement in both the teleop periodic and timed PID loops and plotted the delta times. The timed loop was 20ms +/- 4ms and the periodic was closer to 50ms +20/-10ms. Setting the period to 20ms gave about the same response.
This was done using Java on the older 8 slot cRIO on our test chassis. We do not yet have access to the production 4 slot cRIO. I can believe the old cRIO cant do the 10ms period but that does not explain the 50ms for the drivers station. I have not hooked up a scope to a DSC pin to confirm that the time reported by the OS is accurate.

The timing is clearly faster and more consistent with the timed loop, but I hate unexplained behaviors.

Does anyone know if the periods on the older cRIO were different and if the driver station software adapts? Is the delta time reported by the OS accurate? What period are people using for PID loops?
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi