PFMENU DOCS MC
From DIDEAS Wiki
motor controller
- 1105 : get speed (and other info)
- 1108 : set current offsets
- 1109 : set motor mode
- 1110 : set motor torque
- 1111 : getdata
- 1112 : set qei X resolution (2x or 4x)
- 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
- qPq and qPd are q15 format control reference parameters in the Q and D direction.
- 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 parameters
data->param[0] = OverloadMonitor.max_phase_filter_sum >> 10; data->param[1] = OverloadMonitor.max_bat_filter_sum >> 10; data->param[2] = OverloadMonitor.phase_filter_decay; data->param[3] = OverloadMonitor.bat_filter_decay;
defaults are 22400 22400 4915 4915
or :
for the sum : 0.07 * 32768 * 10e3 / 1024
for the decay : 0.15 * 32768
- 1121 <param> - to see the present intermediate values and overload flag. if param is one, will reset overload flag.
data->param[0] = OverloadMonitor.sum_1 >> 10; data->param[1] = OverloadMonitor.sum_2 >> 10; data->param[2] = OverloadMonitor.sum_bat >> 10; data->param[3] = OverloadMonitor.i_phase_1; data->param[4] = OverloadMonitor.i_phase_2; data->param[5] = OverloadMonitor.i_bat; data->param[6] = OverloadMonitor.trip; data->param[7] = OverloadMonitor.enable; data->param[8] = tkmot_get_error(); data->param[9] = tkmot_get_overload();
- 1122 <4x params> - use to set the overload config parameters
OverloadMonitor.max_phase_filter_sum = data->param[0] * 1024L; OverloadMonitor.max_bat_filter_sum = data->param[1] * 1024L; OverloadMonitor.phase_filter_decay = data->param[2]; OverloadMonitor.bat_filter_decay = data->param[3];
- 1123 : enable/disable overload current monitor
- The computation at 10KHZ, sums the ABS of a Q15 current and subtracts the decay value on each cycle
- the time (in sec) for the to trip is (when in 'integer' units)
t = MAX_SUM / (I_Q15 - DECAY) / 10000
- when in fraction units:
t = 0.07 / (f_Q15 - 0.015)
For the defaults:
- 30 amps, 80mS
- 25 amps, 100mS
- 20 amps, 132mS
- 15 amps, 195mS
- 10 amps, 373mS
dataport
- 1257 - dataport_set_select(val)
- 0 : received values from SC
- 1 : electronic fuse sums