PF EEPROM

From DIDEAS Wiki
Jump to: navigation, search

PF Users Navigation:

Edit

EEPROM init registry (SC SVN revision > 1611)

  • During boot, the robot loads critical variables from its "init table registry"
  • keys are define in : '../StateControl/eeprom_keys.h';
  • the python program "keys.py" uses this file to permit keys to be referenced by name
  • at present 16 and 32 bit unsigned int keys are support
  • NOTE : python ignores the redundant part of a key name "KEY_"

keys.py

print ' -p COM port / or IP address port'
print ' -b baudrate'
print ' -i <name or IP address> : IP address of the SWIFI'
print ' -r read keys by name that follow (multiple keys allowed)'
print ' -w write key values by name, value that follow (multiple key values are allowed) (NOTE:after -w, only -r and -w options are processed)'
print ' -f process script file'
print ' -D generation keys.h wiki documentation file'
print ' -l log file name '
print ' -V verify : after writing ALL values, will go back and verify them. (def=TRUE)'
print
print 'example: keys.py -p 26 -V -r serial_number run_level -w run_level 22 -r run_level'
print

Documentation file

  • filename = ../StateControl/eeprom_keys.h
  • created @ 2009-11-04 19:18:25

EEPROM_KEYS_16_BIT

  • RUN_LEVEL  : a simpler way to specifying the progress of bringing and demoing a robot
  • FEATURE_BITS  : bits the enabled the use of specific features (currently conflicts w/run level)
  • REVISION_NUMBER  : Hardward revision number of installed SC/MC board.
  • ENHANCED_FEATURE_BITS : TBD, use FF, use overload, use MILE, etc.
  • SERIAL_NUMBER_SCMC  : serial number of the installed SC/MC board : eg 9
  • SERIAL_NUMBER_FET  : 0 or -1 means unknown
  • SERIAL_NUMBER_IMU  :
  • OVERLOAD_MOT_MAXSUM  : for the overload monitor maximum summuation of leaky integrator
  • OVERLOAD_BAT_MAXSUM  : maxsum should be considered "level 3"
  • OVERLOAD_MOT_DECAY  : the decay constant of the leaky integrator.
  • OVERLOAD_BAT_DECAY  :
  • OVERLOAD_Q15_LEVEL1  : (0.8) a Q15 fraction that specifies level 1 of the overload maxsum
  • OVERLOAD_Q15_LEVEL2  : (0.9) a Q15 fraction .... Note L1<L2<L3
  • ABS_ENC_OFFSET  : when commutated, what is the encoder offset, -1 for MR enc, -2 for unknown
  • FIXED_MOT_U_OFFSET  :
  • FIXED_MOT_V_OFFSET  :
  • FIXED_HIGHSIDE_OFFSET :
  • FIXED_HIGHSIDE_OFFSET : enables the use of force field that protects from a K3 break
  • FIXED_HIGHSIDE_OFFSET : enables the use of force field that keeps ball nut from coliding with thrust bearing
  • FIXED_HIGHSIDE_OFFSET : enables the use of the motor and highside overload monitor
  • FIXED_HIGHSIDE_OFFSET : forces the use of the MILE encoder (backwards, encoder count of 2048), other wise the MR encoder is used (forwards, 2000 counts)
  • FIXED_HIGHSIDE_OFFSET : enables the test that verifies encoder offset (and checks for MILE encoder)
  • FIXED_HIGHSIDE_OFFSET : this is a necessary step to set the encoder offset for motor commutation. If MODE2 is not entered, then only motor modes 0 and 2 are available. MODE2 can be entered with various special commands.
  • FIXED_HIGHSIDE_OFFSET : for the motor current sensors - will make use of a table that specifies that sensor offset as a function of motor angle
  • FIXED_HIGHSIDE_OFFSET : for the robot angle sensor (see above)
  • FIXED_HIGHSIDE_OFFSET : for the high side current sensor (see above)

EEPROM_KEYS_32_BIT

  • SC_FUP_BAUDRATE  : at present unused, but will be used to set the baudrate of the SC FUP port
  • MC_FUP_BAUDRATE  : at present unused, but will be used to set the baudrate of the SC FUP port
  • FF_K3_HARDLIMIT  : see command 1441 and 1443
  • FF_K3_ACTIVATION  :
  • FF_K3_RESTORE_TORQUE :
  • FF_TB_HARDLIMIT  :
  • FF_TB_ACTIVATION  :
  • FF_TB_RESTORE_TORQUE :


DETAILS FOR 16 bit keys

RUN_LEVEL

As the robot is tested and brought to full operational, the RUN LEVEL in increment to enable features and the use of tables. A run level of 0, -1, or non-existent RUN_LEVEL key (blank EEPROM) forces the use of NO features.

