Go to Post *When putting grease on anything* "The bigger the glob the better the job." - TheMagicPenguin [more]
Home
Go Back   Chief Delphi > Technical > Programming
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
  #1   Spotlight this post!  
Unread 12-01-2008, 23:56
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

Another bit of information ... the PIC microcontroller and runtime environment used in FIRST hasn't changed much in the past several years (since 2004? well, a couple of years ago they changed the PIC part to a different one with more memory, and last year they changed the radio, but both run the same code at the same 10 MHz speed). The rule seems to be "incremental changes" and "don't mess with success - it only causes problems".

So assuming they don't change in years to come, information gleaned is not totally wasted. But since when does technology stand still?
  #2   Spotlight this post!  
Unread 13-01-2008, 09:22
jtdowney jtdowney is offline
Boiler Up
AKA: John Downey
FRC #4302 (Robophins)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2006
Location: Chicago
Posts: 300
jtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant futurejtdowney has a brilliant future
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

Quote:
Originally Posted by mluckham View Post
Another bit of information ... the PIC microcontroller and runtime environment used in FIRST hasn't changed much in the past several years (since 2004? well, a couple of years ago they changed the PIC part to a different one with more memory, and last year they changed the radio, but both run the same code at the same 10 MHz speed). The rule seems to be "incremental changes" and "don't mess with success - it only causes problems".

So assuming they don't change in years to come, information gleaned is not totally wasted. But since when does technology stand still?
It has been rumored this is the last year for the current architecture. Now what exactly will change is anyones guess.
__________________
John Downey
Lead Robot Inspector - Purdue IndianaFIRST District
Whitney Young Magnet High School/Robophins (FRC 4302) - Mentor (2013-current)
Midwest Regional Planning Committee - Member (2012-current)
Boilermaker Regional Planning Committee - Member (2011-2014)
Robot Inspector (2008-current)
Purdue FIRST Programs - Staff Advisor (2008-2011)
Lafayette-Jefferson High School/Precision Guessworks (FRC 1646) - Mentor (2006-2011)
  #3   Spotlight this post!  
Unread 13-01-2008, 11:52
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

Part of the acronym soup for this group is PID. It's a shorted version of proportional-integral-differential control. The idea is to use a sensor to measure an actual output, compare it to the commanded output, and adjust until they converge. I think you can get by with a proportional term only the most of the time. There are lots of samples on these forums.

You can also use the technique to move from "relative" to "absolute" position. The basic example is a servo, which moves to a fixed position based on the input command. Instead of saying "go forward" or "go backwards" you call tell it to "go to position X".

The sensors commonly used are:

1) Gyro - analog sensor measures angular velocity. By sampling at a fixed interval integrating the output you can convert the value to a relative angle (think compass).

2) Encoder - device that measures rotational distance by being physically coupled to the thing you want to measure. As the shaft rotates it outputs a series of "ticks". They have a fixed number of "ticks" per rotation. By counting the ticks you can measure distance, and by accruing the distance over time you can measure speed. A quardature encoder allows you to determine both distance AND direction.

3) Potentiometer (pot) - variable resistor that outputs an analog value relative to the position of the shaft. This is useful for measuring a joint with a fixed arc (like an arm). For the arm application you can compare the output of the pot to the commanded value and drive the motor until the two values match.

Using this stuff you can write code to make your robot drive the way you want. For a simple tank-style robot I like to break it down into two commands: forward and rotation. Using a gyro or encoders you can more closely relate your forward/rotation commands to the actual performance of the system.

Good luck!
  #4   Spotlight this post!  
Unread 13-01-2008, 12:16
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

Another important resource for specific hardware info is the IFI FAQ Forum
OI FAQs
RC FAQs
Victor Speed controller FAQs

In my opinion the most important of which is the Outputs Steps FAQ.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #5   Spotlight this post!  
Unread 13-01-2008, 13:08
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

