Go to Post I wouldn't mind having this day repeat itself a few times. It would give us more time to work on our robot. - Mr.D [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 07-02-2004, 15:56
Ferazel2001 Ferazel2001 is offline
Mac Junkie
AKA: Devon
None #0599 (Robodox)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: California, North Hills
Posts: 20
Ferazel2001 is on a distinguished road
Send a message via AIM to Ferazel2001 Send a message via MSN to Ferazel2001 Send a message via Yahoo to Ferazel2001
Programming code Fix FRC

In the Autonomous code, there is a line missing in Our version of the FRC code:
Generate_Pwms(pwm1...pwm16);
what ever PWM's you use in Autonomous, include them here or it wont work!

-Devon
  #2   Spotlight this post!  
Unread 07-02-2004, 17:01
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Re: Programming code Fix FRC

From "user_routines.c"
Code:
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
I don't think Generate_Pwms(...) can do all 16.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #3   Spotlight this post!  
Unread 07-02-2004, 19:15
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Programming code Fix FRC

Generate_PWMs() only works on PWMs 13-16. The other 12 are controlled by the master processor.
__________________

  #4   Spotlight this post!  
Unread 07-02-2004, 21:34
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: Programming code Fix FRC

PWMs 13-16 are the 4 "fast refresh" PWM ports (2ms as opposed to 17ms for normal PWM) that are controlled by the User processor. Generate_Pwms() is the function the processor uses to refresh PWM values. Putdata() function calls Generate_Pwms() for PWMs 1-12 which the Master processor refreshes every 26.2ms (when the User and Master exchange data).

The programmer can call Generate_Pwms() for 13-16 anytime (well every 2ms). This allows the programmer to control more important motors (like the drive train) more precisely which is particularly useful during autonomous mode. FIRST did not include Generate_Pwms() before the Putdata() in the autonomous default code probably because they did not want to restrict everyone to the slow 26.2 ms part of that loop. Generate_Pwms() can be placed outside of the if statement looking for new data as shown below:

Code:
void User_Autonomous_Code(void)
{
  while (autonomous_mode)   /* DO NOT CHANGE! */
  {
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {
        Getdata(&rxdata);   /* DO NOT DELETE, or you will be stuck here forever! */

        /* Add your own autonomous code here. */

        Putdata(&txdata);   /* DO NOT DELETE, or you will get no PWM outputs! */
    }
    // insert realy fast auto code for PWMs 13-16 driven 
    // by wheel encoders, gyros, line trackers, IR Sensors, etc...
    // here     
    Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
  }

}
The fast code will execute every cycle much like Process_Data_From_Local_IO(). If you need to use analog inputs during this code you must use the function Get_Analog_Value() to activate the ADC(Analog Digital Converter) for every analog value you need.
(Note: I have not got a chance to test this on a bot and I am explaining this as best as I can for anyone who doesn't already know. I am still learning new stuff about this new processor and I could be wrong about something)

The fast PWMs are one of the many things that make this new processor is much more powerful than the last one, which was needed for autonomous. Because of this new powerful processor, I expect the 2004 StangSense (Wildstang's incredible auto program) to be accurate to a quarter inch in any direction.
__________________
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"

Last edited by The Lucas : 07-02-2004 at 21:37.
  #5   Spotlight this post!  
Unread 07-02-2004, 21:55
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Programming code Fix FRC

also a note to any programmers that haven't seen it yet - many people have reported problems with Generate_Pwms - this is due to a missing line in some of the default code - in whatever file you are using Generate_Pwms in, make sure you #define _FRC_BOARD (this does not apply for the edubot).
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #6   Spotlight this post!  
Unread 07-02-2004, 23:31
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: Programming code Fix FRC

Quote:
Originally Posted by The Lucas
... I expect the 2004 StangSense (Wildstang's incredible auto program) to be accurate to a quarter inch in any direction.
Well they used an external processor last year ... so they really weren't limited by the BASIC Stamp's (lack of) capabilities.
  #7   Spotlight this post!  
Unread 08-02-2004, 02:46
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: Programming code Fix FRC

I was confused. StangSense was from 2002 when they used Motorola current sensors to read out motor status on a PDA. Actually, Wildstang's 2003 autonomous program was called StangPS (Positioning System). They had a 2 inch resolution on their wheel encoder with that external Motorola processor. Interrupts should increase their resolution greatly (can handle many more pulses per revolution) and the fast PWMs should increase their efficiency in getting there. The question is: What will they spend their $200 budget on this year? Will they be the first to use the TTL port in competition?
__________________
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"
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
FRC Program State Frozen at Power-up WillyC Control System 4 14-02-2004 18:05
problems assigning unsigned chars in FRC Code LoyolaCubs Programming 6 26-01-2004 23:21
FRC Code (Motors, etc...) Raven_Writer Programming 3 26-01-2004 07:21
FRC default code hedgehogger Programming 2 21-01-2004 18:41
Problem with FRC Default code AsimC Programming 2 11-01-2004 19:22


All times are GMT -5. The time now is 14:26.

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