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

jm1090 said:
Quick question... :)

I am trying to test the 72v controller (56-90VDC) flashed with the open firmware with a 48v battery, but nothing happens.

Still, in the parameter configurator, I put 0 and 255 for low and high voltage cutoffs, so I should not be bothered by any LVC...

Is there a hard LVC inside the controller that needs to be modified in order to use lower than 56V battery voltage ?

Thanks !!

Problem solved, I removed the two LVC resistors of the 72v controller (1.5k and 39k) and replaced them with the LVC resistors that are on the 48v controller (1.2k and 15k). See page 180 for pictures of LVC resistors of each version.

So, there is indeed a hard LVC that the low and high voltage parameters in the software cannot bypass.

Now that I have modified it for 48v battery, I may not be able to boot with 84v battery if these resistors also operate a high voltage cutoff...
 
jm1090 said:
jm1090 said:
Quick question... :)

I am trying to test the 72v controller (56-90VDC) flashed with the open firmware with a 48v battery, but nothing happens.

Still, in the parameter configurator, I put 0 and 255 for low and high voltage cutoffs, so I should not be bothered by any LVC...

Is there a hard LVC inside the controller that needs to be modified in order to use lower than 56V battery voltage ?

Thanks !!

Problem solved, I removed the two LVC resistors of the 72v controller (1.5k and 39k) and replaced them with the LVC resistors that are on the 48v controller (1.2k and 15k). See page 180 for pictures of LVC resistors of each version.

So, there is indeed a hard LVC that the low and high voltage parameters in the software cannot bypass.

Now that I have modified it for 48v battery, I may not be able to boot with 84v battery if these resistors also operate a high voltage cutoff...

Yep, sorry I missed your comment. Maybe some sort of compromise would be possible with those values, by slightly decalibrating voltage reading, so that both systems are compatible?
Turns out I might be in the same bucket soon, the motor I got has very low Kv, I can only get decent speed by bumping the voltage to 72V through additional battery in series, but hard LVC would make the failover to 54V impossible

BTW open question, by raising Gain I, the throttle lag I was experiencing earlier can be almost entirely eliminated, but only at "high" values of 0.4-0.5. To prevent damage, what would be the recommended Gain P for that integral?
 
Hey everyone,

I'm finding myself a little stuck with this firmware. Not sure what i'm doing wrong at this point.

I have a kt48zws controller with a lcd3. Confirmed working before flashing. I finally got it to flash to the controller and I cannot get it to turn on now with the lcd3. I saw in the wiki about XOR checksums might be off. I have no idea how to check the lcd3 for these checksums. With running the wiki code here, do I need to connect the screen to my computer with a usb-uart device or is there some other process for checking the xor. Or is it something else I'm messing up on.

I've now tried to run diagnostics mode, which the utility says is flashing correctly onto the controller. I have a UART to usb connected correctly to the display but when I run Hterm I'm getting nothing when I connect. I have the drivers installed, its recognized as a device. I've set the the correct com port, and wired the TX,RX and GND pins from the display output on the KT to the UART and I've jumpered the other 2 pins on it. With all that connected and the battery plugged in, Its still not providing any data in Hterm. Is there something I'm missing? or is my controller just borked.

EDIT: Turns out the controller has a short somewhere that I can't identify. The second I connect power to the system my BMS goes into self protect because of it. There is continuity between the + and - leads but I can't see the source. But if anyone else has my issue that may be a source.
 
After burning the small hub in just over 2 hours of use I put in a much more solid bpm code 15. Completely satisfied, the bike has an exceptional response to the torque meter, hopefully it will last!
202225204126_bpmtorque.jpg
 
Hi, i would love to read your tutorial about this particular subjects:


Iambuilderman said:
....
- How to install buck converter
- How and when do you need to modify the LVC resistor
- How to convert 48v -> 72v
- How to calibrate voltage and current sensors and set up the parameters in the java configurator


...


Thank you!
 
Hello guys, and thanks for this great thread and work for an open source firmware.
I am trying to build a new ebike with the following setup:
- Bafang TQ sensor SR PA231.32.ST
- Bafang autoshift 2 speed (but TBH I have no clue how to use that with the KT controller)
- Throttle for a lazy mode
- 18 Mosfet KT controller
- dual 15s batteries in parallel (Max 63v)
- KT LCD3
- I have replaced the 2 resistors and 2 LM by a 15v bucket

I'm using the Torque from X4 fork of the GitHub.

I have few questions I would like to check with you guys.
1) The first strange behavior with the LCD was probably linked to the XOR checksum : display was not providing any useful infos.
Yet, I provide here some hints for other users but let me know if I didn't get the point. So I sniffed the Tx line from the LCD and got the following packets: (I just supposed that 0x0E was the terminal byte like other screens but I'm not sure actually) : 0x12,0x05, 0xF4, 0x5C, 0x20,0x5C,0x18,0xEA,0x04,0x14,0x01,0x32,0x0E. I run the tool in the wiki and got the output attached to this post. I just supposed that I have to select the ui8_j value where (ui8_crc^ui8_j) and ui8_rx_buffer[5] matches, therefore 28 but actually I have no clue here. I then added ((ui8_crc ^ 28) == ui8_rx_buffer [5]) in the display.c file and actually LCD then begins displaying stuff. So I guess that's fine.

