|
|
@@ -187,9 +187,9 @@ void mc_conf_default(void) {
|
|
|
conf.m.nor_pll_band = CONFIG_Motor_PLLBand;
|
|
|
conf.m.epm_pll_band = CONFIG_Motor_EpmPLL;
|
|
|
conf.m.pos_pll_band = CONFIG_Motor_PosPLL;
|
|
|
- conf.m.vehicle_w = CONFIG_Motor_VehicleW;
|
|
|
- conf.m.wheel_c = CONFIG_Motor_WheelC;
|
|
|
- conf.m.gear_ratio = CONFIG_Motor_GearRatio;
|
|
|
+ //conf.m.vehicle_w = CONFIG_Motor_VehicleW;
|
|
|
+ //conf.m.wheel_c = CONFIG_Motor_WheelC;
|
|
|
+ //conf.m.gear_ratio = CONFIG_Motor_GearRatio;
|
|
|
conf.m.max_fw_id = CONFIG_Motor_MaxFwDCurr;
|
|
|
conf.m.max_torque = CONFIG_Motor_MaxTorque;
|
|
|
conf.m.encoder_offset = CONFIG_Motor_EncOffset;
|
|
|
@@ -302,12 +302,14 @@ int mc_conf_decode_motor(u8 *buff) {
|
|
|
conf.m.nor_pll_band = (float)decode_u16(buff); buff += 2;
|
|
|
conf.m.epm_pll_band = (float)decode_u16(buff); buff += 2;
|
|
|
conf.m.pos_pll_band = (float)decode_u16(buff); buff += 2;
|
|
|
- conf.m.vehicle_w = decode_u16(buff);buff += 2;
|
|
|
- conf.m.wheel_c = decode_u16(buff);buff += 2;
|
|
|
- conf.m.gear_ratio = decode_float(buff);buff += 4;
|
|
|
+ conf.m.fw_enable = decode_u8(buff);buff += 1;
|
|
|
+ conf.m.fw_duty_start = decode_u8(buff);buff += 1;
|
|
|
conf.m.max_fw_id = decode_u16(buff); buff += 2;
|
|
|
conf.m.max_torque = decode_u16(buff); buff += 2;
|
|
|
conf.m.encoder_offset = decode_s16(buff); buff += 2;
|
|
|
+ if (conf.m.fw_duty_start > 100) {
|
|
|
+ conf.m.fw_duty_start = 100;
|
|
|
+ }
|
|
|
return buff - ori;
|
|
|
}
|
|
|
|
|
|
@@ -321,9 +323,8 @@ int mc_conf_encode_motor(u8 *buff) {
|
|
|
encode_u16(buff, (u16)conf.m.nor_pll_band); buff += 2;
|
|
|
encode_u16(buff, (u16)conf.m.epm_pll_band); buff += 2;
|
|
|
encode_u16(buff, (u16)conf.m.pos_pll_band); buff += 2;
|
|
|
- encode_u16(buff, conf.m.vehicle_w);buff += 2;
|
|
|
- encode_u16(buff, conf.m.wheel_c);buff += 2;
|
|
|
- encode_float(buff, conf.m.gear_ratio);buff += 4;
|
|
|
+ encode_u8(buff, (u8)conf.m.fw_enable);buff += 1;
|
|
|
+ encode_u8(buff, conf.m.fw_duty_start);buff += 1;
|
|
|
encode_u16(buff, conf.m.max_fw_id); buff += 2;
|
|
|
encode_u16(buff, conf.m.max_torque); buff += 2;
|
|
|
encode_s16(buff, conf.m.encoder_offset); buff += 2;
|