View Single Post
  #8   Spotlight this post!  
Unread 12-03-2008, 16:28
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
FRC #4901 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Columbia, SC
Posts: 1,126
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: HM55B Digital Compass - How do I program the controller to read it?

Quote:
Originally Posted by Tom Line View Post
If you continue to have issues, consider doing this:

encoder_error = left_encoder_count - right_encoder_count;
encoder_output = encoder_error * encoder_gain;
if (encoder_output > 127)
encoder_output = 127;
else if (encoder_output < -127)
encoder_output = -127;

Left_Drive = 127 + <insert_your_left_drive_value> - encoder_output;
Right_Drive = 127 + <insert_your_right_drive_value> + encoder_output;

Adjust your gain until it drives roughly straight. It won't be perfect, but it might work well enough for you.
We already have code that does this, and it will increase the change if it does not see a fix, but our gear tooth sensors aren't as sensitive as I would wish, and they skip values when going fast. By the way, I'm using MPLAB.
__________________
Garnet Squadron
FRC 4901
Controls Mentor
@rnazaretian

Previous mentor and student from Team Fusion, FRC 364