2) I noticed a second strange behavior with the LCD : every time I plug the battery, display turns on. When I want to turn it off, I can using the switch but then when I want to turn it on again it doesn't work. However I have noticed that the throttle can work when the display is off. Any advise here ?

3) I followed the mapping of this https://www-pedelecforum-de.transla...l=auto&_x_tr_tl=fr&_x_tr_hl=fr&_x_tr_pto=wapp even if my colours where differents I used the pint numbers. Then made this wiring:

BB TQsr >>>>>>> KT controller
Pin 1 : GND >>>>>> GND black wire from the PAS plug
Pin 5 : 5V+ >>>>>> +5V brown wire from the PAS plug (actually it's more 4.5v but anyway)
Pin 3 : Torque >>>> X4 wire from the PCB
Pin 4 : PAS >>>>>>> PAS Yellow wire from the PAS plug

not sure it's really working actually but still need to investigate the option of the OSEC configurator. It seems that the wheel (in the air) tries to keep the same speed even when I stop pedaling, but I don't feel the acceleration of the motor speeding up when I pedal faster. Yet the thumb throttle works. Any advise here too?
 

Attachments

  • output C tool.rtf
    760 bytes · Views: 27
Hello, I can’t connect BluOSEC hc-05, debugging works, but the application does not see the data, what should I do, maybe the logical levels do not match?
 
I do not have a transistor near the UART bus, is it a logic inverter or a level converter?
 

Attachments

  • IMG_20220307_181617.jpg
    IMG_20220307_181617.jpg
    3 MB · Views: 1,120
  • IMG_20220307_181546.jpg
    IMG_20220307_181546.jpg
    3.7 MB · Views: 1,120
9600 is put in the terminal on android, I type text, Bluetooth via ftdi pc in the arduino console displays, sorry if the translation is wrong, I use a translator, I'm from Ukraine, and here is the war
 
BluOSEC mood controller, connect bluetooth hc-05 to rx tx and BluOSEC shows nothing and when I open bluterm this is what happens
 

Attachments

  • Screenshot_20220307_210430_es.pymasde.blueterm.jpg
    Screenshot_20220307_210430_es.pymasde.blueterm.jpg
    200.8 KB · Views: 1,106
Could someone please tell me whether engaging "offroad mode" disables the set speed limits for both PAS and throttle?

I know it disables the PAS speed limit, just couldn't see any mention of it also disabling the throttle limit.

(The regulations seem to force everyone into torque-based systems and/or handlebar displays, whereas all I want is a small hub motor on my single speed commuter bike to use on steep gradients, and the only way I can see to do that "legally" is with a throttle that reverts to 6km/h.)
 
glennb said:
Could someone please tell me whether engaging "offroad mode" disables the set speed limits for both PAS and throttle?

I know it disables the PAS speed limit, just couldn't see any mention of it also disabling the throttle limit.
I can confirm that 'Offroad mode' disables the (Without PAS) 6kph throttle limit but not completely sure about the upper limit - I'll make a note to check this next time I'm out for a ride.

EDIT to add:
Bear in mind that the 6kph limit only applies if you're not pedalling - in most real life circumstances you will be pedalling so it won't apply...:)
 
geofft said:
glennb said:
Could someone please tell me whether engaging "offroad mode" disables the set speed limits for both PAS and throttle?

I know it disables the PAS speed limit, just couldn't see any mention of it also disabling the throttle limit.
I can confirm that 'Offroad mode' disables the (Without PAS) 6kph throttle limit but not completely sure about the upper limit - I'll make a note to check this next time I'm out for a ride.

EDIT to add:
Bear in mind that the 6kph limit only applies if you're not pedalling - in most real life circumstances you will be pedalling so it won't apply...:)

If offroad mode is enabled, the speedlimit is set to 80 kmh in the code. So I think the "Offroad" box in the Osec parameter configurator does nothing.
 
OutsMarted said:
If offroad mode is enabled, the speedlimit is set to 80 kmh in the code. So I think the "Offroad" box in the Osec parameter configurator does nothing.

I'm actually referring to activating 'Offroad mode' by using the 'morse' code on the brake lever. This method is familiar to long term users of the firmware, but I realise it is not well documented and not all users may be aware of it. A search for 'Offroad' in this thread will bring up lots of results, Stancecoke also begins to describe the method back in the topic here:

https://endless-sphere.com/forums/viewtopic.php?f=30&t=87870&hilit=offroad&start=2550#p1388176

This method of activating definitely switches off the 6kph limit as already mentioned, I'm fairly sure it also raises the upper throttle limit but I need to test this to be completely sure.

I'm not sure what the 'Offroad' tick box in the configurator does, but from your comments it sound like it simply maxes out all the speed limits.
 
Thanks for the clarification.

Although, if I understood you correctly, with this firmware the throttle speed limit only applies when not pedalling?

