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: 926
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 » Jun 22 2018 8:43am

casainho wrote:
Jun 22 2018 2:25am
But let's see if Stancecoke or others are able to help and improve on this.
So we should clean up the github repository and focus on one tutorial.
My suggestion:
1. Delete all branches except the master and the feature/offroad 5 Step
2. Set all tutorial links (in our signatures and in the first post of this thread) to the windows instructions. I can add a link to the detailed developer area there.
3. Update the first post of this thread with a sceenshot of the recent release of the OSEC tool.

regards
stancecoke

geofft   1 kW

1 kW
Posts: 324
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 » Jun 22 2018 2:22pm

stancecoke wrote:
Jun 21 2018 12:40pm
I've commented out the print commands now, please try again. If this doesn't work, I can't do any more, as I have no LCD3...
But even if this works, the power cut at the speed limit is not implemented in casainhos code yet. So the offroad mode will only work with P3=0.

regards
stancecoke
That works ok now, I find I can trigger the code at virtually every attempt. I guess it's not a rhythm you're likely to hit by accident, but no big deal if you do in reality.
Unfortunately P3=0 isn't really an option for me, so this seems to be as far as this feature will go - a real shame as this could have been a nice feature fully implemented with legal speed, wattage and throttle limits being applied. Hopefully casainho may find time in the future to implement this, but I realise he's heavily involved with other projects just now.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

-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 » Jun 22 2018 7:51pm

stancecoke wrote:
Jun 22 2018 8:43am
casainho wrote:
Jun 22 2018 2:25am
But let's see if Stancecoke or others are able to help and improve on this.
So we should clean up the github repository and focus on one tutorial.
My suggestion:
1. Delete all branches except the master and the feature/offroad 5 Step
2. Set all tutorial links (in our signatures and in the first post of this thread) to the windows instructions. I can add a link to the detailed developer area there.
3. Update the first post of this thread with a sceenshot of the recent release of the OSEC tool.
May I suggest that instead of maintaining a java tool and editing a header file that the configuration go in a text file with a fairly common format, perhaps just key=value pairs or a .INI file format. Then have a script to generate config.h from the file as part of the build process. This would let us extract just the configurable items into something with simpler syntax than a .h file. The generator script could check for missing items or logical conflicts too and provide more user friendly error messages.
If simplicity worked, the world would be overrun with insects.

DarkDD   100 µW

100 µW
Posts: 7
Joined: May 04 2018 11:26pm

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

Post by DarkDD » Jun 22 2018 11:10pm

stancecoke wrote:
Jun 22 2018 8:33am
DarkDD wrote:
Jun 22 2018 3:00am
Yes! you're right. I'm using SDCC 3.6.0. I can't seem to find a windows SDCC 3.7.0...
Please read the tutorial, there you will find the link to the precompiled windows files and the instruction how to install them. SDCC 3.7.0 is only available for 64bit systems with windows.

regards
stancecoke

Ended up using a snapshot version of their executable. They have those till 3.7.1 and it compiled beautifully!

Fiddling around with the settings now trying to get the motor to turn! I'm using just a throttle... Its drawing current but can't seem to get it to turn and returns error 6... Trying to figure out! Any Ideas?

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 23 2018 3:30am

geofft wrote:
Jun 22 2018 2:22pm
That works ok now, I find I can trigger the code at virtually every attempt.
Great! Thank you for testing!

DarkDD wrote:
Jun 22 2018 11:10pm
Ended up using a snapshot version of their executable.
Does that mean the linked release did not work for you?!
DarkDD wrote:
Jun 22 2018 11:10pm
Fiddling around with the settings now trying to get the motor to turn! I'm using just a throttle...
Have you checked the hall-sensor and motorphase wiring combination? Had you checked, that the motor runs properly with the stock firmware with that wiring?

regards
stancecoke
Last edited by stancecoke on Jun 23 2018 4:01am, edited 1 time in total.

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 23 2018 3:37am

-dg wrote:
Jun 22 2018 7:51pm
then have a script to generate config.h from the file as part of the build process.
This is exactly the job of the Java-tool, just with a graphic interface. Perhaps we should add the possibility to write the settings to a file and read it in again, to avoid to edit all the individual settings again, if you start the tool... But this needs a rainy day with nothing better to do :D

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 » Jun 23 2018 6:13am

