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

Electric Motors and Controllers
User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Jul 25 2018 11:24am

geofft wrote:
Jul 25 2018 4:13am
The Q128H motor I'm using is actually fitted with a physical sensor internally in the hub, this outputs via an extra (white) wire in the hall sensor plug. The stock controller is set up to work with this.
You can choose between external (the in-hub sensor is "external" from controllers sight :wink: ) an internal sensor with the stock firmware also. (parameter P2)

If the wheel-integrated sensor gives one pulse per wheel revolution, you can use it directly with our firmware. If there are more pulses per revolution, you can do a workaround by the wheel circumference The white wire in the Hall-Sensor connector is on the same processor pin as the white wire at the extra speed connector...

regards
stancecoke

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Jul 25 2018 12:13pm

stancecoke wrote:
Jul 25 2018 11:24am
geofft wrote:
Jul 25 2018 4:13am
The Q128H motor I'm using is actually fitted with a physical sensor internally in the hub, this outputs via an extra (white) wire in the hall sensor plug. The stock controller is set up to work with this.
You can choose between external (the in-hub sensor is "external" from controllers sight :wink: ) an internal sensor with the stock firmware also. (parameter P2)

If the wheel-integrated sensor gives one pulse per wheel revolution, you can use it directly with our firmware. If there are more pulses per revolution, you can do a workaround by the wheel circumference The white wire in the Hall-Sensor connector is on the same processor pin as the white wire at the extra speed connector...

regards
stancecoke
Thanks for the explanation, that all makes complete sense now. I guess the word 'Internal' becomes a bit ambiguous in this context, it's easy to think it refers to the internally fitted sensor. Maybe we should call this speed option 'Firmware generated' or 'Calculated' or something similar.

On a slightly different topic, my entry to the world of torque sensors hasn't begun too well. I wired a controller for this purpose and loaded the fw but it was immediately obvious that things weren't right, with the motor operating in fits and starts only. I checked the various outputs form the sensor, all seemed ok except the actual torque sensor (white wire) output. This I believe should vary between 1.5 and 4.0v depending on load, but mine outputs a constant 3.02v at rest and doesn't vary with load. This is with the controller input disconnected, so it's not being pulled up externally.

I've messaged the seller about this this but I've actually had the unit for 3 months now so I'm not expecting much sympathy from them.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

casainho   100 MW

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

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

Post by casainho » Jul 25 2018 1:31pm

casainho wrote:
Jul 25 2018 4:17am
-dg wrote:
Jul 24 2018 8:42pm
The noise environment is certainly a consideration. This applies to analog voltage throttles as well as to digital message based throttles, but analog does not have CRC so in case of a water induced short an analog throttle can command full output (I have had this happen) but a message based controller can detect that was no valid throttle message for 100ms and simply shut down if desired.

That said, what do we know about the noise environment? We have examples of working displays sending serial messages, so it appears possible to do so. I'd love to know what bit rate the current connection to the LCD can run without excessive errors. Does anyone know or have a way to test this?
That's also why I am interested in a more advanced solution, because current firmware for LCD3 sends now like 3x more the data of original firmware and I am getting corrupted data on LCD3, just sometimes and the result is very strange for the user. I am using checksum but I think I will quickly try to use the CRC16 from that implementation of modbus.
I added CRC16 and went to test with a few rides - now I don't get corrupted data on LCD3 (I mean, it should be ignored and LCD3 is working very well as expected).
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, please 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: 904
Joined: Aug 02 2017 2:56pm

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

Post by stancecoke » Jul 26 2018 4:19am

geofft wrote:
Jul 25 2018 12:13pm
On a slightly different topic, my entry to the world of torque sensors hasn't begun too well. ... all seemed ok except the actual torque sensor (white wire) output. ... outputs a constant 3.02v at rest and doesn't vary with load.
Looking at your photos, it seems to be a Sempu, 2. generation. I had problems with mine, too. There was a bad soldered wire, that I had to fix at a brand new device :shock:

Buying at aliexpress involves a certain risk, at least the seller gave me some discount on my next order.

regards
stancecoke
Sempu wire not soldered properly.jpg

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Jul 26 2018 5:31am

stancecoke wrote:
Jul 26 2018 4:19am
geofft wrote:
Jul 25 2018 12:13pm
On a slightly different topic, my entry to the world of torque sensors hasn't begun too well. ... all seemed ok except the actual torque sensor (white wire) output. ... outputs a constant 3.02v at rest and doesn't vary with load.
Looking at your photos, it seems to be a Sempu, 2. generation. I had problems with mine, too. There was a bad soldered wire, that I had to fix at a brand new device :shock:

