Lishui "Open Source Firmware" project / KingMeter 5S

?! You need 5 wires connected +5V and GND is mandatory.
Right , Forgot to mention that the controller already comes with a 3 pin jst sm connector for a speed sensor, ground and +5V.
What is the terminal output during the autodetect routine?
It shows angle, hallstate and hallcase a few times during the first rough moments until I suppose it finds the hall configuration and starts spinning the motor in a very rough manner. Then It stops outputting the autodetect data and tires to spin it up to max. Lastly it stops and I can then use the throttle.
 
Seems that the id current at autodetect is to low to turn the rotor properly.
Increase it to 600 and try it again, post the output again! Make sure that the wheel can spin free in the air during Autodetect!
https://github.com/EBiCS/EBiCS_Firm...b53b53151511c0224509a0274d32/Src/main.c#L2336

The hall state pattern has to be 6-4-5-1-3-2 or backwards. If not, the routine still doesn't work properly.


regards
stancecoke
 
Make sure that the wheel can spin free in the air during Autodetect!
The wheel spins freely, it also has no problems/resistance when paired with a flashed Kunteng controller therefore I doubt that there will be any problem with the setup.

Increase it to 600 and try it again, post the output again!
No apparent change in vibrations or sound.
 

Attachments

  • out.txt
    43 KB · Views: 3
No apparent change in vibrations or sound.
Of course, as you didn't achieve the proper hall state pattern. The rotor seems to bounce between two hallstates. You can try to damp that bouncing by breaking the wheel with your hand slightly during the autodetect procedure.

What kind of motor is that? A big direct drive with a low number of pole pairs!?

Are you testing with a lab power supply, or with the original battery?
 
Last edited:
Of course, as you didn't achieve the proper hall state pattern. The rotor seems to bounce between two hallstates. You can try to damp that bouncing by breaking the wheel with your hand slightly during the autodetect procedure.
Will try, How can I see the Hall state pattern?

What kind of motor is that? A big direct drive with a low number of pole pairs!?
"250W" DD Hub with 46 magnets and 23 pole pairs. Visually similar to the attached image.
 

Attachments

  • 1742235193242.png
    1742235193242.png
    357.8 KB · Views: 1
Ok i blew out my clutch, will have to order some parts to fix it. Will come back as soon it is running again. Also have the stange issue that i can only use throttle once then i have to wailt for the wheel to be at a complete stop before i can use the throttle again.
 
Will try, How can I see the Hall state pattern?
Code:
angle: -174, hallstate:  3, hallcase 23
angle: -168, hallstate:  1, hallcase 31
angle: -144, hallstate:  3, hallcase 13
angle: -133, hallstate:  2, hallcase 32
angle: -87, hallstate:  3, hallcase 23
angle: -58, hallstate:  1, hallcase 31
angle: -57, hallstate:  3, hallcase 13
angle: -44, hallstate:  1, hallcase 31
angle: -35, hallstate:  3, hallcase 13
angle: -31, hallstate:  1, hallcase 31

From line to line, you should get 6-4-5-1-3-2 as hallstate sequence with about 60 degrees shift in the angle between the hallstates. As you see in your log, the hallstate bounces all the time between two values, while the angle increases steadily.

What have you set for the current control parameters? Perhaps, the current control oscillates.
 
Last edited:
What have you set for the current control parameters? Perhaps, the current control oscillates.
Motorcurrent max 40A, Batterycurrent max 15A. Haven't touched the PI control settings.
 

Attachments

  • 1742236371062.png
    1742236371062.png
    2.5 KB · Views: 2
  • 1742236418506.png
    1742236418506.png
    1.9 KB · Views: 2
What could be this issue?
Also have the stange issue that i can only use throttle once then i have to wailt for the wheel to be at a complete stop before i can use the throttle again.
 
OK, I never use the configurator, the default values in the GUI are from a very old phase of the project.
Updated the values to recent. It seems to be going smoother at higher speeds but is still very rough at low and middle speeds. It also "emergency stopped" the wheel from full speed to 0 and reset the controller at what I suppose was the end of the routine. The autodetect after never stops the motor and it just continues on in a slow-ish speed until I turn off the battery. Have 2 logs of 2 consecutive runs.
 

Attachments

  • out2.txt
    55.3 KB · Views: 0
  • out1.txt
    63.5 KB · Views: 1
  • 1742238401850.png
    1742238401850.png
    2.5 KB · Views: 3
Updated the values to recent
The angles/hallstates are still not proper as you see in the log, so no wonder, that the motor doesn't run smoothly. It is not normal, that the watchdog kicks in after the autodetect routine.
Can you try to compile with the config.h from the repo, not using the GUI? Just to make sure, that there is no issue with the latest changes in the GUI...


What could be this issue?
Have you activated the legal flag? It should be disabled for the use with a scooter.
 
How do we compile with the config.h from repo?

Or is it just start_compiling.bat
That gives an make error 'make'is not recgonized as an internal or external command.
But in the end it flashes stuff to the controller.

And how do you pull the logfiles of the controller? Thank you for your help :)
 
Last edited:
How do we compile with the config.h from repo?
There is a Start_ohne_GUI.bat in the repo. But I haven't used it for years, so I don't know, if it still works. Perhaps you have to set some path information manually.

For logging you have to choose debug as Display type an use an USB UART converter to send the data to your laptop using a terminal program like HTERM
 
The angles/hallstates are still not proper as you see in the log, so no wonder, that the motor doesn't run smoothly. It is not normal, that the watchdog kicks in after the autodetect routine.
Can you try to compile with the config.h from the repo, not using the GUI? Just to make sure, that there is no issue with the latest changes in the GUI...
No luck.
 

Attachments

  • out3.txt
    42 KB · Views: 2
Can you try to printout the hallstate in the debug information and try if the sequence is OK, if you turn the wheel by hand!
replace one of the variables by ui8_hall_state
Replaced the fourth variable with ui8_hall_state and disabled autodetect on debug to turn the wheel by hand.
Doesn't seem to align with the wanted pattern.

Just to be sure, are the user configuration values in the attached image correct?
 

Attachments

  • 1742318829270.png
    1742318829270.png
    27.5 KB · Views: 3
  • out4.txt
    8 KB · Views: 1
That works
So obviously we have a problem with bouncing due to a pronounced cogging torque of the motor and/or an oszillating current control. Two possibilities:
1. you use predefined angels by activation of the option in the main.h and angle values with an offset of 60 deg. with a judge of the starting angle from your unplausible logs. (a litte tricky with a signed 32bit integer :))
2. you try to optimize the control parameters and id current setpoint to get a smooth run during autodetect routine.
- set p-parameters to zero
- set i-parameters to 1
use a fused battery or better lab power supply with limited current for this tests, as the current controll will be very slow and there is a risk, that fast changes in current can't be controlled fast enough....
 
2. you try to optimize the control parameters and id current setpoint to get a smooth run during autodetect routine.
- set p-parameters to zero
- set i-parameters to 1
use a fused battery or better lab power supply with limited current for this tests, as the current controll will be very slow and there is a risk, that fast changes in current can't be controlled fast enough....
What step should I use for the parameters?
I assume that the fuse needs to be at most 15A?
 
Back
Top