HAH! NOW aren't you sorry you didn't listen to your mother when she told you to stop coding, get off that computer and ...build a Circuit! (Sorry, I'm mainly a Tech Type...)
One thing I'm not sure anyone mentioned was the Dashboard Monitor.
The robot may be a pile of parts but if you can tether the Robot controller, power up the Operator Interface and using the Dashboard Program, download and At least see the effects on the PWM and buttons.
The with minimal hardware just power a relay or use a switch to see the inputs. Things like that.
You could do some simple programming while the robot is being build instead of waiting.
Hope this was a useful suggestion.

Good luck

Steve
  #6   Spotlight this post!  
Unread 13-01-2008, 16:17
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

OOPS! I Meant to say... Power Up the Robot controller... the Operator Interface will get it's power from the Robot controller... My Bad.

Steve

Quote:
Originally Posted by Steve_Alaniz View Post
One thing I'm not sure anyone mentioned was the Dashboard Monitor.
The robot may be a pile of parts but if you can tether the Robot controller, power up the Operator Interface and using the Dashboard Program, download and At least see the effects on the PWM and buttons.
  #7   Spotlight this post!  
Unread 13-01-2008, 17:02
jratcliff jratcliff is offline
Registered User
no team
 
Join Date: Jan 2008
Location: Lake Saint Louis, Missouri, USA
Posts: 10
jratcliff will become famous soon enoughjratcliff will become famous soon enough
Re: Help,....

Thanks all for the excellent advice. I have been reading documentation today and I think I have a handle on the flow of control now.

I did run into one weird problem, I wonder if anyone else is having. I tried downloading the latest version of the MPLAB-IDE from the microchip website and every time I download any version I get CRC errors when I try to unzip the file. Has anyone else experienced this?

To answer a few points that were raised in the thread.

(1) I am mentoring a total of six students on our FRC team in programming. I spent four hours giving them a one on one training course on Saturday; these were all Freshmen with little to no programming experience with the exception of my son.

(2) My son is really interested in taking a leadship position on the team. He has been programming for quite some time and is really excited about contributing not just this year, but in years to come. My personal goal is to give him enough experience working with the VEX robot at home that he can be much more involved on the FRC project at school. The robotics club meets frequently but with my work schedule the only time I can make available is on Saturday.

(3) The reason I am focusing on MPLAB and C, rather than Easy C, is because that is easier for me personally at this time. I'm sure the youth will have opportunities to be exposed to the Easy C paradigm at future events throughout the year. However, in the short term, it is much easier for me to just program in native C code since that is a high iteration cycle path. Yesterday I felt a bit lost in all of the acronyms but a morning of reading yet more documentation is going a long way towards getting me up to speed.

Thanks all for the help getting started, it is my hope that I will be of assistance to the general FRC community in years to come and I certainly want to help mentor students in the St. Louis area after this season has completed.

Thanks,

John & Alex
  #8   Spotlight this post!  
Unread 13-01-2008, 17:31
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: Help, I'm a world class computer programming genius yet I'm totally lost.

It is true that the programming system is far too extensive to learn within six weeks. For experienced teams, that's not a problem, because in the past four years, the only changes that have been made were tweaking and debugging. For new teams, that's a different story. The only advice I can really offer is that of all the info you'll find in the documentation, you'll only ever use maybe 10% of it. IFI does take care of a LOT of stuff for you, so you don't really have to worry about it.

I've read a good deal of the documentation myself, little by little over the years, so I have a fairly good idea of what the controller is capable of, but I've never read them too far in-depth. I'd recommend the same to you, at least until the main season's over. As much as possible, use the default stuff IFI provides and utilize resources like the IFI Default Code Manual, Kevin Watson's stuff (as if that hasn't been said enough already), and particularly this site. There's always someone here knolwedgable and willing enough to answer questions, or at least show you where to find the solution. Plus, odds are someone's already asked most of your questions before.

And I agree with you on the EasyC point. When they introduced EasyC after my first two years of just straight C, I gave it a shot and found myself confused to no end. I eventually worked out a few basics, but found that it was just so much easier to use straight C, and in the end, the code produced was smaller and more efficient. Besides, C isn't the hard part of programming the FRC or FVC controller. The hard part, like you said, is integrating what you know with the hardware specifics of the PIC controller.
__________________
Code:
void function(void)
 {
  function();
 }

Last edited by Jake M : 13-01-2008 at 17:35.
  #9   Spotlight this post!  
Unread 13-01-2008, 21:11
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Help,....

I went to the Microchip site and downloaded the zip file with MPLAB 8.01. No errors. I tried installing it. Also no errors and the application launched just fine. If you're getting CRC errors, I wouldn't use it. You should have gotten a Disc in the FIRST kit of parts and I'd advise finding that instead of downloading from the Microchip site. ALSO, in previous years, we were warned to only use MPLAB ver 7.20 and C18 Compiler ver 2.40. Not sure if that still applies.
Anyone else know?
Anyway, I'd really recommend using the kit of parts disc since it will have the correct version and you shouldn't have the CRC problem using that.

I looked at Easy C. last year... I agree with you. I think a program like easy C is needed, but right now, Easy C could stand a little tweaking. Just my opinion.


