Go to Post The robots are just vehicles taking kids on a ride to STEMville. - FTC5110 [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 03-12-2010, 14:45
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Mecanum - use of gyro

Before you do any more with the software, make absolutely sure your hardware is correct. A "stuttering" turn is sometimes a sign that you have your mecanum wheels mounted in the wrong orientation. The rollers contacting the floor should make an "O" or diamond pattern; they should look like an "X" from above.

Also make sure you understand what the inputs to the LabVIEW PID block mean. I haven't looked at it in over a year, but at that time the I and D parameters were not gains. They were time values. That scheme is just as easy to tune as a gain-based one, as long as you recognize that a smaller I or D value yields a stronger response than a larger value.
Reply With Quote
  #17   Spotlight this post!  
Unread 03-12-2010, 15:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum - use of gyro

Quote:
Originally Posted by Ether View Post
Tell us a little more about your vehicle. What size and kind of mecanum wheels are you using; how are they mounted (can you post a close-up picture to go along with your words)
With mecanum wheels, the mounting is very important, and is a common source of error:
  • each mecanum wheel is either right-handed or left-handed. It is important that the wheels are mounted at the correct locations on the vehicle

  • mounting mecanum wheels at the end of a "stalk" that is not stiff enough can cause control issues


Reply With Quote
  #18   Spotlight this post!  
Unread 03-12-2010, 19:21
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,513
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Mecanum - use of gyro

Quote:
Originally Posted by Alan Anderson View Post
Before you do any more with the software, make absolutely sure your hardware is correct. A "stuttering" turn is sometimes a sign that you have your mecanum wheels mounted in the wrong orientation. The rollers contacting the floor should make an "O" or diamond pattern; they should look like an "X" from above.

Also make sure you understand what the inputs to the LabVIEW PID block mean. I haven't looked at it in over a year, but at that time the I and D parameters were not gains. They were time values. That scheme is just as easy to tune as a gain-based one, as long as you recognize that a smaller I or D value yields a stronger response than a larger value.
Oh. My. Gosh.

We've been using labview since FRC started using it, and I never even thought to check it: I just assumed it was a normal non-dimensional gain number that would act the way most PID setups expect it to act.

During this year's game we had a very robust targetting system in real time that would turn the robot and shoot after pushing the fire button. However, we removed it because we could not tune in the I and D portions to get the level of speed required: it was slightly slower than our driver's aiming and therefore wasn't effective.

I feel very, very silly right about now.
Reply With Quote
  #19   Spotlight this post!  
Unread 04-12-2010, 12:32
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Mecanum - use of gyro

Quote:
Originally Posted by Ether View Post
Are you saying that jitter would be less than 1ms in a periodic task in a ready-for-competition code release that has several concurrent threads competing for CPU ?
I would expect there to be more than 1ms jitter unless you are using a timed loop for your periodic task. Especially if you are running your controller in teleop. That loop timing is based on the incoming UDP packets from the DS, not a local timer.

Even if you aren't, though, the benefit of the automatic delta time calculation is that your controller will still behave well even in the presence of jitter. It simply measures the jitter and uses the actual time instead of the ideal time when computing the I and D terms.
Reply With Quote
  #20   Spotlight this post!  
Unread 04-12-2010, 23:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum - use of gyro

Quote:
Originally Posted by jhersh View Post
I would expect there to be more than 1ms jitter unless you are using a timed loop for your periodic task.
So you're saying you'd expect jitter in a periodic task to be less than 1ms (in a full-function competition code release with many concurrent tasks)?

You know more about LabVIEW than I do, but I find that surprising. I would have thought that the way LabVIEW protects critical sections would create more software latency than that.


Reply With Quote
  #21   Spotlight this post!  
Unread 05-12-2010, 00:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum - use of gyro

Quote:
Originally Posted by jhersh View Post
the benefit of the automatic delta time calculation is that your controller will still behave well even in the presence of jitter. It simply measures the jitter and uses the actual time instead of the ideal time when computing the I and D terms.
Capisco. I just misread the LabVIEW documentation.

Out of curiousity I looked at the PID block diagram to see what numerical integration algorithm it uses. Not being very adept at LabVIEW I couldn't parse it (and it wasn't commented). Is it simple Euler or something more sophisticated ?



