Difference between revisions of "PFMENU DOCS MC"

From DIDEAS Wiki
Jump to: navigation, search
m
m (encoder)
Line 71: Line 71:
 
*1052 : get direction  
 
*1052 : get direction  
 
*1053 : set direction (in_param == +1 or -1)
 
*1053 : set direction (in_param == +1 or -1)
 
+
*1055 : config for MR (0) or MILE encoder (1)
 
 
  
 
==dataport==
 
==dataport==

Revision as of 23:53, 30 August 2009

PF Users Navigation:

Edit

motor controller

  • 1100 : set mode
  • 1101 : get mode
  • 1102 : set torque
  • 1103 : get torque
  • 1104 : set speed
  • 1105 : get speed (and other info)
  • 1106 : get encoder
  • 1107 : set encoder zero
  • 1108 : set current offsets
  • 1109 : set motor mode
  • 1110 : set motor torque
  • 1111 : getdata
  • 1112 : REMOVED
  • 1113 : enable / disable mode zero current offset calibration (
  • 1114 : set ctrl param vQ and vD
  • 1115 : set ctrl param vQ and vD, and then set motor mode
    • cmd 1115 is the primary to set motor torque and mode.
    • parameters are 1115 <qPq> <qPd> <Mode>
    • Modes are :
      • 0 for shorted motor leads (safety mode)
      • 2 for zero encoder
      • 3 for close current loop torque mode
      • 4 for open loop voltage mode w/constant flux angle (adjust w/ set_position)
      • 6 for open loop voltage mode w/flux angle set by encoder (normal mode)
      • 7 to read and set motor controller current offsets


    • qPq and qPd are q15 format control reference parameters in the Q and D direction.
      • in modes (2?) and 3 - the Q and D parameters represent current with 1amp = ~1093
      • in mode 4 and 6 - the Q and D parameters represent voltage such that voltage on the motor is : Vq = qPq / 32768 * POWER SUPPLY VOLAGE
      • eg: a parameter of 800 with a supply of 21.6 volts -> vmot = .8/32.7 * 21.6 = 0.5 volts


  • 1116 : read current offsets
    • typically auto set by commanding mode 7.
  • 1117 : set motor filter (both Q and D)
  • 1118 : read ADCs (in_param==16 -> read all 16 channels), else thats the channel offset and read 10 channels

overload current monitor

  • 1120 - reads overload config and status
  • 1121 <param> - like command 1120, but pass param==1 to reset sums and trips
  • 1122 <4x params> - use to set the overload config parameters
  • The computation at 1KHZ, sums the ABS of the the scaled (1/256) current and subtracts the decay value
  • the time in mS for the to trip :

t = (1mS) * MAX_SUM / (AMPS - DECAY)

  • some defaults 11500 / ((I_PHASE - 3.0) * 1092 * 1/256

desired fuse values.

  • 30 amps, 80mS
  • 25 amps, 100mS
  • 20 amps, 132mS
  • 15 amps, 195mS
  • 10 amps, 373mS


encoder

  • 1050 : get 2x / 4x mode
  • 1051 : set 2x / 4x mode (in_param == 2 or 4)
  • 1052 : get direction
  • 1053 : set direction (in_param == +1 or -1)
  • 1055 : config for MR (0) or MILE encoder (1)

dataport

  • 1257 - dataport_set_select(val)
    • 0 : received values from SC
    • 1 : electronic fuse sums
    • 2 : all 5 SM values

IMPED

  • 1330 - get imp
  • 1331 - set imp
  • 1333 - set mc_sm to allow imped updates
  • 1340 - impdebug -> called imp_debug_params
  param[0] = imp.pos;
  param[1] = imp.rel_pos;
  param[2] = imp.speed;

  param[4] = imp.kp*1e6;
  param[5] = imp.kb*1e6;
  param[6] = imp.kp_enc*1e6;
  param[7] = imp.kb_rpm*1e6;

MC SM

  • 1411 - mc_sm debug
    • 0 mc_sm_debug
    • 1 mc_sm_ctrl_debug
    • 2 mc_imp_debug / mc_imp_debug_param+4
  • 1420 - get mode
  • 1421 - set mode (21 for imp mode)
  • 1422 - set ankle error state
  • 1430 - get max pos, max neg current (mA)
  • 1431 - set max pos, max neg current (mA) (disable torque limit)
  • 1432 - get torque limit : max pos, max neg torque
  • 1433 - set torque limit : max positive, max negative torque
  • 1435 - set max and min position
  • 1437 - set tics timeout (for torque offset)
  • 1439 - set max pos, max neg current (mA) (enable torque limit)
  • 1440 - get ff params
  • 1441 - set ff params
  • 1442 - return ff debug params
  • 1443 - enable/disable ff
  • 1460
  • 1461 - set IMP torque offset
  • 1464 (disabled) - switch to mode4, command a qVq and qVd
  • 1466 (disabled) - switch to mode6, command a qVq and qVd
  • 1468 - get resistance pulse and duration
  • 1469 - set resistance pulse amplitude and duration

debug (1411) options

    • 0 mc_sm_debug
  param[0] = sm->state;
  param[1] = sm->last_state;
  param[2] = sm->tics_in_current_state;
  param[3] = sm->tics_since_last_update;
  param[4] = sm->motor_is_active;
    • 1 mc_sm_ctrl_debug
  param[0] = ctrl->torque * 1000;
  param[1] = ctrl->current * 1000;
  param[2] = ctrl->qIq;
  param[3] = ctrl->qId;
  param[4] = ctrl->max_pos_current;
  param[5] = ctrl->max_neg_current;
  param[6] = ctrl->max_motor_enc_pos;
  param[7] = ctrl->max_motor_enc_pos;
  param[8] = ctrl->torque_offset * 1000;
  param[9] = ctrl->enable_imp_current_update;
    • 2 mc_imp_debug / mc_imp_debug_param+4
  param[0] = imp.pos;
  param[1] = imp.rel_pos;
  param[2] = imp.speed;

  param[4] = imp.kp*1e6;
  param[5] = imp.kb*1e6;
  param[6] = imp.kp_enc*1e6;
  param[7] = imp.kb_rpm*1e6;


states

  • cmd 1420, 1421 to access state
typedef enum {
  MCSM_INIT, 
  MCSM_IDLE, 

  MCSM_MODE7,
  MCSM_MODE2,
  MCSM_MODE4A,
  MCSM_MODE4B,
  MCSM_MODE4C,
  MCSM_MODE4D,

  MCSM_MODE4_FIN,
  MCSM_BOOT_COMPLETE=20, 

  MCSM_IMP_MODE=30,
  MCSM_RESISTANCE_MODE,
  MCSM_ACTIVE, 
  MCSM_OVERLOAD, 
  MCSM_UPDATE_TIMEOUT,
  MCSM_ANKLE_READY,

  MCSM_RELAXED_MODE, // 36

  MCSM_ANKLE_ERROR=40,
  MCSM_ERROR=44,
  MCSM_POS_ERROR_POSITIVE=50,
  MCSM_POS_ERROR_NEGATIVE=52,
  MCSM_ENC_ERROR=60,

} MC_STATE_T;