Buying at aliexpress involves a certain risk, at least the seller gave me some discount on my next order.
I've been pretty lucky with Aliexpress stuff in the past, this is the first time I've had a real problem. Unsurprisingly, no reply from seller as yet, will probably end up having to pull it apart, maybe I'll get lucky too..
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

casainho   100 MW

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

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

Post by casainho » Jul 26 2018 9:18am

To let you guys know that I went further on LCD3 (now I used CRC16 for LCD communication and it seems I have no more issues of corrupted data!!):
casainho wrote:
Jul 26 2018 8:58am
I implemented a new configuration menu where now user can:
1. define on LCD the battery numbers of cells (used only to calculate battery state of charge to indicate on LCD battery bars)
2. define on LCD the battery low cut-off voltage

Configuration menu:
1: battery
__0: battery cells number: this value is used only to calculate battery state of charge to indicate on LCD battery bars symbols. For 48V battery, use value of 13.
__1: battery max current: in amps. Motor controller will use no more than this value. Motor controller firmware limits this value to a safe one, like 18 amps (but this can be configured on motor controller firmware, like for use 24 amps).
__2: battery low cut-off voltage: in volts. The motor controller firmware will limit battery discharge when the battery discharge down to this value. For a 48V battery, if each cells low cut-off voltage is 3.0V, you can use the value of 39.0 (3.0 * 13 = 39.0).

Full documentation here: https://github.com/OpenSource-EBike-fir ... -firmwares

See the video for exemplification:
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, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Jul 27 2018 9:26am

@stancecoke, I thought I had this speedometer stuff all worked out............but it seems not.

I am now using the internally fitted sensor with 'External' selected in the configurator. This sensor outputs 1 pulse per revolution. Whilst coasting with no motor drive this now works ok and gives an accurate, steady reading.

The problem arises when the motor is energised (pas or throttle) when the speedo readout immediately races up to the maximum displayable. No alternative setting for 'Wheel circumference', 'Gear ratio' or P2 seems to have any effect on this. I'm probably doing something dumb but I've run out of things to try, any ideas?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Jul 27 2018 9:37am

geofft wrote:
Jul 27 2018 9:26am
I'm probably doing something dumb but I've run out of things to try, any ideas?
I fear there is too much noise on the signal when the motor is running. You can try to fit a split ferrite to the wire next to the controller. I could filter the signal by software, but to be honest, I have no desire to do that :wink:
Image

You can try a normal speedometer sensor also.

regards
stancecoke

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Jul 27 2018 9:58am

stancecoke wrote:
Jul 27 2018 9:37am
geofft wrote:
Jul 27 2018 9:26am
I'm probably doing something dumb but I've run out of things to try, any ideas?
I fear there is too much noise on the signal when the motor is running. You can try to fit a split ferrite to the wire next to the controller. I could filter the signal by software, but to be honest, I have no desire to do that :wink:
Ok, thanks, that sounds like a very likely explanation.

I think I'll just get an external sensor and give that a try sometime.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

apple2   1 µW

1 µW
Posts: 3
Joined: Mar 28 2016 8:08am

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

Post by apple2 » Jul 27 2018 3:19pm

I have tried to run my motor today - 48v 1000w DD off ebay.
Used the stancecoke firmware off github and managed to compile and flash fine.
Hall and phase wires confirmed to work fine with the stock firmware beforehand.
Controller is 72v 3000w 18fet.
The problem is it runs rough and takes a lot of current.
I tried changing MOTOR_ROTOR_DELTA_PHASE_ANGLE_RIGHT to 250, 220, 180, 100 but I didn't notice much difference.
Initially I used a DC-DC supply because its current limited but when it starts rotating the voltage drops and I see "Low Voltage!" error in the serial stream. Then tried 18s lipo with a 3A fuse and limited "ui16_setpoint" to 25max value. The motor rotates slowly and doesn't blow the fuse.
Has anybody tried running this on 48v 1000w ebay motor or the 18fet controller?
Which parameters should I try to optimise? I have access to an oscilloscope if needed.

Demion   10 µW

10 µW
Posts: 6
Joined: Jun 10 2018 3:42am

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

Post by Demion » Jul 27 2018 8:28pm

Sorry, if not exactly on topic.
I have KT48ZWSRMT-LCD-C&D and LED 880. Between LED and controller I connected arduino.
Protocol controller -> LCD (LED) is same, except there is no last 3 bytes (no moving mode, current, temperature);
Protocol LCD (LED) -> controller is same, except 7 bytes and last byte 0x0E (no C settings);
[0] 0C [1] 03 [2] F5 [3] 56 [4] 28 [5] 88 [6] 0E
I tried send LCD3 format, but controller does not answer.
I want to make my own "LCD" on arduino to be able change controller settings and display data over wifi (esp8266).

Update: after using search I guess this is different controller (with no current / temp sensors, as I understand), and sorted out protocol (it is the same, but not complete).

Update2: Code is working fine now with LCD3 protocol (full) as well. Seems like I messed something up first time. Might be useful for someone. By the way controller is sending current (not sure if it is correct) and last rx 2 bytes are 0x80 and 0x23 not 0x00 for my controller.
[+] code

Code: Select all

txBuffer[0] = P5;
txBuffer[1] = assistLevel & 0x07;
txBuffer[2] = (((maxSpeed - 10) << 3) & 0xF8) | ((wheelSize >> 2) & 0x07);
txBuffer[4] = ((wheelSize << 6) & 0xC0) | ((maxSpeed - 10) & 0x20) | (P2 & 0x07) | ((P3 << 3) & 0x08) | ((P4 << 4) & 0x10);
txBuffer[3] = P1;
txBuffer[6] = (C2 & 0x07) | ((C1 << 3) & 0x38);
txBuffer[7] = (C5 & 0x0F) | ((C14 << 5) & 0x60);
txBuffer[8] = (C4 << 5) & 0xE0;
txBuffer[9] = C12 & 0x0F;
txBuffer[10] = (C13 << 2) & 0x1C;
txBuffer[11] = 0x32;
txBuffer[12] = 0x0E;

txBuffer[5] = 0;
      
uint8_t crc = 0x02;
      
for (int i = 0; i < 13; ++i)
	crc ^= txBuffer[i];
      
txBuffer[5] = crc;
      
for (int i = 0; i < 13; ++i)
	txSerial.write(txBuffer[i]);
          
batteryLevel = rxBuffer[1];
controllerVoltage = rxBuffer[2];
wheelPeriod = rxBuffer[3] * 256 + rxBuffer[4];
errorCode = rxBuffer[5];
movingMode = rxBuffer[7];
current = rxBuffer[8] * 4;
temperature = (int8_t) rxBuffer[9] + 15;

User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Jul 28 2018 2:19am

apple2 wrote:
Jul 27 2018 3:19pm

Hall and phase wires confirmed to work fine with the stock firmware beforehand.
...
The problem is it runs rough and takes a lot of current.
That was my latest experience, too. You have to swap the wires againg, to make the motor run properly. I added this hint in the FAQ and the tutorial some time ago.
Please make sure to find out the correct phase and Hall sensor assignment on the complete system with the original firmware before deleting. This makes sure, that the controller and the motor work together in principle. Still it can be necessary to swap the wires after flashing the firmware to a different combination. If the motor doesn't start properly with the custom firmware (turns not or only very slowly with noise and high current) try to find the right combination by trial and error.
Please try again to find the right wire assignment!

Good luck!

stancecoke

casainho   100 MW

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

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

Post by casainho » Jul 28 2018 7:34pm

I hope I can use your solution for reading motor temperature and limit it. I just burned my TSDZ2 motor/desmagentized loose torque forever:
casainho wrote:
Jul 28 2018 7:05pm
My motor did BURN
eyebyesickle wrote:
Jul 28 2018 2:45pm
casainho wrote:
Jul 28 2018 2:36pm
For the guys that got theirs motors to much hot up to the point that the motor stops for some minutes, did you found after that your motor did loose for ever torque??
No, in my experience if the motor cuts off due to high temps it comes back fine...
So, yesterday I got for the first time the high temperature cut-off of the motor while I was trying to discharge fully my battery and fast so the motor current was almost always over 15 amps.
Today I went to do another battery pack fully discharged and I noted that my motor was asking the same power as 900 watts but it was lacking some force/torque!! After some comparison with other ebike running with same TSDZ2, I found that my motor wasn't working properly and so I decided to open it:

Image

Image