stancecoke wrote:
Jun 23 2018 3:37am
This is exactly the job of the Java-tool, just with a graphic interface. Perhaps we should add the possibility to write the settings to a file and read it in again, to avoid to edit all the individual settings again, if you start the tool...
Well, I had in mind something different. The formatted text file would be the source of truth. Editing it would be the normal way to do configuration. The config.h generator script would merge the items from the file with a template config.h to create the actual header file. Tools that could read and write this file would be free to have special rules to do error checking, automation, layout etc, but should also be able to handle new keys sensibly by default. That is, it should not require a change to the generator script or the GUI to add an item for testing etc. This might make it easier for new people to try things.

I have some other ideas too. Of course in open source projects ideas are free and it is always easiest to ask the project maintainers to do the work ;-). I have just received a few STM8S Discovery boards with ST-Link2 and some minimal STM8 breakout boards and have a few KT controllers on the way as well as displays LED 3 and LED 5. Should arrive in a couple weeks. Once I have that all in hand I'll see if I can help out a bit.

One more idea: since the LCD display talks over a serial link, move some/all of the configuration to variables and have a simple protocol to read/write the config via the LCD cable instead of re-flashing the device. To keep the onboard code simple the config data would still be parsed and validated on the host laptop or whatever.
If simplicity worked, the world would be overrun with insects.

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 23 2018 7:27am

geofft wrote:
Jun 22 2018 2:22pm
a real shame as this could have been a nice feature fully implemented with legal speed
I just took a test ride with the firmware of my fork, where the speed limit is implemented already (BionX IGH DirectDrive with S06S Controller). It works fine, I think. First I accelerated hard to something about 28 km/h, the battery current drops to zero if the speed exceeds 27 km/h. In the second phase I was pedaling comfortably and the power decreases slowly if you exceed 25 km/h. This avoids the feeling of "riding against a wall" when reaching the speed limit.
But to be honest, I don't know where to paste the function in casainhos code.

regards
stancecoke
cutting power at speed limit.PNG
cutting power at speed limit.PNG (55 KiB) Viewed 682 times

casainho   100 MW

100 MW
Posts: 2800
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 » Jun 23 2018 7:47am

stancecoke wrote:
Jun 23 2018 7:27am
geofft wrote:
Jun 22 2018 2:22pm
a real shame as this could have been a nice feature fully implemented with legal speed
I just took a test ride with the firmware of my fork, where the speed limit is implemented already (BionX IGH DirectDrive with S06S Controller). It works fine, I think. First I accelerated hard to something about 28 km/h, the battery current drops to zero if the speed exceeds 27 km/h. In the second phase I was pedaling comfortably and the power decreases slowly if you exceed 25 km/h. This avoids the feeling of "riding against a wall" when reaching the speed limit.
But to be honest, I don't know where to paste the function in casainhos code.
Good!!

So now I think that you need to decide strategically if you keep current master if my branch or your code.

I promisse that I will be reading this topic and that I will help. Even because I will be using the same code for TSDZ2, so both projects can benefit and I would say this one will take the most advantage as the community of testers/users of TSDZ2 is clearly bigger.

As for speed controller, I would do just the same I do for current control. The motor code, on fast loop, controls the value and is very fast to actuate. On slow loop, ebike_app, I just set the current value to my desire and there we can implement some some ramp up/down.

Note: I will answer later about the changing of documentation, etc. I am not on computer.
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: 926
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 » Jun 23 2018 9:00am

casainho wrote:
Jun 23 2018 7:47am
So now I think that you need to decide strategically if you keep current master if my branch or your code.
I'll stay at my own fork, as I'm much more familiar with it and it meets exactly my needs :D
But of course I can support your master with little services if wanted.

regards
stancecoke

geofft   1 kW

1 kW
Posts: 324
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 » Jun 23 2018 9:53am

stancecoke wrote:
Jun 23 2018 7:27am
geofft wrote:
Jun 22 2018 2:22pm
a real shame as this could have been a nice feature fully implemented with legal speed
I just took a test ride with the firmware of my fork, where the speed limit is implemented already (BionX IGH DirectDrive with S06S Controller). It works fine, I think.
Stancecoke, I would like to try this fork sometime but I've rather lost track of what they all do and where they are... :?
Could you post up a link to it - thanks.
BBS02 V2 48v 750w, 12s lipo.
Q128H (36v 201rpm), KT36/48SVPR, LCD3, 48v 12s lipo.

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 23 2018 11:12am

geofft wrote:
Jun 23 2018 9:53am
Could you post up a link to it - thanks.
You can find the link and the explanation in the "Alternative Fork" tab of the windows instructions.

But be careful, there are less safety features for hardware protection implemented. Make sure, that you are using a fuse in the battery wire, although I haven't had any problems so far...

regards
stancecoke

p.s. I have not implemented the latest feature (simple regen by brake lever) in the java tool. You can use it, if you don't want to activate the regen option.

dr_lulz   100 mW

100 mW
Posts: 42
Joined: Jan 28 2013 5:05pm

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

Post by dr_lulz » Jun 23 2018 12:43pm

drunkencat129 wrote:
Jun 20 2018 7:10pm
hey guys wondering if some one can help me out i got a kt 18 fet i got with 4110 fets and 100v caps moded to it also built up the traces does any one know how to make the power on circut support 100v i can replace the voltage reg with a dc to dc converter but is that only thing i need to change thanks
i am trying to do the same right now ... not tested yet
my plan is to change
- fets -> CSD19536KCS
- big caps -> 100v 470uF x 3
- dcdc for powering the controller -> 100v mini stepdown module from ebay
- battery voltage resistors
- snubber? caps to 100v 470nF

honya96   1 kW

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

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

Post by honya96 » Jun 25 2018 5:24am

dr_lulz wrote:
Jun 23 2018 12:43pm
drunkencat129 wrote:
Jun 20 2018 7:10pm
hey guys wondering if some one can help me out i got a kt 18 fet i got with 4110 fets and 100v caps moded to it also built up the traces does any one know how to make the power on circut support 100v i can replace the voltage reg with a dc to dc converter but is that only thing i need to change thanks
i am trying to do the same right now ... not tested yet
my plan is to change
- fets -> CSD19536KCS
- big caps -> 100v 470uF x 3
- dcdc for powering the controller -> 100v mini stepdown module from ebay
- battery voltage resistors
- snubber? caps to 100v 470nF
If you are doing that with 18fet. I think you will need to mod. Gate drivers or longer deadtime. (Ask Casainho, Stancecoke)

I did the same mod and Its triping 10A breaker even without motor connected. I got no short anywhere and fets seems to be still ok.

I dont know when I will get back to it..

DarkDD   100 µW

100 µW
Posts: 7
Joined: May 04 2018 11:26pm

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

Post by DarkDD » Jun 25 2018 9:00am

stancecoke wrote:
Jun 23 2018 3:30am
DarkDD wrote:
Jun 22 2018 11:10pm
Ended up using a snapshot version of their executable.
Does that mean the linked release did not work for you?!

regards
stancecoke
Didn't want to spend much time figuring out when working builds with simple .exe installers were already there :p

Got it running! Some questions though...

First, post pwm mode, motion gets jerky and out of sync. Where could that be arising from?
Second, when rotating the wheel by hand backwards, it tends to jerk and stop, what do I need to change?
Third, what exactly does

Code: Select all

PWM_CYCLES_COUNTER_MAX
do?? I see the definition for Q11 motor in main.h but its missing this value in the ifdefs...

I am using a 1000W direct drive motor and not an S series controller but rather a KT48ZWSRMT... Any Idea what all settings to change?

casainho   100 MW

100 MW
Posts: 2800
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 » Jun 25 2018 9:03am

honya96 wrote:
Jun 25 2018 5:24am
dr_lulz wrote:
Jun 23 2018 12:43pm
drunkencat129 wrote:
Jun 20 2018 7:10pm
hey guys wondering if some one can help me out i got a kt 18 fet i got with 4110 fets and 100v caps moded to it also built up the traces does any one know how to make the power on circut support 100v i can replace the voltage reg with a dc to dc converter but is that only thing i need to change thanks
i am trying to do the same right now ... not tested yet
my plan is to change
- fets -> CSD19536KCS
- big caps -> 100v 470uF x 3
- dcdc for powering the controller -> 100v mini stepdown module from ebay
- battery voltage resistors
- snubber? caps to 100v 470nF
If you are doing that with 18fet. I think you will need to mod. Gate drivers or longer deadtime. (Ask Casainho, Stancecoke)

I did the same mod and Its triping 10A breaker even without motor connected. I got no short anywhere and fets seems to be still ok.

I dont know when I will get back to it..
On firmware, is possible to start by disabling all fets driver, enable a specific one (low side or high side only), change dead time.
Also, keep braking active at startup will disable the fet drivers while active, so you can try something that even if does not work, you can "reset" up to program again with a different setup.
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.

honya96   1 kW

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

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

Post by honya96 » Jun 25 2018 9:37am

casainho wrote:
Jun 25 2018 9:03am
On firmware, is possible to start by disabling all fets driver, enable a specific one (low side or high side only), change dead time.
Also, keep braking active at startup will disable the fet drivers while active, so you can try something that even if does not work, you can "reset" up to program again with a different setup.
Can you point me where to change deadtime? By holding brakes on startup it will trip when I release..

Changing deadtime may be a way to avoid moding drivers, but still better to do it. (Efficiency?..)

casainho   100 MW

100 MW
Posts: 2800
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 » Jun 25 2018 10:30am

honya96 wrote:
Jun 25 2018 9:37am
casainho wrote:
Jun 25 2018 9:03am
On firmware, is possible to start by disabling all fets driver, enable a specific one (low side or high side only), change dead time.
Also, keep braking active at startup will disable the fet drivers while active, so you can try something that even if does not work, you can "reset" up to program again with a different setup.
Can you point me where to change deadtime? By holding brakes on startup it will trip when I release..

Changing deadtime may be a way to avoid moding drivers, but still better to do it. (Efficiency?..)
Dead time is on PWM configuration.
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: 926
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 » Jun 25 2018 11:21am

DarkDD wrote:
Jun 25 2018 9:00am
I am using a 1000W direct drive motor and not an S series controller but rather a KT48ZWSRMT...
The "ZWS"-type is the block commutating one. In this, the phase current sensor is missing. You have to solder in the sensor or you have to buy a "SVP"-type. Or you can disable the "simplyfied FOC" and work with a static advance angle, but this will cause some losses and will heat up the controller and the motor unnecessarily.

regards
stancecoke

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 26 2018 12:16pm

I've managed to improve regen significantly! 8)

Image

vs.

Image

The trick was to switch to a certain ratio of ERPS and DutyCycle, if the PI-controller can't hold the asked regen-current and starts to run to nirvana...

Code: Select all

            ui32_setpoint= PI_control(ui16_BatteryCurrent, REGEN_CURRENT_MAX_VALUE);  //Curret target = max regen,
            if (ui32_setpoint==0){ui32_setpoint=ui16_motor_speed_erps*2;} //try to get best regen at Low Speeds for BionX IGH
regards
stancecoke
Last edited by stancecoke on Jun 26 2018 12:41pm, edited 2 times in total.

dr_lulz   100 mW

100 mW
Posts: 42
Joined: Jan 28 2013 5:05pm

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

Post by dr_lulz » Jun 26 2018 1:53pm

honya96 wrote:
Jun 25 2018 9:37am
Can you point me where to change deadtime? By holding brakes on startup it will trip when I release..

Changing deadtime may be a way to avoid moding drivers, but still better to do it. (Efficiency?..)
maybe you could just reduce the gate resistors?

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 » Jun 27 2018 12:33am

Hello to You All..!

I’m Maarten from The Netherlands, 68 years young, and for the first time in my life on a forum.
Long story short: since my BionX-system failed on me, and my Trek-dealer offered me to repair my bike at absurd prices, I decided to repair it myself. I half-unspoked my backwheel, so I could separate the two motor-halves and saw a rotor with 22 magnets, a stator with 24 coils,and a mechanically broken 502 bipolair hall-sensor. Replaced the sensor and had to remove the controller inside whereby my strain-gauge broke down. I decided to say goodbye to BionX and make a system of my own. So I closed the motor again after leading the wires to the outside world, removed all the BionX parts, bought me a cheap chinese controller (20 euro’s including shipping) and it worked like hell. King of the world at 35km/h! Although I found that it was rather current-consuming. Eye fell on the endless-sphere pages, fell in love with the idea of controlling my own controller, bought a S06S-one.
Programmed it and….disaster: It won’t run! According to my led-tester my hall-sensors do an OK-six-step commutation pattern which is repeated 11 times for one turning of the wheel (22 magnets).
Swapped all the hall- and motorwires, but no result! Or the wheel oscillates, or it turns very slow foreward with a scary loud hum which is getting worse when turning the potmeter, or it turns slow (there is that HUM again!) backwards and won’t stop when turning the pot to zero.
The learn function doesn’t seem to work (if present?).
So I have the burning question: What am I doing wrong?
Hope for and looking foreward to an answer ……
Greetz…

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 27 2018 1:30am

