I implemented the current controller for battery current and motor phase current. The battery current should be setup to max value of 18 amps as it is the limit of the controller (well, we can just try a bigger value but who knows what will be damaged? will the controller mosfets burn? the motor phase wires? the metal gears?).
The motor phase current is a protection for mosfets because the motor phase current can be very high like 75 amps at startup and that can burn the mosfets. I setup a max value of 25 amps although because there is a delay on the circuit, it is not guaranteed. This limit will also make motor startup slower...
Also, to reduce the motor phase current, increased the ramp up step value of duty_cycle and this will also protect the motor gears.
The battery current is what gives the motor torque and so this can be limited to any value between 0 and 18 amps. I wish I can implement power limit, like battery voltage * battery current = power. So when battery voltage drops as it discharges, the system will increase battery current to maintain the same amount of power assist.
For each LCD assist level A1, a different max power will be defined. Let's say on level 4, max power will be 400 watts. Rider can pedal at max force on pedals but motor will assist at max value of 400 watts.
Also LCD assist level A2 will setup different torque sensor sensitivity, where level 10 will be the most sensitivity.
So, there will be 2 LCD assist levels: 1. for setup motor max power assist; 2. for setup torque sensor sensitivity
Example of real time data from:
- motor speed in ERPs
- target duty_cyle
- battery current (limited to 6 ADC units = 3.75 amps)
- motor phase current (limited to 40 ADC units = 25 amps)
As you can see, put throttle to max and target duty_cyle is 210 however, the duty_cycle never reaches there and stays at 120 because the current controller is limiting the duty_cycle value and so as you can see, the battery current is around the 3.75 amps / 6 ADC units.
Full size image