KEY_REVISION_NUMBER

FEATURE_BITS

KEY_SERIAL_NUMBER

There are 3 keys in this set. These specifiy the serial numbers of the SC/MC, FET board, and IMU. Of course - on must be diligent to built the robot to be consistent with the serial numbers - as these KEYs do not reside on the other PCBs. Eg (the FET board has no EEPROM.)


ENHANCED_FEATURE_BITS

  • USE_FF_K3 - enables the use of force field that protects from a K3 break
  • USE_FF_TB - enables the use of force field that keeps ball nut from coliding with thrust bearing
  • USE_OVERLOAD - enabled the use of the overload monitor
  • USE_MILE - forces the use of the MILE encoder (backwards, encoder count of 2048), other wise the MR encoder is used (forwards, 2000 counts)
  • DO_ENC_OFFSET_VERIFY - enables the test that verifies encoder offset (and checks for MILE encoder)
  • DO_MODE2_CHECK - this is a necessary step to set the encoder offset for motor commutation. If MODE2 is not entered, then only motor modes 0 and 2 are available. MODE2 can be entered with various special commands.
  • USE_CURRENT_OFFSET_TABLE - for the motor current sensors - will make use of a table that specifies that sensor offset as a function of motor angle
  • USE_HALL_ANGLE_OFFSET_TABLE - for the robot angle sensor (see above)
  • USE_HIGHSIDE_OFFSET_TABLE - for the high side current sensor (see above)

ABS_ENC_OFFSET

For instant on (or for verification) this is the expected value of the absolute (motor) encoder when motor incremental is zeroed in MODE2.

OVERLOAD PARAMETERS

DETAILS FOR 32 bit keys

FUP_BAUD

  • Two keys, SC_FUP_BUAD, and MC_FUP_BAUD.
  • Allows the baud rate of the FUP ports to be specified
  • Note - the actual baud rate my differ from the one specified as only certain baud rates are available based on the clock frequency of the CPU.
  • In general, assume that a baud rate must on of : 40,000,000 / 16 / n where n is an integer.
  • Baud rate errors of +- a few percent are usually acceptable.


FORCE FIELD PARAMETERS

  • Two key sets - FF_K3 and FF_TB
    • FF_K3 uses the hall angle sensor to limit motion when compressing K3 (or if K3 breaks.)
    • FF_TB uses the motor encoder to limit motion of the ball-nut that would result in contact with the thrust bearing



(tags SPLD3) EEPROM init table

  • The defaults 'feature bits' set in statemachine.h are basically ignored (6-28-09). Although loaded in sm_init.c, they're overwritten in demux_sm - where it reads the the EEPROM init table.
  • if FEATURE_MC_CURRENT_UPDATES is NOT SET, then demux_sm skips the states that boot MC through mode 2
  • if FEATURE_USE_IMU is set, then after MC is boot (immediately before RUN_TIME), the dataport_select is set to two, and the IMU communications is enabled.

(PRE SPLD 3) Problems / Goals

  • need to be able to cleanly specify to boot too.
    • great a global called 'run_level'. Each thing that gets turned on has a minimum level.
  • what if a 'needed' table isn't loaded - eg calibration table.
    • possibly this type of error should limit the maximum level of boot capability. eg no calb table, then at most we remain in a mode that will allow for calibration

example script file

# parse rules:
# '#' start a comment 
# to write a key :   <key> = <value>   
# to read a key : <key>
# to verify a key : <key> == <value>
#
#

RUN_LEVEL        = 0
FEATURE_BITS     = 5
REVISION_NUMBER  = 300    # HARDWARE REVISION NUMBER for the PCA

# serial numbers of PCAs in the system.
SERIAL_NUMBER_SCMC  =  10
SERIAL_NUMBER_FET   =  10
SERIAL_NUMBER_IMU   =  10

# value to subtract from the current sensors to correct the 
FIXED_MOT_U_OFFSET     =  14           
FIXED_MOT_V_OFFSET     =  128
FIXED_HIGHSIDE_OFFSET  =  100



#####
# other parameters

OVERLOAD_MOT_MAXSUM  = 21000
OVERLOAD_BAT_MAXSUM  = 21000
OVERLOAD_MOT_DECAY   = 17
OVERLOAD_BAT_DECAY   = 46
OVERLOAD_Q15_LEVEL1  = 26214          # 0.8 * 32768
OVERLOAD_Q15_LEVEL2  = 29491          # 0.9 * 32768

ABS_ENC_OFFSET        = -10


SC_FUP_BAUDRATE      =  115200
MC_FUP_BAUDRATE      =  2500000