Go to Post FIRST is inspiration. No matter how you do it, you learn something. Stop being silly. Stop making accusations. Go build robots. Now. - Aignam [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 02-04-2007, 20:05
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,076
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: VICTOR RESPONSE DELAY? - AGAIN

The Victor updates at 120Hz. Worst case performance (assuming you have to wait the entire 26.2 ms to send the command to the master uP and you have to wait 8.3 ms for the Victor update) should be about 34.5 ms.

Note that the status lights and the movement of the motor are NOT good ways to confirm this. The status lights have some buffering in them, and motors take awhile to spin up or down (especially with gearing or loads attached). If you measure the lag between motor command setting and sensor output, then you are taking into account:

1. User to master uP communication
2. Actual Victor lag
3. Motor lag
4. Sensor lag

Try hooking the outputs of the Victor to an oscilloscope to verify. You can pulse a square wave on the Victor (i.e. output 127, 254, 127 at a certain frequency) while also pulsing a digital output pin. Look at both outputs to find the actual values for #1 and #2 above.
  #17   Spotlight this post!  
Unread 02-04-2007, 21:31
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: VICTOR RESPONSE DELAY? - AGAIN

Remember this... the victor CHOPS at 120Hz on its output (which is dang slow, hence the angry buzzing all first robots seem to make).

The victor can only take input at a rate of about 100Hz (98Hz if your cautious). I wrote myself a two channel pwm driver using CCP's to make a high update rate traction motor servo for our robot and found that there was a control output delay of just microseconds from control input to output when you use an output hardwired in the processor and use an oscilloscope triggering on the control input and measureing the shift on the output by having channel 2 on your scope hooked on to M+.

Mechanics do add some latency, but the thing you really have to watch is that most people are running their pwm's on the default ifi 26.2ms basis, not on a timebase of your own.

My suggestion is just to set up a freerun timer, use eccp1 as a timebase, then eccp2 and eccp3 as duty cycle triggers (set them in hardware to initialize pin high then clear + interrupt on compare match). not only do you get a nice high update rate, but you get 16x the resolution on your motor drives. VERY nice for pid's, made a world of difference with the resolution and the update rate increase.

any ?'s just hit me up. I can dig up my research notes on the victor period times n such if anybody wants it, i'll scan the pages in and hopefully somebody reads bad handwriting....

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #18   Spotlight this post!  
Unread 03-04-2007, 11:54
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,076
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: VICTOR RESPONSE DELAY? - AGAIN

Every official IFI post I've read about the Victor says that there are 94 discrete speed steps in both the forward and backward directions. While using custom PWM programming could increase update rate, I am skeptical of the claim that you gain any resolution improvements.
  #19   Spotlight this post!  
Unread 03-04-2007, 14:06
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,766
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: VICTOR RESPONSE DELAY? - AGAIN

To add some explanation...
The output frequency of the Victor was reduced in this model vs the previous model. With the type of motors we use, the 120 Hz rate works better when considering the brush design and rep rate of brush and commutator. This allows better average current control for the motors.
From IFI FAQ for Victors...:The Victor will turn ‘On’ at a value of 138 and it will be at Full Forward condition at a value of 232, which is 94 steps. The output will vary linearly from 3% to 100% over these 94 steps." This compensates for the poor performance of the pots in standard joysticks.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
  #20   Spotlight this post!  
Unread 05-04-2007, 09:47
Mike Bortfeldt Mike Bortfeldt is offline
Registered User
FRC #1126 (& 1511)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Rochester, NY
Posts: 119
Mike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud of
Re: VICTOR RESPONSE DELAY? - AGAIN

This thread got me wondering what the exact delay is for generating PWMs 1-12. Last year, based on some crude testing, I noticed that there seemed to be about a 50 millisecond delay between setting a PWM value and seeing a response (as Greg references in his first post). This observation came from monitoring the dashboard data and was therefore, not very accurate. Yesterday, I did some additional testing and here are the results.

- PWMs 1-12 are generated by the master processor in groups of 3 (1-3, 4-6, 7-9, 10-12). Within each group the pulses are generated simultaneously with only the pulse width varying. Each group follows the start of the previous group by approximately 2 milliseconds. Therefore the previous group pulses are completed (no matter what the pulse width) before the next group is started. This ensures a constant frequency independent of the pulse width of previous groups.

- The delay between setting the PWM variable and seeing the start of the pulse on the output pin can be up to the following:
Group 1 (PWMs 1-3) - 43 milliseconds
Group 2 (PWMs 4-6) - 45 milliseconds
Group 3 (PWMs 7-9) - 47 milliseconds
Group 4 (PWMs 10-12) - 49 milliseconds

- The minimum delay before the Victor can respond will be at least 1 millisecond and up to 2 milliseconds more depending on the pulse width. The Victor output frequency and mechanical delays will increase the time before you see a response as well.

- The delay is dependant on when the PWM variable is set in the code. The delays shown above are based on setting the PWM variable at the start of the routine "Process_Data_From_Master_uP" (and are therefore maximum values). If your user code takes 10 milliseconds to execute and you set a PWM value at the end of this time, then the delay before the "new" pulse is generated will be 10 milliseconds less. From what I can see, executing the routine PUTDATA does not immediately send the updated data to the master processor. This only occurs once every 26 milliseconds, probably at nearly the same time that new OI data is being received. Either that, or the Master processor doesn't act on the new data until the end of the 26 millisecond period.

Test Setup - The entire test was performed using only the RC. The PWM output to be tested was connected to Digital Input #3 (interrupt enabled). Each pulse width was timed to an accuracy of 1/4 millisecond. The PWM to be tested was normally set at "254" (2 milliseconds). Roughly once a second (every 40 calls to Process_Data_From_Master_uP) the PWM was changed to a value of "0" and the elapsed time between setting the PWM and observing the first 1 millisecond pulse (actually 1.25 milliseconds or less) was timed to an accuracy of 1/4 millisecond. Once the pulse was seen, the PWM value was reset to 254 in preparation for the next test, 1 second later. Data was very consistent. (OI & RC were tethered)

A second test was performed by delaying the setting of the PWM to "0" from the start of the Process_Data_From_Master_uP by putting in a 10 millisecond delay at the beginning of the routine. This resulted in delay values exactly 10 milliseconds less than the first test.

Mike

Last edited by Mike Bortfeldt : 05-04-2007 at 10:39.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delay Help! waiakea2024 Programming 7 21-02-2007 12:41
Autodesk's response Koko Ed 3D Animation and Competition 7 20-01-2007 16:52
NERDS Delay... Andy Grady General Forum 21 14-03-2006 21:52
Delay Gal Longin Programming 1 09-12-2004 10:37
Victor 884's not behaving the same as Victor 883's programmer1 Programming 13 10-03-2004 21:51


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

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