KT motor controllers -- Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Electric Motors and Controllers
casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 21 2018 1:20pm

stancecoke wrote:
Mar 05 2018 3:31am
casainho wrote:
Mar 04 2018 4:04pm
Hmmm... how did you observe that??
The motor was noisy and drew much current without producing torque after a longer regen time.
I tried to improve this, I went did some test rides but I couldn't find anything wrong... like noises. Would be great if you could test this changes - on master branch now:

Code: Select all

// read here the phase B current: FOC Id current
ui8_adc_id_current = UI8_ADC_MOTOR_PHASE_B_CURRENT;

// first, verify if motor current is positive or negative (motor or regen mode), if regen mode, we need to invert the logic for angle correction
// second, adjust ui8_angle_correction so the ui8_adc_id_current is zero (FOC principle)
if (ui8_adc_motor_current > ui8_adc_motor_current_offset)
{
  if (ui8_adc_id_current > ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MAX) { ui8_angle_correction++; }
  else if (ui8_adc_id_current < ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MIN) { ui8_angle_correction--; }
}
else if (ui8_adc_motor_current < ui8_adc_motor_current_offset)
{
  if (ui8_adc_id_current > ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MAX) { ui8_angle_correction--; }
  else if (ui8_adc_id_current < ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MIN) { ui8_angle_correction++; }
}
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Mar 22 2018 4:27am

Works the recent master branch out of the box? I use the modded BMS-Torquesensor and I fear, that the direction detection will fail with the recent code....

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 4:43am

stancecoke wrote:
Mar 22 2018 4:27am
Works the recent master branch out of the box? I use the modded BMS-Torquesensor and I fear, that the direction detection will fail with the recent code....
I think I didn't changed any code about PAS and PAS direction. I am being testing only with torque sensor. I don't have now any ebike with PAS installed so I can't test.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Mar 22 2018 4:51am

?! But you have modded the Torquesensor with a "normal" PAS to use regen like coast brakes?

Code: Select all

#define EBIKE_REGEN_EBRAKE_LIKE_COAST_BRAKES
regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 4:55am

stancecoke wrote:
Mar 22 2018 4:51am
?! But you have modded the Torquesensor with a "normal" PAS to use regen like coast brakes?

Code: Select all

#define EBIKE_REGEN_EBRAKE_LIKE_COAST_BRAKES
Yes, I am being riding with torque sensor + EBIKE_REGEN_EBRAKE_LIKE_COAST_BRAKES.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Mar 22 2018 5:03am

casainho wrote:
Mar 22 2018 4:55am
Yes, I am being riding with torque sensor
With a modded torquesensor and your modding is different to mine...

Regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 5:17am

stancecoke wrote:
Mar 22 2018 5:03am
casainho wrote:
Mar 22 2018 4:55am
Yes, I am being riding with torque sensor
With a modded torquesensor and your modding is different to mine...
Yes. And I am not being using "human power", so, the following code may not working as it depends on PAS1 reading but I never tested it with torque sensor PAS signal, only with PAS signal:

Code: Select all

#if defined (EBIKE_THROTTLE_TYPE_TORQUE_SENSOR_HUMAN_POWER)
  // calc humam power on the crank using as input the pedal torque sensor value and pedal cadence
  ui16_temp = (uint16_t) (f_temp * ((float) ((float) ui8_pas1_cadence_rpm / ((float) PAS_MAX_CADENCE_RPM))));
#else
Please test without "human power" and if it works, so the issue is with human power because of dependence with PAS1 reading.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Mar 22 2018 8:19am

casainho wrote:
Mar 22 2018 5:17am
as it depends on PAS1 reading but I never tested it
I never understood, why you use PAD X4 for PAS1 .... :-). I thougt you would use it for reading a quadrature signal of two PAS-Halls like the thun torque sensor delivers....

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 8:28am

stancecoke wrote:
Mar 22 2018 8:19am
casainho wrote:
Mar 22 2018 5:17am
as it depends on PAS1 reading but I never tested it
I never understood, why you use PAD X4 for PAS1 .... :-). I thougt you would use it for reading a quadrature signal of two PAS-Halls like the thun torque sensor delivers....

Code: Select all

#define PAS1__PIN                 GPIO_PIN_0
#define PAS1__PORT                GPIOD

#define PAS2__PIN                 GPIO_PIN_7
#define PAS2__PORT                GPIOB
What I decided was to use PAS1 (the same connection of regular PAS) for connect PAS signal from torque sensor. Also use regular throttle connection for torque sensor throttle signal. This makes regular S06S to be able to work with torque sensor, without user need to solder any extra wires to the controller. Yes, is lost the possibility to have torque sensor + throttle, but I think a user want to have that both options, may be remote.

PAS2 to be used, a wire need to be soldered to PAD X4, that is why I decided to use for my mod that needs a secondary PAS - I think that only advanced users may want to use this mod and so they will be bale to solder the wire.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

User avatar
stancecoke   10 kW

10 kW
Posts: 896
Joined: Aug 02 2017 2:56pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by stancecoke » Mar 22 2018 8:40am

OK, I struggled with PAS1 and PAS2 naming...

I wonder, why Kunteng puts the Pullup/Pulldown resistors to pad X4/PB7, as it is an ADC input line...

regards
stancecoke

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 8:46am

stancecoke wrote:
Mar 22 2018 8:40am
OK, I struggled with PAS1 and PAS2 naming...

I wonder, why Kunteng puts the Pullup/Pulldown resistors to pad X4/PB7, as it is an ADC input line...
Maybe because they want to use it instead as a digital pin. Do you know what is typical usage of this pin?
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 8:56am