Steve




Quote:
Originally Posted by jratcliff View Post
Thanks all for the excellent advice. I have been reading documentation today and I think I have a handle on the flow of control now.

I did run into one weird problem, I wonder if anyone else is having. I tried downloading the latest version of the MPLAB-IDE from the microchip website and every time I download any version I get CRC errors when I try to unzip the file. Has anyone else experienced this?

To answer a few points that were raised in the thread.

(1) I am mentoring a total of six students on our FRC team in programming. I spent four hours giving them a one on one training course on Saturday; these were all Freshmen with little to no programming experience with the exception of my son.

(2) My son is really interested in taking a leadship position on the team. He has been programming for quite some time and is really excited about contributing not just this year, but in years to come. My personal goal is to give him enough experience working with the VEX robot at home that he can be much more involved on the FRC project at school. The robotics club meets frequently but with my work schedule the only time I can make available is on Saturday.

(3) The reason I am focusing on MPLAB and C, rather than Easy C, is because that is easier for me personally at this time. I'm sure the youth will have opportunities to be exposed to the Easy C paradigm at future events throughout the year. However, in the short term, it is much easier for me to just program in native C code since that is a high iteration cycle path. Yesterday I felt a bit lost in all of the acronyms but a morning of reading yet more documentation is going a long way towards getting me up to speed.

Thanks all for the help getting started, it is my hope that I will be of assistance to the general FRC community in years to come and I certainly want to help mentor students in the St. Louis area after this season has completed.

Thanks,

John & Alex
  #10   Spotlight this post!  
Unread 14-01-2008, 10:25
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,622
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Help,....

Quote:
Originally Posted by Steve_Alaniz View Post
You should have gotten a Disc in the FIRST kit of parts and I'd advise finding that instead of downloading from the Microchip site. ALSO, in previous years, we were warned to only use MPLAB ver 7.20 and C18 Compiler ver 2.40. Not sure if that still applies.
Anyone else know?
Anyway, I'd really recommend using the kit of parts disc since it will have the correct version and you shouldn't have the CRC problem using that.
Yes we're still restricted to using MPLAB 7.20 and C18 2.4, unless you're using Kevin Watson's Beta C18 3.0+ code, which I'm not sure I'd recommend to a first time FRC programmer, as it might still have bugs and the C18 3.10 compiler is high conservative about interrupt handlers and could easily bog down your code if you're not careful. So yes, I would strongly recommend just installing the version of MPLAB off the CD in the kit. You'll need those specific versions anyways if you want to work with Vex, as Kevin W. hasn't updated the Vex starter code to be 3.10 compatible yet.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #11   Spotlight this post!  
Unread 14-01-2008, 19:34
jratcliff jratcliff is offline
Registered User
no team
 
Join Date: Jan 2008
Location: Lake Saint Louis, Missouri, USA
Posts: 10
jratcliff will become famous soon enoughjratcliff will become famous soon enough
Re: Help,....

Quote:
Originally Posted by Kevin Sevcik View Post
Yes we're still restricted to using MPLAB 7.20 and C18 2.4, unless you're using Kevin Watson's Beta C18 3.0+ code, which I'm not sure I'd recommend to a first time FRC programmer, as it might still have bugs and the C18 3.10 compiler is high conservative about interrupt handlers and could easily bog down your code if you're not careful. So yes, I would strongly recommend just installing the version of MPLAB off the CD in the kit. You'll need those specific versions anyways if you want to work with Vex, as Kevin W. hasn't updated the Vex starter code to be 3.10 compatible yet.
The CRC thing must have been a problem with my computer at home. I really would like to use Kevin's latest code framework, primarily because it is so well documented and has some improved functionality for sending PWC (?) commands. His code doesn't compile on the MPLAB that came with the robot kit that I have though.

If I don't use the version the beta version he has posted, what version am I supposed to be using? Can someone give me a link?

Right now I am up to speed programming the VEX using the sample code that comes with it. Is there completely different sample code to be used as a starting framework for the FRC controller? How can I experiment between the two systems interchangeably?

We don't have anything at school up and running to let me test code on the FRC so for the moment I am limited to the VEX system.

Thanks,

John
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
AHHH! I'm a lost newbie! I need help! lkdjm Programming 8 28-01-2006 08:41
i'm in the charleston area, and i'm looking to help out a team near here... dickymon General Forum 2 05-08-2002 16:40
OK...so I'm totally out of the loop... Markfuscius 3D Animation and Competition 8 03-02-2002 02:39


All times are GMT -5. The time now is 02:12.

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