![]() |
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 |
Re: Programming code Fix FRC
From "user_routines.c"
Code:
Generate_Pwms(pwm13,pwm14,pwm15,pwm16); |
Re: Programming code Fix FRC
Generate_PWMs() only works on PWMs 13-16. The other 12 are controlled by the master processor.
|
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)(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. :D |
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).
|
Re: Programming code Fix FRC
Quote:
|
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?
|
| All times are GMT -5. The time now is 22:33. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi