Skip to content

The Lishui Parameter Configuator

stancecoke edited this page Mar 14, 2021 · 21 revisions

Basic Settings

Basic Settings

Display settings

Several Display types are supported.

J-LCD

Displays, that are using the Kingmeter J-LCD protocol

KM5S

Displays, that are using the Kingmeter KM5S protocol

lines, that are not described here don't have to be adjusted

#define DISPLAY_TYPE DISPLAY_TYPE_KINGMETER_901U //copy the right display type here.

#define wheel_circumference 2202 //wheel circumference in mm

#define THROTTE_OFFSET 1210 //ADC-value at closed throttle

#define TS_COEF 2000 //coefficient for torque-sensor-mode

#define TS_MODE //Torquesensor-Mode, comment out this line, if you want to use current levels.

#define PAS_TIMEOUT 12000 //time tics @ 16kHz untils motor stops

#define RAMP_END 4000 //time tics @ 16kHz where motor reaches full level power

#define PH_CURRENT_MAX 300 //iq value (phase current in rotating frame), not calibrated yet

#define P_FACTOR_I_Q 1L //proportional factor for PI control of iq

#define I_FACTOR_I_Q 0.1F //integral factor for PI control of iq

#define P_FACTOR_I_D 1L //proportional factor for PI control of id

#define I_FACTOR_I_D 1L //integral factor for PI control of id

#define SPEC_ANGLE -357913941L //motor specific angle, refer to chapter 8.3.3 maped to 2^31

#define CAL_V 7LL // 1V / 40 digits ADC, *1/Sqrt(3) /2048 max DutyCycle

#define CAL_I 5LL // 1A / 20 digits ADC

//Constants for Motor model of observer

#define INDUCTANCE 12LL // 10^4 0.0012 //H = Vs/A

#define RESISTANCE 3500LL // *10^4 0.35 //Ohm = V/A