geofft wrote: ↑
Jan 03, 2018 12:21 pm
My replacement controller arrived today, so after much wrestling with the software eventually managed to get the firmware downloaded and ventured out in the current stormy weather to give it a try.
Initial findings are very positive, the pas works progressively and smoothly, also the throttle blends in with pas quite nicely. This is one area where the stock firmware was less than perfect, the added throttle being rather 'all or nothing' with little progression. Out on the road the motor ran quietly with no noticeable jumps or hiccups.
The feedback is really important, I was waiting for it from your experience
This is with my hardware as shown in my bottom signature line below, 'Throttle/pas' input and 'Current/Speed' control mode.
Please see that you need to use P3 = 0 to have current AND speed control, with P3 = 1, you will have only current control.
Ok, the PWM is always active even if throttle (type) value = 0 and the motor should block because of that. Maybe we can disable when wheel speed = 0 and throttle = 0.
Driving the motor forward may be an issue, because it will detect motor speed... well, looking for throttle = 0 condition may avoid this issue.
That is strange because looking at the code:
Code: Select all
ui8_temp = ui8_max (ui8_throttle_value_filtered, ui8_temp); // use the max value from throotle or pas cadence
And just after ui8_temp is multiplied by ui8_assist_level...
Also I do remember to test this... can you please test, with your wheel on the hair and P3 = 0, so you should get speed control linear to PAS cadence:
Code: Select all
// if LCD P3 = 0, control also the speed
// set target motor speed to the value defined on the LCD
// (due to motor configurations on the motor controller, this will only put a limit to the max permited speed!)
motor_controller_set_target_speed_erps (motor_controller_get_target_speed_erps_max ());
// PAS cadence will setup motor speed
// map PAS candence value to motor speed value
ui16_target_speed_erps = (uint16_t) (map ((uint32_t) f_temp,
(uint32_t) 0, // motor speed min value
(uint32_t) motor_controller_get_target_speed_erps_max ())); // motor speed from max value, defined on the LCD
You are correct, the implementation is the following (you can see at void ebike_throotle_type_throotle_pas (void)
in ebike_app.c file). The idea of direct PWM was only throttle, mainly for development... do you want to use it?? If yes, I can add also PAS control to that.
Code: Select all
f_temp = (float) (((float) ui8_throttle_value_filtered) * f_temp);
ui8_temp = (uint8_t) (map ((uint32_t) f_temp,
ui8_pwm_duty_cycle_duty_cycle_controller = ui8_temp;
Yes, now I remember that I have the same issue about bad current readings on the LCD. I have LCD3 installed on my direct drive motor ebike and I am not using it right now so I forgot that issue.
About controller to be significantly warm, I think this can happen because:
1. your FOC_READ_ID_CURRENT_ANGLE_ADJUST value is not good and the controller is "giving" more battery power to the motor than what original firmware... I guess the motor would also get warmer on this case
2. the PWM scheme used is different from the original firmware and for what I did read, the original may have less 30% wasted energy on the PWM commutations and meaning maybe 30% warmer on our firmware
I don't really know if 2. cause a big impact. With my tests, I never go the controller to hot (S06S or S12S) but yes, I think with original firmware is less hot. About efficiency, stancecoke did test before and it seems very good, at least as the original firmware if not better.