That wouldn't comply in Australia, where the throttle must cut out at 6km/h regardless of pedalling. I thought Europe was the same.
 
glennb said:
Thanks for the clarification.

Although, if I understood you correctly, with this firmware the throttle speed limit only applies when not pedalling?

That wouldn't comply in Australia, where the throttle must cut out at 6km/h regardless of pedalling. I thought Europe was the same.

When you are pedalling and in the legal/not the offroad mode, the throttle will not increase your speed, it will give maximum assistance when activated, but when the speed reaches the speedlimit, the power is dialed back.
 
Thanks, now I think I fully understand how the speed limits apply.

So, would have to set the universal non-off-road speed limit to 6km/h to make it "legal".

That's fine with me, except that if the bike was ever inspected for whatever reason, the setup would appear highly irregular to whoever tests it when they find that PAS cuts out at 6km/h.
 
glennb said:
Thanks, now I think I fully understand how the speed limits apply.

So, would have to set the universal non-off-road speed limit to 6km/h to make it "legal".

That's fine with me, except that if the bike was ever inspected for whatever reason, the setup would appear highly irregular to whoever tests it when they find that PAS cuts out at 6km/h.

No the speed limit when pedaling (25kmh) can be different from the speed limit when only using throttle (6kmh).
Its just like you want it to be, throttle only to 6kmh, pas to 25kmh
 
glennb said:
Thanks for the clarification.

Although, if I understood you correctly, with this firmware the throttle speed limit only applies when not pedalling?

That wouldn't comply in Australia, where the throttle must cut out at 6km/h regardless of pedalling. I thought Europe was the same.

Current EU and UK law seems to be this:-

"From January 1 2016, the only throttles legal within the UK’s EAPC legislation are those that assist the rider without pedalling up to a maximum speed of 6 km/h (3.7 mph) – i.e. starting assistance only.

If the rider is rolling – but not pedalling – faster than 6km/h, the throttle cuts off. If the cyclist pedals at the same time then the throttle can still assist up to the general limit of 15.5mph."

...which is how this firmware currently operates. If this doesn't conform with Aussie regs I wouldn't think the code changes to achieve this would be too difficult. Unfortunately I'm no coder and Stancecoke is busy elsewhere and no longer supports this f/w. So, how are your coding skills..? :)
 
Yeah, possibly a simple code change. Not something I'd manage unassisted.

I still think the throttle should cut at 6km/h in on-road mode to be compliant, and it would be a worthwhile code change. There's plenty of webpages that explain the standard (EN 15194), but I can't find any that quote it, or any examples of commercial pedelecs from Europe that allow throttle beyond 6km/h. I think it's safer to assume that this is verboten.

It doesn't matter in the end, all DIY ebikes in Australia are non-compliant, because the limit on aftermarket motors here is 200w and there's no motors marked as 200w available for purchase. The best you can do is follow the spirit of the regulations by emulating a compliant European pedelec.

At least with this firmware it's possible to set the universal speed limit to 6km/h (for PAS and throttle) and override it with offroad mode. It'll be easier to explain to a police officer why the bike's PAS cuts out at 6km/h than why the throttle doesn't cut out at 6km/h, as in "Yeah, I tried making my own bike, but piece of crap chinese motor only goes 6km/h, I'm saving up to buy a proper ebike".
 
Hi, a friend of mine is attempting to replicate my successful attempt to use the torsometer.
Only in his case the engine starts slowly even without pedaling. If the level on the display increases, the engine speed increases.
It uses a 12t mac engine and the same ECU that I use, a pswpower.
What can cause the engine to start idle?
I read about a bug in current_cal_b but I'm not a programmer ...
Thank you
 
Og he is using a geared hub motor, try using the pwm off@coast option. It worked for me to solve the issue.
 
unfortunately my friend does not live near me, I can only report what he tells me ...
Today he tried the bike on road, at level 1 no assistance, at level 2 it starts by herself almost to the maximum :-( we don't understand each other anymore ..
 
Hi, I’ve been using this firmware (x4 branch) for over a year now for my daily commute (~35km per day) and I have to say it runs great with my setup, Q100CST, S06S, 36V, BluOSEC, throttle, PAS and another throttle on x4 for Regen (that I never got working for some reason). On my last ride I noticed, that’s the speed limits were „missing“, something that seems to happen on my controller from time to time, so I prepared to flash my controller again and while I was at it replaced my old, only with duckt tape working PAS for a new one. After flashing the controller I couldn’t get the bike to use the PAS (functionality, pinout checked) and the BluOSEC app crashes upon establishing a connection, it seems similar to the problem Ivan described some posts prior. After flashing a few times the Debug and BluOSEC, now no communication can be made over the serial interface…

Now my question, are the STM8s real STs or cheaper fakes, as this is the only way I can explain myself having to reflash when for example the speed error occurs?

Restarting only helps sometimes, and my programming skills are definitely no at this level to understand C the way casahino, stancecocke and xnyle do :?

In any case, thanks for alle the nice rides I had so far and hopefully will have, if someone understands a bit more than i do and needs any information about what exactly is happening i can give them logs/ the exact ini I’m using
 
Back
Top