OK, I will post here when I have reply with availability/pricecasainho wrote:I would like to buy 3 units of this module.vex_zg wrote: In the meantime:
I asked the seller who sold me this bluetooth module if he can get more. He might be able to get some from the KT factory. Is anybody interested? I only asked because somebody here wrote BT modules can't be purchased separately.
KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Support for J-LCD works partly now . Receiving Data is controlled by interrupt. See updated github branch and this video:
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
You are the men!!stancecoke wrote:Support for J-LCD works partly now . Receiving Data is controlled by interrupt. See updated github branch and this video:

On that video, the assistance level you were selecting, what did define on the firmware? the motor current? motor speed??
You are the men 2!!stancecoke wrote: The module can be easily homebrewed:![]()

So you did document your build for the bluetooth module and it is even more complex than I thought.... and you got it working with Lishui original app

I will copy-past your forum message to the HTML/notes of this documentation!!

So much work and achievements! -- my girlfriend is joking saying that by now, your wife already put you out of the house

- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
-
- Posts: 54
- Joined: Jan 10 2017 8:10am
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Hi guys,
I've discovered a triple error in the S06C schematic.
+ of C1 is conected to cathode of D2, + of C3 is conected to cathode of D4, + of C14 is conected to cathode of D8, and not to Vout.
Otherwise the boostrap will not work
Hope it may help in case of troubleshooting.
I have 2 S06SC (for central motor, and the waveform is also not very sinusoïdal, it is equipped with ACS711.
I also noticed that the Cheeta looks like the VESC of Benjamin Vedder, did it share the same firmware
Have a Nice Day.
Thierry
I've discovered a triple error in the S06C schematic.
+ of C1 is conected to cathode of D2, + of C3 is conected to cathode of D4, + of C14 is conected to cathode of D8, and not to Vout.
Otherwise the boostrap will not work

Hope it may help in case of troubleshooting.
I have 2 S06SC (for central motor, and the waveform is also not very sinusoïdal, it is equipped with ACS711.
I also noticed that the Cheeta looks like the VESC of Benjamin Vedder, did it share the same firmware


Have a Nice Day.
Thierry
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
It's just used to set the duty cycle by nowcasainho wrote: On that video, the assistance level you were selecting, what did define on the firmware? the motor current? motor speed??
Code: Select all
pwm_set_duty_cycle ((ui8_assistlevel_global-1)*60); //for test of display communication
My whole family was laughing when I read out this sentence loud.casainho wrote: my girlfriend is joking saying that by now, your wife already put you out of the house

regards
stancecoke
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
great work Stan with the lishui bt adapter / app.
I presume the app will only work with lishui controllers, and not KT controllers?
I presume the app will only work with lishui controllers, and not KT controllers?
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Thanks.ThierryGTLTS wrote:Hi guys,
I've discovered a triple error in the S06C schematic.
+ of C1 is conected to cathode of D2, + of C3 is conected to cathode of D4, + of C14 is conected to cathode of D8, and not to Vout.
Otherwise the boostrap will not work![]()
Hope it may help in case of troubleshooting.
I have 2 S06SC (for central motor, and the waveform is also not very sinusoïdal, it is equipped with ACS711.
I also noticed that the Cheeta looks like the VESC of Benjamin Vedder, did it share the same firmware![]()
![]()
I just started an issue on the schematic repo, let's see if KingQueenWong can correct the schematic: https://github.com/KingQueenWong/bmsbat ... e/issues/1
Link for Cheeta??
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
you are right, it has only Kingmeter and Bafang protocols implemented. (Unless you use the Open Source firmware...vex_zg wrote: I presume the app will only work with lishui controllers, and not KT controllers?

viewtopic.php?f=30&t=87870&p=1317505&hi ... a#p1317505casainho wrote: Link for Cheeta??
regards
stancecoke
- Attachments
-
- Screenshot_protocol settings.png (130.06 KiB) Viewed 1847 times
Last edited by stancecoke on Oct 09 2017 1:59am, edited 3 times in total.
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
I am planning to move on to software development (professionally). I am start learning JavaScript and I think my first project may be the Android app for this project (to build experience and portofolio) -- (will be using Reactive Native javascript to develop the app).stancecoke wrote:you are right, it has only Lishui and Bafang protocols implemented. (Unless you use the Open Source firmware...vex_zg wrote: I presume the app will only work with lishui controllers, and not KT controllers?)
In parallel I will keep working on the firmware but more specifically on the motor control.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
I wish you much success!casainho wrote: I am planning to move on to software development (professionally).
I've played around with app development (for home automation and geocaching) a little, but I wasn't very happy with my progress...

Here another video, using the bluetooth module to drive the controller
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Thanks.
- max current limit value setup
- max current regen limit value setup (regen happens when decelerating)
From 3 to 2, seems the motor makes a strong noise... seems that it switch from sinewave interpolation to no interpolation. Seems your motor do regen on that step... to help improve this I need to make a stable motor code so you can adopt it. Let's see If I can do it tomorrow:stancecoke wrote: Here another video, using the bluetooth module to drive the controller
- max current limit value setup
- max current regen limit value setup (regen happens when decelerating)
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Seller responded that he doesn't have any BT modules to sell now (the ones like the sample I photographed)vex_zg wrote:OK, I will post here when I have reply with availability/pricecasainho wrote:I would like to buy 3 units of this module.vex_zg wrote: In the meantime:
I asked the seller who sold me this bluetooth module if he can get more. He might be able to get some from the KT factory. Is anybody interested? I only asked because somebody here wrote BT modules can't be purchased separately.
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Thank you. I will then build my own module following stancecocke documentationvex_zg wrote:Seller responded that he doesn't have any BT modules to sell now (the ones like the sample I photographed)

- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
KingQueenWong had corrected that issuecasainho wrote:I just started an issue on the schematic repo, let's see if KingQueenWong can correct the schematic: https://github.com/KingQueenWong/bmsbat ... e/issues/1ThierryGTLTS wrote:Hi guys,
I've discovered a triple error in the S06C schematic.

- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
stancecoke, can you please start using the motor code from motor branch?? https://github.com/OpenSource-EBike-fir ... tree/motorcasainho wrote:Thanks.From 3 to 2, seems the motor makes a strong noise... seems that it switch from sinewave interpolation to no interpolation. Seems your motor do regen on that step... to help improve this I need to make a stable motor code so you can adopt it. Let's see If I can do it tomorrow:stancecoke wrote: Here another video, using the bluetooth module to drive the controller
- max current limit value setup
- max current regen limit value setup (regen happens when decelerating)
That code works well for my but only for my Q85 motor, for the other direct drive motor it has some issues that I need to understand to fix.
Code: Select all
/***************************************************************************************/
// Motor interface
void hall_sensor_init (void); // must be called before using the motor
void motor_init (void); // must be called before using the motor
void motor_set_mode_coast (void); // disable PWM output
void motor_set_mode_run (void); // enable PWM output
void motor_set_pwm_duty_cycle_target (uint8_t value);
void motor_set_current_max (uint8_t value); // steps of 0.5A each step
void motor_set_regen_current_max (uint8_t value); // steps of 0.5A each step
void motor_set_pwm_duty_cycle_ramp_inverse_step (uint8_t value); // each step = 64us
uint16_t motor_get_motor_speed_erps (void);
/***************************************************************************************/
- motor_init (): must be called before using motor. This mainly averages some ADC samples of motor current, to find the zero value.
- motor_set_current_max (): now you can define the torque for the assistance level, instead of duty_cycle - don't forget to first define motor_set_pwm_duty_cycle_target (255).
My intuition tells me that assistance level is like different fixed throttle values but where throttle is a "speed+torque".
- motor_set_pwm_duty_cycle_ramp_inverse_step (uint8_t value): it doesn't work as it should because seems motor current control interacts with this value. But you can use a very low value like 1 or 2.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Added motor OC (over current) protection, using an pin change interrupt that have the following code:
Code: Select all
#define CURRENT_MOTOR_TOTAL_OVER__PIN GPIO_PIN_7
#define CURRENT_MOTOR_TOTAL_OVER__PORT GPIOD
/***************************************************************************************/
// motor overcurrent pin as external input pin interrupt
GPIO_Init(CURRENT_MOTOR_TOTAL_OVER__PORT,
CURRENT_MOTOR_TOTAL_OVER__PIN,
GPIO_MODE_IN_FL_IT); // with external interrupt
//initialize the Interrupt sensitivity
EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOD,
EXTI_SENSITIVITY_FALL_LOW);
/***************************************************************************************/
Code: Select all
// motor overcurrent interrupt
void EXTI_PORTD_IRQHandler(void) __interrupt(EXTI_PORTD_IRQHANDLER)
{
motor_set_mode_coast ();
while (1) ; // infinite loop, user will need to reset the system
}
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
stancecoke,
I tried the firmware with my bicycle Q85 motor and turns out it doesn't have torque (I even did disable motor max current control for testing). The only way to have torque, I tested, is with 6 steps!! But I still can't start with 6 steps and transition to sinewave....
I tried the firmware with my bicycle Q85 motor and turns out it doesn't have torque (I even did disable motor max current control for testing). The only way to have torque, I tested, is with 6 steps!! But I still can't start with 6 steps and transition to sinewave....

- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Hmm, I changed nothing concerning the motor.c / pwm.c functions. Have you tried the original code of the J-LCD branch, or have you merged something together? Is the motor running without load?casainho wrote: I tried the firmware with my bicycle Q85 motor and turns out it doesn't have torque
With the simple setting of assistLevel to dutycycle, the motor isn't running with the lab power supply properly, as with the change of the assistLevel a high current peak occurs, the power supply drops the voltage and the controller stops the motor due to undervoltage protection. With a battery the motor runs properly.
Regards
stancecoke
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Display of speed and power is working now!

Last edited by stancecoke on Oct 10 2017 12:56pm, edited 1 time in total.
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Which parts do I have to merge? Just motor.c and pwm.c?stancecoke wrote: stancecoke, can you please start using the motor code from motor branch??
[/quote]
Great progress!!

Many changes... install Meld and to the folder comparition between your branch and motor branch. Meld shows you with pretty visuals the diffs and you can even merge/delete the changes.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
The power supply I am using can give 10 amps which is a good value.stancecoke wrote:Hmm, I changed nothing concerning the motor.c / pwm.c functions. Have you tried the original code of the J-LCD branch, or have you merged something together? Is the motor running without load?casainho wrote: I tried the firmware with my bicycle Q85 motor and turns out it doesn't have torque
With the simple setting of assistLevel to dutycycle, the motor isn't running with the lab power supply properly, as with the change of the assistLevel a high current peak occurs, the power supply drops the voltage and the controller stops the motor due to undervoltage protection. With a battery the motor runs properly.
Seems that my direct drive motor is very different from Q85. Let's see if I can something working fro Q85. I am trying on the bicycle but with lab power supply and as soon I have something working ok I will move to a battery

- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- stancecoke 100 kW
- Posts: 1375
- Joined: Aug 02 2017 2:56pm
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Don't put any time in this stupid way of using the assistLevel information. I was just too lazy to verify the function of the UART Communication in a more intelligent way.
I suggest to define an array with the percentage of an absolute max current (defined in an #define statement) the assistLevels should stand for.
then you can use that for the "torque simulation" mode.
In this way you ramp up ui8_ADC_motor_current_max with the cadence. In your existing pwm_duty_cycle_controller you then can add a simple p-controller to tune duty cycle to the recent current setpoint, instead of just decreasing the dutycycle if current is too high.
regards
stancecoke
I suggest to define an array with the percentage of an absolute max current (defined in an #define statement) the assistLevels should stand for.
Code: Select all
assistLevel_percentage[5] = {20, 40, 60, 80, 100};
then you can use that for the "torque simulation" mode.
Code: Select all
#ifdef TORQUE_SIMULATION
if (ui16_PAS_Counter<timeout){
if (ui16_PAS>ramp_end){
ui8_ADC_motor_current_max=(assistLevel_percentage[(ui8_assistlevel_global-1)]/100*ADC_MOTOR_CURRENT_MAX)* ramp_end/ui16_PAS;
}
else{
ui8_ADC_motor_current_max=(assistLevel_percentage[(ui8_assistlevel_global-1)]/100*ADC_MOTOR_CURRENT_MAX)
}
else{
ui32_setpoint=0;
printf("you are not pedaling!");
}
#endif
regards
stancecoke
Last edited by stancecoke on Oct 11 2017 7:09am, edited 1 time in total.
-
- Posts: 54
- Joined: Jan 10 2017 8:10am
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
OK, it's right now.casainho wrote:KingQueenWong had corrected that issuecasainho wrote:I just started an issue on the schematic repo, let's see if KingQueenWong can correct the schematic: https://github.com/KingQueenWong/bmsbat ... e/issues/1ThierryGTLTS wrote:Hi guys,
I've discovered a triple error in the S06C schematic.
Thierry
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
Just got the Q85 motor running well -- it starts with 6 steps/block commutation and transition to sinewave very well. Turns out I had to increase the speed at which that transition happens (before was 25 and now is 150).
Now it does have torque/force to start, I tested on my bicycle. But it needs more torque - my power supply gives only 10A and this controller can give 15A... can't wait to test on real battery with the current limit of 15A.
And for some reason, now the ui8_adc_read_motor_total_current (); don't work anymore... makes no sense but let's see if I found the reason or a workaround.
Now it does have torque/force to start, I tested on my bicycle. But it needs more torque - my power supply gives only 10A and this controller can give 15A... can't wait to test on real battery with the current limit of 15A.
And for some reason, now the ui8_adc_read_motor_total_current (); don't work anymore... makes no sense but let's see if I found the reason or a workaround.
- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
Re: OpenSource firmware BMSBattery S/Kunteng KT controllers
I think would be great if you could use the motor code in your branch and then we could merge your branch to master and take out a stable version of the firmware.stancecoke wrote:Don't put any time in this stupid way of using the assistLevel information. I was just too lazy to verify the function of the UART Communication in a more intelligent way.
Now I remember what you said before about slow loop current controller.stancecoke wrote: In this way you ramp up ui8_ADC_motor_current_max with the cadence. In your existing pwm_duty_cycle_controller you then can add a simple p-controller to tune duty cycle to the recent current setpoint, instead of just decreasing the dutycycle if current is too high.
The current controller on pwm_duty_cycle_controller is low level and fast, to protect the system. For this Throttle/PAS/Torque sensor controller, I agree with you that this (PI ??) controller can run at slower speed -- this have the advantage also make possible running a more complex PI controller or something, that needs more heavy math.
Also I keep seeing the Throttle/PAS/Torque sensor as "speed+torque". Using the torque sensor, your controller would control the motor speed and the motor current max:
- read motor_get_motor_speed_erps() to get motor speed and control the motor speed by adjusting the value of motor_set_pwm_duty_cycle_target()
- adjust linearly the motor_set_current_max() from the torque sensor value
Refer to the image bellow - what do you think??

- EBike wireless standard: wireless motor, wireless cycling GPS display Garmin Edge and wireless remote with wireless brake sensor
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware
Developer of OpenSource knowledge and technology for ebikes: Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.
Please consider a donation to help developments: paypal.me/jorgecasa