Reply With Quote
  #22   Spotlight this post!  
Unread 05-12-2010, 00:37
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Mecanum - use of gyro

For clarification:

Apparentally you can get resolution finer than 1ms using a 1MHz timing source, but I've never had a time-critical task that executes that quickly.
__________________
-- Marshal Horn
Reply With Quote
  #23   Spotlight this post!  
Unread 05-12-2010, 08:56
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Mecanum - use of gyro

I've attached the context help for the PID. It is described as the simple one, but it includes integrator anti-windup, output limits, and bumpless gain changes. It also supports wiring up N values in an array, and it will manage and control all of them using the same control settings.

As for learning to read LV, that is definitely starting pretty deep in the pool, but I'll point out the big chunks.

In the lower left of the loop, it determines what the dt is. It can be user specified or if unwired, is calculated by the function.

Upper left are some comparisons to determine if the PID coefficients are the same as the previous call (to fix the state data and avoid bumps).

The code in the center and lower right calculate the terms. Note that this uses the academic form with Kc, Ti, and Td. The two icons at the upper left of the switches were used to document which term was being computed.

Other comments are sprinkled inside the cases for the exceptional cases such as reinitialize, dt=0, etc.

Note that I'm describing the PID.vi, the simple one. There are several others in the full Control portion of the palette -- Advanced, Auto-tuning, etc. I didn't write any of these, but may be able to help you read them if that is what you are asking.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2010-12-05 at 7.32.40 AM.png
Views:	47
Size:	28.1 KB
ID:	9464  
Reply With Quote
  #24   Spotlight this post!  
Unread 05-12-2010, 10:46
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Mecanum - use of gyro

Concerning the loops and timing jitter, the normal while loop inherits the priority of the VI it is within. Note that by default, subVIs inherit their caller's priority as well. Initially everything in the FRC framework is set to normal priority. If you decide you want to bump something, you change that subVI's priority in its properties/execution page, and it typically propagates as you intend.

The delay used in the while loop that was shown has a resolution of 1 ms, and is not considered low jitter, though it typically performs fine IMO. The low jitter and higher resolution delays and timing functions are located in the real-time palette.

The timed loop incorporates these timing functions into the loop and performs many of the common calculations for you. The timed loop lets you choose between a 1ms, 1us, or device specific clocks which may be available. It lets you choose between a few different timing policies concerning missed periods. It lets you set priority on each loop without needing to embed it in a subVI. It lets you more easily measure actual start times vs scheduled start time, actual and scheduled finish times, whether the loop met or missed the deadline and by how much, etc.

From what I've seen, common FRC tasks are fine with msec resolution and aren't bothered by a few ms of jitter, so the framework starts simple. Meanwhile, if you find that an arm or other mechanism needs it, the real-time mechanisms are there to lower the jitter. Similarly, the framework uses simple globals to share information between loops and subVIs. To gain determinism, you would trade those for RT FIFOs which are more complex, but can offer jitter or performance benefits and offer more control in corner situations.

Greg McKaskle
Reply With Quote
  #25   Spotlight this post!  
Unread 07-12-2010, 08:43
mwsmith78 mwsmith78 is offline
Registered User
FRC #2729 (STORM)
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: New Jersey
Posts: 7
mwsmith78 is an unknown quantity at this point
Re: Mecanum - use of gyro

Lots of posts since my last one ... I will try to knock off all the questions.

Using 6" Mecanum wheels with tapered rollers (from AndyMark). Wheels are correctly mounted. The robot drives correctly w/o PID loop - although it does tend to have rotation error. Given that it works well before attempting closed-loop control, I believe that points to the software.

