So I would like to make some strategic decisions here. To have a better quality firmware/system, I prefer to focus on less hardware combinations/options.stancecoke said:1. Because I own one.As mentionded before, I prefer Lishui controllers and therefore I have Kingmeter Displays.
2. I have tested several torquesensors within the last years, see the wiki in the german forum.
I would recomment the sempu sensor as first choice at the moment.
The sensor from BMSBattery (or from other sources) has the big advantage, that it works with the 5V power supply from the PAS-connector. Other sensors usually need a higher supply voltage.
I agree, but consider that we have a full working solution for a bluetooth-connection to a professional smartphone app with the J-LCD protocol. I don't know, if the Kunteng bt-module/App system is stable and uses the "standard" LCD3/LCD5 protocoll....casainho said:To have a better quality firmware/system, I prefer to focus on less hardware combinations/options.
Yes, the signals are the same for most sensors, we just have to adjust the calibration values.casainho said:- As for the torque sensor, I don't know but maybe the code is just the same
Thank you for that! I'm still concentrating on getting my motor run with your recent motor code at the moment. It is to be feared that we don't have a stable solution for a wide variety of different motors yet.casainho said:Will implement your update_setpoint ()
Makes sense it uses the same protocol, just like that other one you use. The app is available here with name "KTSmartBicycle" - seems that was updated 10 days ago: https://www.pgyer.com/joflstancecoke said:I agree, but consider that we have a full working solution for a bluetooth-connection to a professional smartphone app with the J-LCD protocol. I don't know, if the Kunteng bt-module/App system is stable and uses the "standard" LCD3/LCD5 protocoll....casainho said:To have a better quality firmware/system, I prefer to focus on less hardware combinations/options.
(By the way, I read that you are not really happy with your Kunteng Display :wink: )
We need to focus on that!! We need to get more and more knowledge.stancecoke said:Thank you for that! I'm still concentrating on getting my motor run with your recent motor code at the moment. It is to be feared that we don't have a stable solution for a wide variety of different motors yet.casainho said:Will implement your update_setpoint ()
While I still used a lot of time, I also did as quick as possible. Don't take my code as without errors, just because it works for mestancecoke said:BTW: is the start of the recent SVM table related to the zero crossing with positive edge of phase A current?!
I'm still wondering why the switching to sine mode at the beginning of case1 (rotor position =0°, 240° from the switch case + 300° from the MOTOR_ROTOR_DELTA_PHASE_ANGLE_RIGHT + 180° from the ui8_position_correction_value, 240+300+180= 720 =2*360=0) works, as the 6-Step pattern assumes, the switch should happen 90° earlier?!
The sketch shows the currents in a (in my eyes) syncronized state...
I don't know. But I think the angle with 6 steps don't need to be the same as on sinewave - maybe it is like 30 degrees or 10 degrees difference...stancecoke said:I'm still wondering why the switching to sine mode at the beginning of case1 (rotor position =0°, 240° from the switch case + 300° from the MOTOR_ROTOR_DELTA_PHASE_ANGLE_RIGHT + 180° from the ui8_position_correction_value, 240+300+180= 720 =2*360=0) works, as the 6-Step pattern assumes, the switch should happen (edit60° earlier?!
The sketch shows the currents in a (in my eyes) syncronized state...
I like the idea, I just don't like using symbols, as I think they are hard to memorize and also bad for online search motors. I will be back to this subject later.stancecoke said:Thank you!
Suggestion for a name:
C#ROME-B
Custom ROM for E-Bikes
Speak as two words: CHROME- BEE
Wait, the issue is that ADC phase B is always near 127? Is just that?stancecoke said:After trying for another two hours, I have to say, that I can't get your code running on my motor, even with exactly the same compiler-options as in the test ADC branch.
I'm not sure if it's the right way, we are going actually, as even the code you 've compiled with Linux doesn't work properly for me. I think we have to go 5 steps backwards an start again from the last stable code that worked for both of us...
1. As I found, not even my transition to sinewave works everytime and also there is a big difference/jump higher in speed and current.stancecoke said:three things, where I'm not happy with your .hex:
1. Motor makes a noisy jump when switching on the system
2. displayed correction angle stays at 127 all the time
3. efficiency is bad (may be related to #2)
Can you please record a video, trying a few times?Try also switch on but with brakes active.stancecoke said:For #1 I mean switching on the battery without touching the throttle.
Was very quick tests as I am not permitted to develop on weekends.......ThierryGTLTS said:Interesting, I would like to know why it's less efficient in sinewave.
I don't understand but I would like to explain how I see it, maybe I am not think correctly:stancecoke said:I think you have to edit your SVM Table first. You have to take care of the 90° phase shift between voltage and current. Otherwise you will never get a zero crossing of current at a hall sensor interrupt....
ui8_temp = ui8_svm_table[ui8_motor_rotor_position];
ui8_value_a = ui8_temp * k;
TIM1_SetCompare1((uint16_t) ui8_value_a); // phase A
ui8_temp = ui8_svm_table[(uint8_t) (ui8_motor_rotor_position + 85 /* 120º */)];
ui8_value_b = ui8_temp * k;
TIM1_SetCompare2((uint16_t) ui8_value_b); // phase B
ui8_temp = ui8_svm_table[(uint8_t) (ui8_motor_rotor_position + 171 /* 240º */)];
ui8_value_c = ui8_temp * k;
TIM1_SetCompare3((uint16_t) ui8_value_c); // phase C
ui8_motor_rotor_absolute_position = ANGLE_120 + MOTOR_ROTOR_DELTA_PHASE_ANGLE_RIGHT;
ui8_motor_rotor_position = ui8_motor_rotor_absolute_position + ui8_position_correction_value + ui8_interpolation_angle;
Yes, voltage is controlled with PWM duty_cycle. A 50% value means Voltage battery * 0.5, for instance, if motor is rotating already, it generates a voltage on his phase wires(the BEMF) and we need to put the same voltage with PWM duty_cycle, other different value is like a "short-circuit"/high currents flowing.stancecoke said:It's all correct what you write, but has nothing to do with the fact, that you control the voltage with the PWM.
So we want to control/mantain the phase current synchronized with motor rotor position. We can't directly control the phase current, but we can control it indirectly by controlling(directly) the phase voltage.stancecoke said:The current is a result of the voltage and is phase shifted to the voltage...
ui8_motor_rotor_position = ui8_motor_rotor_absolute_position + ui8_position_correction_value + ui8_interpolation_angle;