Go to Post The spirit of FIRST is about learning not just about winning. - MamaSpoldi [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #46   Spotlight this post!  
Unread 06-03-2011, 14:25
Lil' Lavery Lil' Lavery is offline
TSIMFD
AKA: Sean Lavery
FRC #1712 (DAWGMA)
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Philadelphia, PA
Posts: 6,655
Lil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond repute
Send a message via AIM to Lil' Lavery
Re: pic: Killer Bees 2011 Robot - Buzz XVI

Quote:
Originally Posted by apalrd View Post
10-turn pot for the elevator, 270degree pot for the wrist.

During auto, all of the elevator commands are fed to the normal state-machine that is always running. The auto code only handles the drivetrain directly, using two encoders and a gyro for drivetrain positioning.

So, by "for positioning", I meant "for drivetrain positioning".
That's what I get for posting at 11:00 after two long days of competition.

(I actually write the auto routines in beescript, and use the beescript interpreter to call the auto command blocks, which set the state machine or drive, but that's mostly to avoid LV downloads when making auto routine changes)
I kinda figured you meant drive positioning. I was just curious about your elevator sensors, as we had some issues (which in large part, where a result of us not truly planning ahead for sensor mounting) with our elevator sensors and had to get creative in terms of how to measure it. Just wanted to see what you guys had done.
Reply With Quote
  #47   Spotlight this post!  
Unread 06-03-2011, 17:42
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: pic: Killer Bees 2011 Robot - Buzz XVI

Quote:
Originally Posted by tr6scott View Post
So can you send me a link or info on beescript, or how you do state machine stuff, and avoid the LV download.
1. You guys are awesome too.

2. Beescript. I wrote it myself (and named it after Bees, of course). Basically, I read a text file on the cRio (which I upload via FTP), and separate it into an array of lines, and then do this:
If the line starts with a #, skip it (it's a comment)
If the line has <3 characters, skip it (it's probably a space or blank).
Else, tokenize by spaces into an array of words, lookup the first word in an array to find the index, then look through another array of commands to find the command ref. Call it by ref, with the rest of the array as the argument (you have to use strict-type VI refs to do this).
Each command has the argument array input, and then looks through the arguments to find the ones it wants(usually by assuming the first argument is X, the second is Y, etc.), and uses those to run what it runs. Upon entering auto, it populates the array, with each command having the command name and the ref in an array (look at the WPI refnum registries for an example of how to do this).

3. State-machines. I have an array of cal points, each of which has an elevator height and arm position. I also have an enumerated type which defines the state. I double-buffer the state to handle going over backwards and forwards, since those use collision avoidance. I take the resulting state and lookup the position in the array (since enumerated variables can be used as unsigned int's) and also have a few special states which I further process (especially the score positions, which have score sequencing). I have a single get-set VI which handles state storage, double-buffering, and initialization. If it is disabled, it will uninitialized, and a command must be sent to re-initialize. The motors will be set to 0 if it is not initialized, this is a safety feature.

Simple: I use an enum and an array of positions, then lookup the position in the array. I also have a large case structure for special cases.

3a. I also have a few VI's that run after the state-machine, one which actually does P control to determine motors speeds, another which prevents the window motors from stalling (we have a few states which hit mechanical limits, so we drive the setpoint past the mechanical stop then kill it after it stalls to prevent PTC-tripping), and a third handles manual override.

3b. Since we have two robots (competition and practice), I translate all of the sensor inputs into inches and degrees, so I can use a single set of calibration data on both robots.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #48   Spotlight this post!  
Unread 07-03-2011, 11:21
tr6scott's Avatar
tr6scott tr6scott is offline
Um, I smell Motor!
AKA: Scott McBride
FRC #2137 (TORC)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2005
Location: Oxford, MI
Posts: 535
tr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond reputetr6scott has a reputation beyond repute
Re: pic: Killer Bees 2011 Robot - Buzz XVI

Ahhhh... you are a most clever code monkey...

that is much more than I am willing to take on at the moment, but we do have a few key variable data that needs to be tweaked and tested. I will look at what you have provided, and try to coach up the team.

I have done this in the PLC world with servo controllers, where the servo is programmed to do one move with variable data, and I just adjust the data as required.

Can you point me to where the data file should be placed on the cRio directory structure, and what type of file to create... standard text I am guessing is ok?

I will google around later today.
Reply With Quote
  #49   Spotlight this post!  
Unread 07-03-2011, 12:54
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: pic: Killer Bees 2011 Robot - Buzz XVI

If you FTP to the cRio, you can pick your directory. I put mine in /ni-rt/startup but the path in LabVIEW is c:\ni-rt\startup for some reason.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
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


All times are GMT -5. The time now is 23:29.

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