Go to Post i openly welcome our large game piece overlords - Chexposito [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #391   Spotlight this post!  
Unread 18-02-2008, 16:43
CardcaptorRLH85's Avatar
CardcaptorRLH85 CardcaptorRLH85 is offline
The master of the cards ^_^
AKA: Raa'Shaun H.
FRC #0322 (F.I.R.E. "Flint Inspires Real Engineers")
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Michigan, USA
Posts: 59
CardcaptorRLH85 is an unknown quantity at this point
Send a message via ICQ to CardcaptorRLH85 Send a message via AIM to CardcaptorRLH85 Send a message via MSN to CardcaptorRLH85 Send a message via Yahoo to CardcaptorRLH85
Re: New C18 3.0+ Compatible FRC Code

I'm in a bit of a bind...I'm having a bit of a problem integrating the PID code available at http://www.kevin.org/frc/2005/ with this new code. I've been looking through the PID code and I have absolutely no idea where to start trying to make them work with one another. I'd greatly appreciate any help I can get here....
__________________

  #392   Spotlight this post!  
Unread 18-02-2008, 21:30
spack spack is offline
Registered User
#1391
 
Join Date: Feb 2005
Location: Westtown PA
Posts: 6
spack is an unknown quantity at this point
Re: New C18 3.0+ Compatible FRC Code

Kevin.
I'm trying to get the camera code going with the new 3.0 code. I'm not receiving ACKs or NCKs so it fails at init state 3 return value 131. serial_ports.h/c looks ready to go for port2 9600 baud and interrupts.

Integrated camera.c terminal.c and tracking.c without any issues.

Anything obvious come to mind reagrding serial port initialization?

Chad
  #393   Spotlight this post!  
Unread 19-02-2008, 07:59
David Doerr's Avatar
David Doerr David Doerr is offline
Registered User
FRC #4478 (Materia Oscura)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Milford, Michigan, USA
Posts: 75
David Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud ofDavid Doerr has much to be proud of
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by spack View Post
Kevin.
I'm trying to get the camera code going with the new 3.0 code... Anything obvious come to mind reagrding serial port initialization?
Chad,

Try setting serial port 2 to 115200 baud.

Dave
  #394   Spotlight this post!  
Unread 19-02-2008, 20:04
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: New C18 3.0+ Compatible FRC Code

I've been running into an odd problem with encoders.

Encoder 1 works perfectly fine during the teleop period, but does not give me anything during the autonomous one. Encoder 2 works in both teleop and autonomous. The initialization functions is called during both the autonomous and disabled initialization routines.

I am running your latest code build, as far I as know, with MPLAB 8 and C18 3.10. While the robot is shipped already, I'd love to hear if you have any suggestions for what to try.

It could be that the encoder is working, and is giving the correct signals, but is always printing a zero in my debug statement, and the code that is executing makes me believe that it is seeing a zero (as the count). But when I print out the count in the teleop mode, I get numbers that make sense.
__________________
  #395   Spotlight this post!  
Unread 20-02-2008, 00:20
Lafleur Lafleur is offline
Registered User
AKA: Tom Lafleur
FRC #0812
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: San Diego
Posts: 34
Lafleur will become famous soon enoughLafleur will become famous soon enough
New C18 3.0+ Compatible FRC Code

Kevin

Do you have access to an Explorer 16 board from Microchip??
  #396   Spotlight this post!  
Unread 20-02-2008, 00:32
pogenwurst pogenwurst is offline
Ubuntu User
AKA: Brian
FRC #2007 (Robots of the Round Table)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Duluth, GA
Posts: 78
pogenwurst is on a distinguished road
Send a message via AIM to pogenwurst
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by sumadin View Post
I've been running into an odd problem with encoders.

Encoder 1 works perfectly fine during the teleop period, but does not give me anything during the autonomous one. Encoder 2 works in both teleop and autonomous. The initialization functions is called during both the autonomous and disabled initialization routines.

I am running your latest code build, as far I as know, with MPLAB 8 and C18 3.10. While the robot is shipped already, I'd love to hear if you have any suggestions for what to try.

It could be that the encoder is working, and is giving the correct signals, but is always printing a zero in my debug statement, and the code that is executing makes me believe that it is seeing a zero (as the count). But when I print out the count in the teleop mode, I get numbers that make sense.
I had the same issue in autonomous, except with both encoder 1 and encoder 2. I never had the chance to check in teleop mode, though.

I'll try with last year's board, if I can get the time (we removed our encoders from the bot for this reason).
  #397   Spotlight this post!  
Unread 20-02-2008, 01:29
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by spack View Post
Kevin.
I'm trying to get the camera code going with the new 3.0 code. I'm not receiving ACKs or NCKs so it fails at init state 3 return value 131. serial_ports.h/c looks ready to go for port2 9600 baud and interrupts.

Integrated camera.c terminal.c and tracking.c without any issues.

Anything obvious come to mind reagrding serial port initialization?

Chad
I haven't done it, but I can't think of any reason it wouldn't work.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #398   Spotlight this post!  
Unread 20-02-2008, 01:38
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by sumadin View Post
I've been running into an odd problem with encoders.

Encoder 1 works perfectly fine during the teleop period, but does not give me anything during the autonomous one. Encoder 2 works in both teleop and autonomous. The initialization functions is called during both the autonomous and disabled initialization routines.

I am running your latest code build, as far I as know, with MPLAB 8 and C18 3.10. While the robot is shipped already, I'd love to hear if you have any suggestions for what to try.

It could be that the encoder is working, and is giving the correct signals, but is always printing a zero in my debug statement, and the code that is executing makes me believe that it is seeing a zero (as the count). But when I print out the count in the teleop mode, I get numbers that make sense.
A common reason for this is the wrong printf() format parameter is used. Use %ld instead of %d.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #399   Spotlight this post!  
Unread 20-02-2008, 01:42
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Lafleur View Post
Kevin

Do you have access to an Explorer 16 board from Microchip??
No, most of my experience is with x86, PPC, Cell BE, TI DSP plus lots of FPGA work. My only real experience with PIC is side work using IFI hardware. Why do you ask?

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #400   Spotlight this post!  
Unread 20-02-2008, 01:49
Guy Davidson Guy Davidson is offline
Registered User
AKA: formerly sumadin
FRC #0008 (Paly Robotics)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Ra'anana, Israel
Posts: 660
Guy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to beholdGuy Davidson is a splendid one to behold
Send a message via ICQ to Guy Davidson Send a message via AIM to Guy Davidson Send a message via MSN to Guy Davidson
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Kevin Watson View Post
A common reason for this is the wrong printf() format parameter is used. Use %ld instead of %d.

-Kevin
That would make sense, I guess. The DEBUG I use in the teleoperated code casts the variables to integers in the DEBUG, while the one I have in autonomous does not. But something's still lacking. In this case, why would encoder channel 2 print out properly, while one was not? I also tried connection the two encoders to the opposite channels (i.e. the left one was previously connected to 1, and I moved it to 2, and vice versa with the right encoder). When I did that, the signs flipped, but encoder 2 still changed and 1 still remained constant, while both worked in teleop, I believe.

Another weird thing with my autonomous code, is that unless I have a DEBUG in the PWM() function body, the robot doesn't move. I'm updating the PWM function every main loop, and I noticed that unless I have that DEBUG statement there, the robot doesn't move. Once I added it, or commented it in (when testing), the robot started moving again. Any ideas?

Thanks.
__________________
  #401   Spotlight this post!  
Unread 20-02-2008, 02:14
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by sumadin View Post
That would make sense, I guess. The DEBUG I use in the teleoperated code casts the variables to integers in the DEBUG, while the one I have in autonomous does not. But something's still lacking. In this case, why would encoder channel 2 print out properly, while one was not? I also tried connection the two encoders to the opposite channels (i.e. the left one was previously connected to 1, and I moved it to 2, and vice versa with the right encoder). When I did that, the signs flipped, but encoder 2 still changed and 1 still remained constant, while both worked in teleop, I believe.

Another weird thing with my autonomous code, is that unless I have a DEBUG in the PWM() function body, the robot doesn't move. I'm updating the PWM function every main loop, and I noticed that unless I have that DEBUG statement there, the robot doesn't move. Once I added it, or commented it in (when testing), the robot started moving again. Any ideas?

Thanks.
Using the wrong format string can cause wacky behavior. I'll have a quick look if you zip up your code and e-mail it to me.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #402   Spotlight this post!  
Unread 20-02-2008, 10:36
Lafleur Lafleur is offline
Registered User
AKA: Tom Lafleur
FRC #0812
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2006
Location: San Diego
Posts: 34
Lafleur will become famous soon enoughLafleur will become famous soon enough
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by Kevin Watson View Post
No, most of my experience is with x86, PPC, Cell BE, TI DSP plus lots of FPGA work. My only real experience with PIC is side work using IFI hardware. Why do you ask?

-Kevin
I have a early port of your ATD code working on the board with DMA, also have the serial drivers working with a few bugs...

this was done to gain experience with the tools and processors...
  #403   Spotlight this post!  
Unread 21-02-2008, 18:13
mandrews281 mandrews281 is offline
Registered User
FRC #0281
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Greenville SC
Posts: 82
mandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to behold
Re: New C18 3.0+ Compatible FRC Code

There is a later theme about not allowing enough time for the circular buffer to fill. I suspect that might be what I was doing wrong.
  #404   Spotlight this post!  
Unread 03-03-2008, 16:53
BHOP BHOP is offline
Registered User
FRC #0399 (Eagle Robotics)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2003
Location: CA
Posts: 62
BHOP has much to be proud ofBHOP has much to be proud ofBHOP has much to be proud ofBHOP has much to be proud ofBHOP has much to be proud ofBHOP has much to be proud ofBHOP has much to be proud ofBHOP has much to be proud of
Re: New C18 3.0+ Compatible FRC Code

Just wanted to post a big THANK YOU to Kevin for his code...
__________________
BHOP

ME CoE University of Michigan
503 Frog Force 830 Rat Pack
399 Eagle Robotics
  #405   Spotlight this post!  
Unread 03-03-2008, 17:06
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: New C18 3.0+ Compatible FRC Code

Quote:
Originally Posted by BHOP View Post
Just wanted to post a big THANK YOU to Kevin for his code...
You're welcome . Of the teams that used my code last week, did any bugs pop up?

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
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
Does the camera code suits to all versions of MPLAB and C18? razer Programming 3 04-01-2007 14:50
Trying to follow C18 interrupt context code... dcbrown Programming 5 21-12-2006 09:01
Error w/ FRC code JamesBrown Programming 2 08-01-2005 16:17
Programming code Fix FRC Ferazel2001 Programming 6 08-02-2004 02:46
FRC default code hedgehogger Programming 2 21-01-2004 18:41


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

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