So as we can see, some of the motor phase wires insulation seems that got very hot as also the motor metal parts are clear with a more dark/brown color. I would say the temperature was at least 100 degrees. And I think the magnets inside that motor did suffer some expressive demagnetization and so the loss of the motor torque forever. Here what I found only about this subject:
The Curie temperature of high-grade Neodymium (with added terbium and dysprosium) is 320C / 600F. However, common neo magnets are made from the cheapest grade, and can start to lose some of their magnetism at around 80C (170F).

E-bike motor magnets are a grade that is slightly higher than the cheapest variety, because they are often subjected to higher temps than they should be by unsuspecting customers. Years of posted experiments by real E-bikers on endless-sphere have produced a commonly held rule-of-thumb to avoid heating your E-bike motor to above 95C (200F).
https://www.electricbike.com/motor-tech ... ms-part-1/

Next I went and exchanged the motor for a new one I had in stock and I got back the full torque of TSDZ2!!!!

So, my question is: how can we avoid motor heating TSDZ2 motor over like 80C to avoid losing forever motor torque/demagnetize the motor magnets??
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, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

-dg   1 kW

1 kW
Posts: 454
Joined: Jun 01 2012 4:38am
Location: Oakland, CA USA

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

Post by -dg » Jul 28 2018 9:16pm

casainho wrote:
Jul 25 2018 1:31pm
I added CRC16 and went to test with a few rides - now I don't get corrupted data on LCD3 (I mean, it should be ignored and LCD3 is working very well as expected).
Interesting. Could you do an experiment? Create a variable to count total packets and error packet and then try different bit rates?

In other news, I have got the stancecoke tree to build although without debug info. And I have set up to flash the stm8 mini dev board. Some issues as while it appeared to flash the code (not mine yet) is not communicating back. I think this may be my serial hardware, so I'll try some other things this weekend. Once I've got this working I'll take a shot at adding the header to a controller.
If simplicity worked, the world would be overrun with insects.

User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Jul 29 2018 3:41am

-dg wrote:
Jul 28 2018 9:16pm
In other news, I have got the stancecoke tree to build although without debug info.
You can try the 3.7.1 sdcc release, with windows, it builds our firmware even with debug infos.
https://sourceforge.net/projects/sdcc/f ... ot_builds/

regards
stancecoke

-dg   1 kW

1 kW
Posts: 454
Joined: Jun 01 2012 4:38am
Location: Oakland, CA USA

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

Post by -dg » Jul 29 2018 3:52am

stancecoke wrote:
Jul 29 2018 3:41am
You can try the 3.7.1 sdcc release, with windows, it builds our firmware even with debug infos.
https://sourceforge.net/projects/sdcc/f ... ot_builds/
I would rather fix sdcc all by myself than use windows. I've been using GNU/Linux since 1994 and other Unixes since 1988.

Besides which I tried it even with the latest nightly snapshot of sdcc and it was the same. Sdcc developer replied to my bug that it was generating bad debug info. Hmmm, does windows use a different debug info format?

I'm still looking at some other stuff but will have time later this week to investigate this. I'll try to just chop out parts until I get a small test case for the sdcc devs.It's curious that it builds casainhos repos without trouble. Maybe there is something different in yours that it gets wrong.
If simplicity worked, the world would be overrun with insects.

User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Jul 29 2018 5:03am

Oh, sorry for the confusion. I just tried it with my recent fork. It doesn't compile with debug info. I tried with casainhos TSDZ2 code,that worked. So no difference between windows and linux behavior.

But I think Casainho gave the important hint already:
casainho wrote:
Jul 24 2018 7:05am
There is an important issue: we can't use static variables with initial values, liker 5 for instance, other way compilation fails. Because of this I am using a lot of global variables and this makes the code hard to read/understand.
regards
stancecoke

-dg   1 kW

1 kW
Posts: 454
Joined: Jun 01 2012 4:38am
Location: Oakland, CA USA

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

Post by -dg » Jul 30 2018 7:52am

stancecoke wrote:
Jul 29 2018 5:03am
Oh, sorry for the confusion. I just tried it with my recent fork. It doesn't compile with debug info. I tried with casainhos TSDZ2 code,that worked. So no difference between windows and linux behavior.

But I think Casainho gave the important hint already:
casainho wrote:
Jul 24 2018 7:05am
There is an important issue: we can't use static variables with initial values, liker 5 for instance, other way compilation fails. Because of this I am using a lot of global variables and this makes the code hard to read/understand.
Thanks for the update. Good to know it's not a windows vs linux issue. I'll have more time to look at this later this week. I have got flashing my stm8s minimal dev board working. Now I need to see how to debug.