If I understand correctly about the PID post - the I & D gain values are time constants and for tuning purposes should start HIGH and work down. Meanwhile, the proportion gain should start low and work up. That may explain why we were having trouble tuning. When we inserted I and/or D values, we started very small. If we want it to function as a P-only loop, is setting I and D to zero correct?


http://www.youtube.com/watch?v=KL7iZXCRtPw
Reply With Quote
  #26   Spotlight this post!  
Unread 07-12-2010, 08:44
mwsmith78 mwsmith78 is offline
Registered User
FRC #2729 (STORM)
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: New Jersey
Posts: 7
mwsmith78 is an unknown quantity at this point
Re: Mecanum - use of gyro

Direct-driven using CIMs and Victors.

Have another post pending that will answer other questions. It includes youtube video and requires moderator approval.

Last edited by mwsmith78 : 07-12-2010 at 08:46.
Reply With Quote
  #27   Spotlight this post!  
Unread 07-12-2010, 11:46
mwsmith78 mwsmith78 is offline
Registered User
FRC #2729 (STORM)
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: New Jersey
Posts: 7
mwsmith78 is an unknown quantity at this point
Re: Mecanum - use of gyro

Lots of posts since my last one ... I will try to knock off all the questions.

Using 6" Mecanum wheels with tapered rollers (from AndyMark). Wheels are correctly mounted. The robot drives correctly w/o PID loop - although it does tend to have rotation error. Given that it works well before attempting closed-loop control, I believe that points to the software.

If I understand correctly about the PID post - the I & D gain values are time constants and for tuning purposes should start HIGH and work down. Meanwhile, the proportion gain should start low and work up. That may explain why we were having trouble tuning. When we inserted I and/or D values, we started very small. If we want it to function as a P-only loop, is setting I and D to zero correct?
Reply With Quote
  #28   Spotlight this post!  
Unread 07-12-2010, 13:47
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Mecanum - use of gyro

Quote:
Originally Posted by mwsmith78 View Post
The robot drives correctly w/o PID loop - although it does tend to have rotation error.
Could you please clarify what you mean by "rotation error"? Are you saying that when you give a "straight ahead" command, the bot wants to turn?

Or are you saying that when you give a "turn" command, it doesn't respond as you think it should?

(or something else?)

Are you using the built-in vi to compute mecanum wheel speeds, or did you design and code your own algorithm ?



Reply With Quote
  #29   Spotlight this post!  
Unread 07-12-2010, 17:24
MartinB MartinB is offline
Registered User
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: NJ
Posts: 14
MartinB is an unknown quantity at this point
Re: Mecanum - use of gyro

I can anwser the question about the rotation error. What he means is that the robot drifts when we do not expect it to and that is why we wanted a software solution to the rotation error.
Reply With Quote
  #30   Spotlight this post!  
Unread 07-12-2010, 22:19
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Mecanum - use of gyro

Quote:
Originally Posted by mwsmith78 View Post
If I understand correctly about the PID post - the I & D gain values are time constants and for tuning purposes should start HIGH and work down. Meanwhile, the proportion gain should start low and work up. That may explain why we were having trouble tuning. When we inserted I and/or D values, we started very small. If we want it to function as a P-only loop, is setting I and D to zero correct?
Yes, you are correct.
__________________
-- Marshal Horn
Reply With Quote
Reply


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
Why you WANT to use a Gyro this year JesseK Electrical 10 19-01-2010 15:49
[FTC]: Anyone know how to use the Gyro? ttldomination FIRST Tech Challenge 0 31-01-2009 21:19
Ever use a helicopter heading hold gyro before? seanwitte Electrical 7 16-01-2008 12:59
how can you use a gyro in autonomous mode magical hands Programming 3 02-01-2004 13:31
Gyro Chip: How To Use archiver 1999 3 23-06-2002 21:57


All times are GMT -5. The time now is 04:36.

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