|
|
|
#1
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin |
|
#2
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Kevin,
I re-installed 3.10 and it worked just fine! Thanks for all your work! Jon |
|
#3
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
In testing the code on my test system, this change to the ADC.c code made about 1% saving it time...
|
|
#4
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
I really appreciate what you are doing, and i don't mean to ask for more, but would it be possible for you to create diff/patch files when you release a new version, to make updating our code easier? |
|
#5
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
|
#6
|
||||||
|
||||||
|
Re: New C18 3.0+ Compatible FRC Code
There have been at least two makefiles posted in this thread.
|
|
#7
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
I am trying to figure out the encoder code, and do not understand how the code knows what way the shaft is turning,
void Int_1_ISR(void) { if(ENCODER_1_PHASE_B_PIN == 0) { Encoder_1_Count -= ENCODER_1_TICK_DELTA; } else { Encoder_1_Count += ENCODER_1_TICK_DELTA; } } What really is ENCODER_1_PHASE_B_PIN? And what port is this interrupt running one Input 1 or 2? Last edited by comphappy : 11-01-2008 at 01:14. |
|
#8
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
When using a "Quadrature" encoder, there are two signals generated, Phase A and Phase B. Both are square waves with "B" 180 degrees out of phase from "A". When triggered by "A" going high, the ISR looks at "B", if it is low, you are going forward, if "B" is high you are going backward. In the code it explains how to attach the A and B phases. Now, if you are not using a quadrature encoder but one with a single output, like the GTS in the kit, then determining direction is a much bigger challenge although, not impossible. |
|
#9
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
-Kevin Last edited by Kevin Watson : 11-01-2008 at 16:41. |
|
#10
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Thank you for the diagram it was really useful. (BTW I like your code, it is clean and well organized) |
|
#11
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
I have used this method in the past on my Vex bot. It works fairly well but is not perfect. For use in straight line driving, as in Hybrid mode, it should be sufficient. BTW, make sure you account for the dead-band associated with the Victor.
|
|
#12
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Yes, I am aware of that, but in this case the PWM is being driven with out any user input, should be ether 0 or 255, nothing in the middle.
|
|
#13
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Code:
if (pwm03 > 127)
{
accumulator ++;
}
else
{
accumulator --;
}
Just as easily, you could test for the actual value. Code:
if (pwm03 == 255)
{
accumulator ++;
}
else
{
accumulator --;
}
|
|
#14
|
|||
|
|||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
|
#15
|
||||
|
||||
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
I can, with 90% certainty, say that this year we will be using both of the GTS's and one quadrature encoder on our bot. Two for the drive, one for the "ball handler". Now, if the budget allows, we may go with three quadratures. (I hope, I hope, I hope ) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |