Page 139 of 169

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

Posted: Mar 26 2019 10:34am
by stancecoke
casainho wrote:
Mar 26 2019 9:48am
Don't you guys want to help develop the firmware for SW102 Bluetooth graphic LCD
I still admire your ambition when it comes to displays. I just find it boring, I don't want to have any frills on the handlebars. :-)
Perhaps, Xnyle is interested...

regards
stancecoke

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

Posted: Mar 26 2019 10:53am
by casainho
stancecoke wrote:
Mar 26 2019 10:34am
casainho wrote:
Mar 26 2019 9:48am
Don't you guys want to help develop the firmware for SW102 Bluetooth graphic LCD
I still admire your ambition when it comes to displays. I just find it boring, I don't want to have any frills on the handlebars. :-)
Perhaps, Xnyle is interested...
That one is ver small and has the Bluetooth. With the Bluetooth chip it has, should be able to communicate wit mobile app AND the smart bms that also has Bluetooth, so we could integrate the bms on the system.

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

Posted: Mar 29 2019 4:35pm
by Xnyle
There are some new features in development / beta:

The first is a new option:
Idle disables offroad (60s)

Function should be clear, disables after 60 sec without wheel rotation!

The second feature is a passcode:

There is a new virtual switch in the controller. This switch can currently only be seen in the app in the left-hand debug panel, it's called lockStatus. 255 is the value when the controller is locked, the actual function - to prevent power output - is still disconnected, as long as the feature is in beta. Not that anyone gets stranded.

It works like this:

In the app you can set a 4 digit passcode.
1000 means that the protection is off, that is the default value.
Every other value is written to the EEPROM
Every now and then the app sends this value to the controller.
If the controller has not heard anything in 60 seconds -> lockStatus 255, controller locked.

Of course, you can only change the value if the app has previously sent the correct value and therefore has unlocked the controller, so you have to set the old value correctly in the app, wait a bit, then you can change it (because then the controller is unlocked ofc)

If you have forgotten the code, you can only flash again and wipe the eeprom (checkbox in the Java Tool)

This is of course not cryptographically hardened, you can also hack and try all 9k combinations.

The third feature is a GPS based Hill Climb Assist:

Can be set in the app (Hill climb assist factor).
Of course, GPS must be enabled (another app setting)
The value is +% / dm / s.
Meaning the app adds X% additional power per dm / s vertical speed (positive)
Of course, 100% is the maximum, it won't fly ;-)
Since GPS is pretty noisy for altitude determination, the value is slightly smoothed, so it takes a couple of meters to kick in.

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

Posted: Mar 30 2019 10:51am
by gutyex
I have an S06S flashed with this firmware, and when I turn on the kit, the motor starts going at a moderate speed and doesn't stop until it's turned off again. I have attached the settings file that I'm using.

The attached hardware is:
KT-LCD1
PAS Sensor
Q100H Motor

The display works fine, but no setting I change on it has any effect on the behaviour of the kit.

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

Posted: Apr 01 2019 4:44am
by Xnyle
I hope you do not seriously expect anyone to do the debugging for you.

You can use the app or diagnostics mode to see what's going on.

Read the Wiki about that (mode) and probably throttle calibration, if that doesn't help, show at least some effort and write us what the PAS is doing, what the current calibration is, the current target, setpoint state and so on.

Sorry for being that harsh (or rather not :), but this is a hobbyists and not a commercial project where you just shout "doesn't work" at some poor customer support representative.

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

Posted: Apr 01 2019 12:53pm
by gutyex
Xnyle wrote:
Apr 01 2019 4:44am
I hope you do not seriously expect anyone to do the debugging for you.
Hardly, and I think it's an unreasonable leap to make that assumption from my post.

I've run into an issue that I couldn't find a previous example of when searching the thread, so I posted basic information about my setup to see if anyone could point me in the direction of where to look next.

If people are going to jump down the throat of anyone who needs help but doesn't know where to start trying to help themselves, perhaps a stickied post setting out the minimum information level required for effective troubleshooting could save everyone's blood pressure. The documentation for this being spread across at least 3 different places doesn't help matters much, either.

I'll dig out the necessary hardware and see if I can get the diagnostic output from the controller.

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

Posted: Apr 02 2019 2:24am
by stancecoke
gutyex wrote:
Apr 01 2019 12:53pm
I'll dig out the necessary hardware and see if I can get the diagnostic output from the controller.
I try to add all issues, that are reported more than one time, to the FAQs at github.
You can add your findings there, too. Everybody with a github-account can edit the Wiki.

regards
stancecoke

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

Posted: Apr 02 2019 2:48am
by casainho
stancecoke wrote:
Apr 02 2019 2:24am
gutyex wrote:
Apr 01 2019 12:53pm
I'll dig out the necessary hardware and see if I can get the diagnostic output from the controller.
I try to add all issues, that are reported more than one time, to the FAQs at github.
You can add your findings there, too. Everybody with a github-account can edit the Wiki.
I understand the reaction of Xnyle. I also feel like that and I usually simple do not answer because I do not feel the obligation to do it. I think users should help themselves.

And I try to do the same Stancecoke says, update the wiki.

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

Posted: Apr 04 2019 5:16pm
by vulcanears
How loud is a motor with the custom firmware FOC, compared to decent commercial options like Lishui or Phaserunner? Are they comparable?

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

Posted: Apr 05 2019 3:43pm
by Xnyle
@everyone who is using this FW:

It would be nice if you could send me your proven settings based on the current version of the Java tool so that I can add them to the repo.

Please select a filename that contains controller type, system voltage, wheelsize and motortype

You can also add a pull request on github ofc.

Thanks!

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

Posted: Apr 06 2019 6:42am
by geofft
Xnyle wrote:
Apr 05 2019 3:43pm
@everyone who is using this FW:

It would be nice if you could send me your proven settings based on the current version of the Java tool so that I can add them to the repo.

Please select a filename that contains controller type, system voltage, wheelsize and motortype

You can also add a pull request on github ofc.

Thanks!
Current torquesensor settings:-
TQSR,KT36-48svpr,12s,26inch,Q128h.ini
(259 Bytes) Downloaded 45 times
....I also set 'TQ calib' to 1500. For some reason this doesn't seem to restore from the .ini file and defaults to 1000.

My previous THR-PAS settings:-
THR-PAS,KT36-48svpr,12s,26inch,Q128h.ini
(264 Bytes) Downloaded 54 times

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

Posted: Apr 06 2019 12:40pm
by kkm
gutyex wrote:
Mar 30 2019 10:51am
I have an S06S flashed with this firmware, and when I turn on the kit, the motor starts going at a moderate speed and doesn't stop until it's turned off again.
I finished my experiments with the firmware because of the behavior of the thumb throttle that does not suit me, as I wrote above, and returned to the stock firmware (on another controller).
But today my friend got the built-in (for hailong battery case) controller board KTE-9S5-J5 from ebikekit.kom, and asked me to solder the connector for programming.
IMG_0053.JPG
Waterproof compound is very soft, and the contacts are easily released from it with an ordinary wooden toothpick.
The good news is that the firmware has been launched and is working on this controller. The power supply of the throttle hall sensor on this controller is higher than usual (4.9 volts) and the desired "Throttle min" value is 47-49, otherwise the motor slowly rotates when power on. This is normal and logical.
The bad news is that even with the “Throttle min” 100-180, the motor starts to rotate when turned on and makes 0.5 turns without load, or more than 30 on load, ( if you hold the motor with your hand when turned on). I am at a loss - why turn on PWM, if the value of "trottle min" guaranteed below the minimum?! Checked twice... No PAS or TQS connected - only thumb throttle (without throttle - same behavior). MXUS XF15 gear motor.
This happened on the latest firmware (masher branch).
Fortunately, I had in the archive firmware from October last year with the last commit "Added Tool for State translation stancecoke committed Oct 23, 2018" - and with this firmware, the motor makes only 1/16 turn at a very low power, then stop (or slightly hold it with your hand and the motor will not start to rotate) and does not rotate on an ebike installed in the wheel.
As I know - on the forum there are users of such controllers on the factory firmware, pay attention to this problem.
By the way, the correct value of the "Battery current Cal a" is 100 for this controller, as well as for 6Fet controllers.

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

Posted: Apr 06 2019 2:27pm
by geofft
kkm wrote:
Apr 06 2019 12:40pm
gutyex wrote:
Mar 30 2019 10:51am
I have an S06S flashed with this firmware, and when I turn on the kit, the motor starts going at a moderate speed and doesn't stop until it's turned off again.
Whenever I've had this issue I've usually managed to fix it by making an adjustment to the zero point - this was using stancecoke's advice, I think there may be some reference to it many pages back in this topic.

About halfway down the file adc.c you'll find the line:-

ui16_current_cal_b -= 1;

...try changing the '1' at the end to a higher number maybe 2-4 or possibly even higher. This has always done the trick for me, your problem may be elsewhere of course, but possibly worth a try...

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

Posted: Apr 06 2019 3:56pm
by Xnyle
....I also set 'TQ calib' to 1500. For some reason this doesn't seem to restore from the .ini file and defaults to 1000.
Fixed.
...throttle - same behavior). MXUS XF15 gear motor.
XF15 probably not the problem, working fine with current FW and a 12FET controller (yes I know total overkill but it's what I had lying around :)
ui16_current_cal_b -= 1;
If this turns out to be the problem on 6FET controllers I should make that a configurable option as well.

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

Posted: Apr 09 2019 2:08am
by Valopallo
I'm building a 2wd e-bike. For the rear motor I have S06S and for the front motor I have KT36ZWS. Both systems have individual batteries(36V) but share the signals of throttle, PAS and brakes. I'm using either two individual HC-05 bluetooth modules or just a single one with a manual dipswitch to change the RX and TX terminals of the module when needed and don't want to use any LCDs. This way I can operate both controllers by BluOSEC -app.

I also need to shut down the system's both controllers to reset the offroad mode fast and would like to use only one switch for both. I have already mounted the main switch that connects the blue and red of the s06s to the body of my battery holder and now I'm wondering could I use the same switch to power on/off both of the controllers?

TL;DR: Can I safely connect both reds and both blues of the controllers to the same manual switch or am I definitely going to burn something up if I do this?

Another question: KT36ZWS has this unknown red and black wire. If it has 5V output, could I use that safely to power the HC-05 module or should the power come always from the red terminal of the main harness with a DC-DC reg?

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

Posted: Apr 09 2019 5:02pm
by Xnyle
No, please don't do that. It's clearly stated in the wiki as well. For every additional watt you pull out of the 5V rail the linear voltage regulator inside the controller has to !burn! ~5 watts (depending what kind of resistor the poor chinese guy had at hand botching together your very controller :) On top of that there is also a high chance you get all sorts of weird bugs because of voltage drops (I tried to isolate software bugs last year which turned out to be hardware bugs because I connected the BT module where it wasn't supposed to be connected.

Use a cheap xl7015 based buck converter and everything will be fine.

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

Posted: Apr 10 2019 10:54pm
by Valopallo
Xnyle wrote:
Apr 09 2019 5:02pm
No, please don't do that. It's clearly stated in the wiki as well. For every additional watt you pull out of the 5V rail the linear voltage regulator inside the controller has to !burn! ~5 watts (depending what kind of resistor the poor chinese guy had at hand botching together your very controller :) On top of that there is also a high chance you get all sorts of weird bugs because of voltage drops (I tried to isolate software bugs last year which turned out to be hardware bugs because I connected the BT module where it wasn't supposed to be connected.

Use a cheap xl7015 based buck converter and everything will be fine.
Ok. I have a spare LM2596 module laying around for the bluetooth so that's not a big problem. How about my other question; is it ok to connect the reds and blues of both controllers to the same on/off switch? Would that mean that the red 36V rails become parallel and don't add up the voltage or do they? And if the blue wires are only getting the 36V signal it would not matter where it comes from, right?

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

Posted: Apr 11 2019 1:54am
by Valopallo
How can I set throttle to 0km/h when NOT in Offroad -mode? The bluosec -app's minimum is 1km/h. Update maybe?

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

Posted: Apr 11 2019 3:19am
by Xnyle
No update, technical restriction on how "not set" == 0 is handled in eeprom settings. I see no practical use case where 1km/h is a problem that would justify a complete refactoring.

.. although 255 == "not set" might have been a better choice, but as written, no incentive to change that now that everything is working.

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

Posted: Apr 11 2019 3:24am
by Valopallo
Xnyle wrote:
Apr 11 2019 3:19am
No update, technical restriction on how "not set" == 0 is handled in eeprom settings. I see no practical use case where 1km/h is a problem that would justify a complete refactoring.
So I have to use the Java tool and put 0 to the "Without PAS" -section, flash again and I'm set?

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

Posted: Apr 11 2019 3:44am
by vulcanears
So which one of the torque sensors on Aliexpress would you recommend for use with the Open Source controller? The Sempu T4? The Eunorau type?

thx in advance

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

Posted: Apr 11 2019 3:56am
by Xnyle
BTW in Torquesensor mode 0 will cause a division by zero, as the Java tool doesn't check anything anyway, it's your responsibility not to enter 0 there :)

Code: Select all

float_temp *= (1 - (float) ui16_virtual_erps_speed / 2 / (float) (ui16_speed_kph_to_erps_ratio * ((float) ui8_speedlimit_kph))); //ramp down linear with speed. Risk: Value is getting negative if speed>2*speedlimit
Apart from that It currently doesn't really matter anyway, as power gets cut off only after you reach the limit, so power is applied at first anyway.

See latest commit for a workaround

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

Posted: Apr 11 2019 10:07am
by geofft
vulcanears wrote:
Apr 11 2019 3:44am
So which one of the torque sensors on Aliexpress would you recommend for use with the Open Source controller? The Sempu T4? The Eunorau type?

thx in advance
I'm using the Sempu T4 with stancecoke's firmware, this works just fine for me. Don't bother with the T2 type, these give an output with any pressure on the pedals, this gets to be annoying very quickly.... :shock:

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

Posted: Apr 11 2019 10:20am
by stancecoke
Yes, the Sempu T4 is the better choice. My experience with the Bafang sensor (eunorau) is very bad, see the german forum:

https://www.pedelecforum.de/forum/index ... sor.56636/

regards
stancecoke

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

Posted: Apr 13 2019 1:43pm
by geofft
I've just tried out the current github download, maybe I should mention that there seems to be some problem.

Some of the 'Proven settings' seem to build and flash ok, others don't. Neither of the proven settings provided by myself will flash and there appears to be an error during the build that will make more sense to you than it does to me... :wink:

I've attached the cmd dump.

Edit to add: I'm using SDCC3.7.2 - I can see there is a newer version, maybe this is my problem?