Mavabo wrote:
Jun 27 2018 12:33am
Programmed it and….disaster: It won’t run!
First, welcome to this projcet! :-)
Can you please tell us, which release of the firmware and which tools for flashing did you use? What is your config.h setting?

I'm runnig the firmware (my fork) with a BionX very successfully!

regards
stancecoke

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 » Jun 27 2018 10:21am

Hello stancecoke: thank you for welcoming me! (and the quick answer!)
I'm glad to hear that you are running the software on BionX too. So there is hope for me!

For flashing the STM8S105C6T6 I use the ST-Link V2 (clone) 'lookalike' wich is connected to the ST Visual programmer.

My .cproject file in the firmware file starts with these two remarks:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>

And the copy of my config.h is:
/*
* config.h
*
* Automatically created by OSEC Parameter Configurator
* Author: stancecoke
*/

#ifndef CONFIG_H_
#define CONFIG_H_

#define PAS_NUMBER_MAGNETS 8
#define PAS_MAX_CADENCE_RPM 90
#define MOTOR_ROTOR_OFFSET_ANGLE 0
#define ADC_BATTERY_CURRENT_MAX 30
#define ADC_BATTERY_REGEN_CURRENT_MAX 30
#define ADC_MOTOR_CURRENT_MAX 43
#define ADC_MOTOR_REGEN_CURRENT_MAX 20
#define ASSIST_LEVEL_0 0
#define ASSIST_LEVEL_1 0.2
#define ASSIST_LEVEL_2 0.4
#define ASSIST_LEVEL_3 0.6
#define ASSIST_LEVEL_4 0.8
#define ASSIST_LEVEL_5 1
#define PWM_DUTY_CYCLE_RAMP_UP_INVERSE_STEP 37
#define PWM_DUTY_CYCLE_RAMP_DOWN_INVERSE_STEP 15
#define MOTOR_ROTOR_ERPS_START_INTERPOLATION_60_DEGREES 131
#define LI_ION_CELL_VOLTS_MAX 4.25
#define LI_ION_CELL_VOLTS_100 4.06
#define LI_ION_CELL_VOLTS_80 3.93
#define LI_ION_CELL_VOLTS_60 3.78
#define LI_ION_CELL_VOLTS_40 3.6
#define LI_ION_CELL_VOLTS_20 3.38
#define LI_ION_CELL_VOLTS_10 3.25
#define LI_ION_CELL_VOLTS_0 3.00
#define PAS_THRESHOLD 1.70
#define LCD_BATTERY_CURRENT_FACTOR 1.50
#define EBIKE_THROTTLE_TYPE EBIKE_THROTTLE_TYPE_THROTTLE_PAS
#define EBIKE_THROTTLE_TYPE_THROTTLE_PAS_CURRENT_SPEED
#define EBIKE_THROTTLE_TYPE_TORQUE_SENSOR_HUMAN_POWER
#define PAS_DIRECTION PAS_DIRECTION_RIGTH
#define BATTERY_LI_ION_CELLS_NUMBER 10

#endif /* CONFIG_H_ */

User avatar
stancecoke   10 kW

10 kW
Posts: 926
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 » Jun 27 2018 11:03am

please try

Code: Select all

#define MOTOR_ROTOR_ERPS_START_INTERPOLATION_60_DEGREES 5
and then try different values for

Code: Select all

#define MOTOR_ROTOR_OFFSET_ANGLE
in steps of 5, the last user basia told, that a value about 130 worked for him.


If all of this doesn't work, please try this release, with ride mode set to throttle:
https://github.com/stancecoke/BMSBatter ... Master.zip

regards
stancecoke

Post Reply