casainho wrote:
Mar 22 2018 8:46am
Maybe because they want to use it instead as a digital pin. Do you know what is typical usage of this pin?
I know that some of that free pins may be used for:
- turn on/off power board that controlls external lamps
- torque sensor version of S06S
- Bluetooth module control
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

chilltrout   10 W

10 W
Posts: 69
Joined: Oct 30 2016 8:08am

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by chilltrout » Mar 22 2018 10:42pm

I just got a heap of multistars form the sale
went with 18s because it made the most sens.
Id love to run kunteng controllers, but I can only find 48v, 60v, 72v.

If I go the 60 or the 72v what will I need to do, just change the LVC and HVC resistor?

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 22 2018 11:25pm

chilltrout wrote:
Mar 22 2018 10:42pm
I just got a heap of multistars form the sale
went with 18s because it made the most sens.
Id love to run kunteng controllers, but I can only find 48v, 60v, 72v.

If I go the 60 or the 72v what will I need to do, just change the LVC and HVC resistor?
Each hardware may work well only on a specific range of input voltage, firmware can't extend that range.

You should not need to change any resistor on hardware but instead measure with multimeter what is the input value on microcontroller pin that measures battery voltage, for a specific input voltage. There is an attenuation factor for the input voltage because the microcontroller can measure only up to 5v.
Go to file main.h to see that value we found for S06S and S12S of 24V, 36vV amd 48V controllers - it is the same value for them.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

chilltrout   10 W

10 W
Posts: 69
Joined: Oct 30 2016 8:08am

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by chilltrout » Mar 23 2018 9:49am

Ok im following, do you think 18s will work on either 60v or 72v?
whats doing the conditioning to the MCUs ADC? Is it not possible to mess with?
Im guessing 60v might be a better option then 72v because of the LVC?

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 23 2018 9:56am

chilltrout wrote:
Mar 23 2018 9:49am
Ok im following, do you think 18s will work on either 60v or 72v?
whats doing the conditioning to the MCUs ADC? Is it not possible to mess with?
Im guessing 60v might be a better option then 72v because of the LVC?
I would go also with 60V version.
Look at schematic of S06S, should be similar schematic. It think the issue can be the circuit for mosfets that can limit. For MCU, it is only a voltage divider.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

chilltrout   10 W

10 W
Posts: 69
Joined: Oct 30 2016 8:08am

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by chilltrout » Mar 23 2018 10:19am

casainho wrote:
Mar 23 2018 9:56am
chilltrout wrote:
Mar 23 2018 9:49am
Ok im following, do you think 18s will work on either 60v or 72v?
whats doing the conditioning to the MCUs ADC? Is it not possible to mess with?
Im guessing 60v might be a better option then 72v because of the LVC?
I would go also with 60V version.
Look at schematic of S06S, should be similar schematic. It think the issue can be the circuit for mosfets that can limit. For MCU, it is only a voltage divider.
Wilco! I can do some basic math and smd resistors, I guess :P
What about LCD3 wise, there seems to be a 36/48v, 60v and 72v variant?
Is there anything to worry about input voltage wise or not sure?

casainho   100 MW

100 MW
Posts: 2651
Joined: Feb 14 2011 2:43pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by casainho » Mar 23 2018 10:25am

My LCDs says the input voltage range they can operate, like 24-36V - you should look for that, to your case.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, you can consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by honya96 » Mar 24 2018 5:06am

chilltrout wrote:
Mar 23 2018 9:49am
Ok im following, do you think 18s will work on either 60v or 72v?
whats doing the conditioning to the MCUs ADC? Is it not possible to mess with?
Im guessing 60v might be a better option then 72v because of the LVC?
You need 100v mosfets and capacitors.. not sure if 60v version has them..so I would go with 72V version.. with stock fw its easy to change LVC resistor, so theres no need to buy 60v.

But lcd3 72v cant work under 50v

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by honya96 » Mar 24 2018 5:09am

casainho wrote:
Mar 23 2018 10:25am
My LCDs says the input voltage range they can operate, like 24-36V - you should look for that, to your case.
Not 24-48?? Which means like 20-60v real?

e3s   1 mW

1 mW
Posts: 11
Joined: Jan 08 2018 12:40pm

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by e3s » Mar 24 2018 10:22am

is there a kuteng controller that supports high voltage (100-120v)?

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by honya96 » Mar 24 2018 10:54am

e3s wrote:
Mar 24 2018 10:22am
is there a kuteng controller that supports high voltage (100-120v)?
No.

Possible to mod, but still beter to go with 20s li-ion.

Higher voltage is not better.

1N4001   10 W

10 W
Posts: 70
Joined: Nov 28 2017 7:55am

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by 1N4001 » Mar 24 2018 7:23pm

You will have to replace the controller power supply LM317 with something that can take your 120V down to 15V without overheating, i.e. some kind of step-down converter.

Next replace the MOSFETs with beefier ones that can handle your voltage.

Modify the voltage divider that feeds battery voltage into the microcontroller (pin 24 iirc).

Lastly, reduce the voltage sent to the LCD. Either pin 1 (VBAT+) or pin 2 (VIN), I'm not entirely sure about the difference between these two.

Anything I missed?

honya96   1 kW

1 kW
Posts: 328
Joined: Mar 05 2015 9:38am
Location: Czech Republic

Re: Flexible OpenSource firmware for BMSBattery S/Kunteng KT motor controllers (0.25kW up to 5kW)

Post by honya96 » Mar 25 2018 12:14am

1N4001 wrote:
Mar 24 2018 7:23pm
Anything I missed?
Capacitors

electrolytic and the 3 red ceramic


Post Reply