Ben Englert
05-04-2006, 15:38
Hey guys,
Since it's now "off season" for my team (no Championship for us this year), I've been working on some code just to keep myself busy...
In this code I've brought together a few concepts that I've either come up with or seen implemented elsewhere. The code successfully:
1) Offers an interactive menu system over the serial port for tweaking of PID constants
2) Stores Kp, Ki, and Kd values in the EEPROM, populates the RAM with them at boot time, and updates the RAM every time someone makes a change to the constants through the menu system
3) Scales joystick inputs in terms of percentages - 1072 is considering building a mecanum drive as an off-season project, so this kind of abstraction is key because of the math involved in calculating mecanum wheel vectors and speeds
4) Hardware abstraction - using #defines to state where things are hooked up (in hal.h) because electrical people like to change things at the last minute, and it makes everything more readable.
Anyway, please have a look at it here (http://galactica.miazmatic.com/~ben/robotics/code-devel/) and leave any commentary or suggetsions you might have.
Edit: In an effort to uphold both IFI's and Kevin Watson's wishes as far as what may be done with their code, I have only uploaded things that I wrote from scratch. Kevin's frc_encoders, frc_serial_ports, and frc_eeprom code are used, and the three handler routines (UI_Handler, Storage_Handler, Control_System_Handler) are called from IFI's process_data_from_master_uP.
Since it's now "off season" for my team (no Championship for us this year), I've been working on some code just to keep myself busy...
In this code I've brought together a few concepts that I've either come up with or seen implemented elsewhere. The code successfully:
1) Offers an interactive menu system over the serial port for tweaking of PID constants
2) Stores Kp, Ki, and Kd values in the EEPROM, populates the RAM with them at boot time, and updates the RAM every time someone makes a change to the constants through the menu system
3) Scales joystick inputs in terms of percentages - 1072 is considering building a mecanum drive as an off-season project, so this kind of abstraction is key because of the math involved in calculating mecanum wheel vectors and speeds
4) Hardware abstraction - using #defines to state where things are hooked up (in hal.h) because electrical people like to change things at the last minute, and it makes everything more readable.
Anyway, please have a look at it here (http://galactica.miazmatic.com/~ben/robotics/code-devel/) and leave any commentary or suggetsions you might have.
Edit: In an effort to uphold both IFI's and Kevin Watson's wishes as far as what may be done with their code, I have only uploaded things that I wrote from scratch. Kevin's frc_encoders, frc_serial_ports, and frc_eeprom code are used, and the three handler routines (UI_Handler, Storage_Handler, Control_System_Handler) are called from IFI's process_data_from_master_uP.