I'm not sure about the statics thing being the cause, but it's certainly worth testing. I'll check that out.
If simplicity worked, the world would be overrun with insects.


Mavabo   10 µW

10 µW
Posts: 5
Joined: Jun 24 2018 10:57am
Location: The Netherlands

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

Post by Mavabo » Jul 31 2018 3:33pm

Hello Stancecoke, you wrote:
Please try the older commit:
https://github.com/stancecoke/BMSBatter ... a40e4b.zip

I have to check it in THROTTLE_AND_PAS mode in the recent code.
I did what you suggested but this older commit didn't give me any support at all! So I downloaded the latest commit (changed 15 hours ago)
and now my digital brake is constant on until I switch it off in the configurator. My Cadillac doesn't run anymore. Should I change something in my config.h?
config.h
(1.08 KiB) Downloaded 13 times

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Jul 31 2018 5:36pm

I'm also getting the issue of the bike pushing forward slightly when at rest with the Torque simulation mode.
Seems to be worse at initial switch on, strangely the problem seems to correct after it's been ridden for a while. You have to be careful pushing backwards at switch on too, this occasionally causes the motor to drive forwards quite strongly.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Aug 01 2018 1:27am

Mavabo wrote:
Jul 31 2018 3:33pm
and now my digital brake is constant on until I switch it off in the configurator.
What do you mean with "contant on"??? You should set the phase current to a much higher value, like geofft did. And test in "Throttle" mode first, to avoid faults of PAS or direction detection.

geofft wrote:
Jul 31 2018 5:36pm
I'm also getting the issue of the bike pushing forward slightly when at rest with the Torque simulation mode.
We could put a higher offset to the auto-zero-value, but then a direct drive will brake a little if it should coast. It would be great, if one of you could try the USB-UART-Converter to have a look at the parameters at runtime in diagnostics mode.
Without that I have no chance to see what's going on in your controllers...

regards
stancecoke

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Aug 01 2018 2:54am

stancecoke wrote:
Aug 01 2018 1:27am

geofft wrote:
Jul 31 2018 5:36pm
I'm also getting the issue of the bike pushing forward slightly when at rest with the Torque simulation mode.
We could put a higher offset to the auto-zero-value, but then a direct drive will brake a little if it should coast. It would be great, if one of you could try the USB-UART-Converter to have a look at the parameters at runtime in diagnostics mode.
Without that I have no chance to see what's going on in your controllers...
Ok, I'm happy to do that, will get one ordered. You'll probably have to give me a little instruction on how to connect/operate it though, I don't think I'm clever enough to work it out for myself... :(

In the meantime is there something within the code that maybe we can change to play with the auto-zero?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

geofft   1 kW

1 kW
Posts: 323
Joined: Nov 09 2012 9:41am
Location: Berkshire UK

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

Post by geofft » Aug 01 2018 3:22am

Looking at the converter you linked to here:-

https://www.ebay.com/itm/USB-To-RS232-T ... -uart.TRS0

....it seems that there maybe some problems using this with the latest win 10 drivers. The advice (for win 10) seems to be use one of these instead:-

https://www.ebay.co.uk/itm/1PCS-6Pin-FT ... SwYHxWQubk

...would that be ok for our purposes?
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

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

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

Post by stancecoke » Aug 01 2018 3:55am

geofft wrote:
Aug 01 2018 2:54am
Ok, I'm happy to do that, will get one ordered. You'll probably have to give me a little instruction on how to connect/operate it though, I don't think I'm clever enough to work it out for myself... :(
I will write a tutorial for both, USB-UART converter with PC/Laptop and BT-Module with smartphone...
geofft wrote:
Aug 01 2018 2:54am
In the meantime is there something within the code that maybe we can change to play with the auto-zero?
It's the adc_init procedure in the adc.c

Code: Select all

  ui16_current_cal_b >>= 4;
  ui16_current_cal_b -= 1;
  printf("ui16_current_cal_b = %d\r\n", ui16_current_cal_b);
You can try

Code: Select all

  ui16_current_cal_b -= 3;
or even more than 3 to avoid the motor pushing slightly at standstill.
geofft wrote:
Aug 01 2018 3:22am
https://www.ebay.co.uk/itm/1PCS-6Pin-FT ... SwYHxWQubk

...would that be ok for our purposes?
Yes, that should work also.
You can think about using the BT-module/Smartphone for logging, this has the advantage, that you get data from real rides. With PC/Laptop it's more difficult....

regards
stancecoke

Post Reply