View Single Post
  #2   Spotlight this post!  
Unread 07-02-2006, 21:12
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: change pwm range preserve input sensitivity

Well lets start with the basics:
127 is nuetral

127-254 is one direction

0-127 is in another direction

so you want the to have a range control between either 0-127 or 127 - 254 (depending on the direction you want to spin)

second analog input form the OI (operator interface gets converted into) to one of the these values defined in 'ifi_aliases.h' not PWMs

2) This controller can do floating point trig calculations so I dought this will be taxing in anyway. If fact this is the type of code is quite basic.

3)All the physical variables you can use are defined in ifi_aliases.h. p1_y and so on are the values form the OI ports(joysticks for example). pwms are the this being outputed at the pins. Look at the default_code in the user_routines.c. You can add tons more software variables like the ones you stated. Read:http://ifirobotics.com/docs/legacy/2...2-apr-2004.pdf

Quote:
*
*-----------------------------------------------------------------------------------------------------
*---------- Aliases for each OI analog input ---------------------------------------------------------
*-----------------------------------------------------------------------------------------------------
* Below are aliases for the analog inputs located on the Operator Interface.
*/
#define p1_y rxdata.oi_analog01
#define p2_y rxdata.oi_analog02
#define p3_y rxdata.oi_analog03
#define p4_y rxdata.oi_analog04
#define p1_x rxdata.oi_analog05
#define p2_x rxdata.oi_analog06
#define p3_x rxdata.oi_analog07
#define p4_x rxdata.oi_analog08
#define p1_wheel rxdata.oi_analog09
#define p2_wheel rxdata.oi_analog10
#define p3_wheel rxdata.oi_analog11
#define p4_wheel rxdata.oi_analog12
#define p1_aux rxdata.oi_analog13
#define p2_aux rxdata.oi_analog14
#define p3_aux rxdata.oi_analog15
#define p4_aux rxdata.oi_analog16
you need to select the one of these, they are based on the input pins on each port. p1,p2... are the ports on the OI

px_y
px_x
px_wheel
are available on the joysticks

Read this completely before you start soddering. http://ifirobotics.com/docs/oi-ref-guide-11-21-05.pdf

Last edited by 6600gt : 07-02-2006 at 21:15.