Jerky motor control

karstensson

10 mW
Joined
May 23, 2022
Messages
21
Hello,

I have started to experiment with the open source Lishui firmware https://github.com/EBiCS/EBiCS_Firmware

I have managed to get the wheel to spin, but it is super jerky. It seems to be out of phase or something. I have checked the throttle signal from the debug interface and that is stable (running in throttle only mode).

Any ideas on what could be wrong or how to debug it?

Could it be related to wrong setting at pulses per revolution? How can I find out what the real value should be? is it possible to output the pulses through the serial interface?

Here is a video showing what I mean: https://youtube.com/shorts/PKVxcN2bU1o?feature=share

Thanks in advance!
 
Is it running sensorless, or using hall sensors? If using halls, it might not be the correct phase/hall wiring combination. If the OSFW has an "auto learn" of some type, that should fix that problem. If not, you can manually determine the combination (there are a few methods we can go over if needed).

I don't know if this would be a factor if the controller worked ok using the OEM FW, because the OSFW *could* read them in a different way (different order) *or* the OEM FW might already have had auto-learn used on them if it had that, and so already have figured out the right wiring (so that even though the as-connected wiring wasn't correct, it would reroute the signals in software).
 
amberwolf said:
Is it running sensorless, or using hall sensors? If using halls, it might not be the correct phase/hall wiring combination. If the OSFW has an "auto learn" of some type, that should fix that problem. If not, you can manually determine the combination (there are a few methods we can go over if needed).

I don't know if this would be a factor if the controller worked ok using the OEM FW, because the OSFW *could* read them in a different way (different order) *or* the OEM FW might already have had auto-learn used on them if it had that, and so already have figured out the right wiring (so that even though the as-connected wiring wasn't correct, it would reroute the signals in software).

Thanks for the help.

I am actually not sure if i am running sensorless or not. These are the settings I have been using.

Idfq81v.png

PjGfyVT.png


I have ran the auto learn function in the firmware, with a free spinning wheel.

Regarding testing with stock firmware I only tested with the throttle and then it only was able to spin with a speed corresponding to 6 km/h, but there I could not see this issue. However if I enable 6 km/h limit with the new firmware I see the issue when it reaches the top speed. I will try to change the wiring for the phases. But the motor has a 9 pin connector and so does the controller, so I have just assumed that it was correct.
 
karstensson said:
I am actually not sure if i am running sensorless or not. These are the settings I have been using.

I don't know the OSFW well enough to tell you what the settings chosen mean. But my experiences with the SFOC5 FOC controller showed me that things like the Iq and Id numbers may have to be tuned for the specific motor/etc.

Then the P and I on the speed may need to be tuned (they are the proportional and integral numbers of the control loop).

The "sensorless settings" section looks like motor-specific settings. Resistance would be the phase resistance, meaning resistance of the windings across any two phases, probably in milliohms. There are some ways you can measure this if you don't know what it is for your motor, to do it directly you'd need a meter capable of reading veyr very low resistances; I got this one:
DE-5000 Handheld LCR Meter
https://www.amazon.com/gp/product/B00S298KJO
and even with that I'm not sure it is accurate enough at that low a resistance to measure the motor windings. See this thread
https://endless-sphere.com/forums/viewtopic.php?f=2&t=105637
for my testing results with it; I never did get replies there with help in understanding it, so I still don't know if the problem was me, the meter, or the reference data.

If you have a constant-current power supply you can use that to run a small constant current thru the windings and measure the voltage drop across them; this will let you calculate the resistance with ohms law.

Inductance is the inductance of the windings. Measuring this indirectly I don't know how to do; I asked repeatedly when testing the SFOC5 but never got any reply about it, and without that I couldn't really tune the controller to my motor, so I could never really test the controller properly.

Theoretically the DE-5000 can measure the inductance ok, but again, I don't know that it is accurate enough at that low a reading.

I have no idea what Flux LInkage or Gamma are for. or what the stuff in the fields for FOC voltage and current could possibly mean; they don't look like voltage or current values. (I truly despise obtusely obscure GUIs, when it is possible for programmers to create something intuitive and easy to use that doesnt' require lookup tables or often-convoluted instructions to figure out what to enter in a field. But I have yet to see a controller setup program that made any sense this way; they all look like they're made for the convenience of the programmer and not of the user, which is a pretty silly way to do things).

However, even with all that, I don't know what your controller uses for number ranges, or what kind of tuning it needs for specific motors. That's something you will probably have to check with the OSFW documentation (or it's threads on ES, or discussion on Github if there is any) to determine. You could just change settings, but I don't know how much of an increment is useful, and how much is too much, and could potentially cause damage. :(

I will try to change the wiring for the phases. But the motor has a 9 pin connector and so does the controller, so I have just assumed that it was correct.
It probably is...but I don't know.

As long as autolearn worked, it means the controller correctly determined the phase/hall combo. (or it should mean that) So you shouldn't need to mess with the wiring.
 
amberwolf said:
karstensson said:
I am actually not sure if i am running sensorless or not. These are the settings I have been using.

I don't know the OSFW well enough to tell you what the settings chosen mean. But my experiences with the SFOC5 FOC controller showed me that things like the Iq and Id numbers may have to be tuned for the specific motor/etc.

Then the P and I on the speed may need to be tuned (they are the proportional and integral numbers of the control loop).

The "sensorless settings" section looks like motor-specific settings. Resistance would be the phase resistance, meaning resistance of the windings across any two phases, probably in milliohms. There are some ways you can measure this if you don't know what it is for your motor, to do it directly you'd need a meter capable of reading veyr very low resistances; I got this one:
DE-5000 Handheld LCR Meter
https://www.amazon.com/gp/product/B00S298KJO
and even with that I'm not sure it is accurate enough at that low a resistance to measure the motor windings. See this thread
https://endless-sphere.com/forums/viewtopic.php?f=2&t=105637
for my testing results with it; I never did get replies there with help in understanding it, so I still don't know if the problem was me, the meter, or the reference data.

If you have a constant-current power supply you can use that to run a small constant current thru the windings and measure the voltage drop across them; this will let you calculate the resistance with ohms law.

Inductance is the inductance of the windings. Measuring this indirectly I don't know how to do; I asked repeatedly when testing the SFOC5 but never got any reply about it, and without that I couldn't really tune the controller to my motor, so I could never really test the controller properly.

Theoretically the DE-5000 can measure the inductance ok, but again, I don't know that it is accurate enough at that low a reading.

I have no idea what Flux LInkage or Gamma are for. or what the stuff in the fields for FOC voltage and current could possibly mean; they don't look like voltage or current values. (I truly despise obtusely obscure GUIs, when it is possible for programmers to create something intuitive and easy to use that doesnt' require lookup tables or often-convoluted instructions to figure out what to enter in a field. But I have yet to see a controller setup program that made any sense this way; they all look like they're made for the convenience of the programmer and not of the user, which is a pretty silly way to do things).

However, even with all that, I don't know what your controller uses for number ranges, or what kind of tuning it needs for specific motors. That's something you will probably have to check with the OSFW documentation (or it's threads on ES, or discussion on Github if there is any) to determine. You could just change settings, but I don't know how much of an increment is useful, and how much is too much, and could potentially cause damage. :(

I will try to change the wiring for the phases. But the motor has a 9 pin connector and so does the controller, so I have just assumed that it was correct.
It probably is...but I don't know.

As long as autolearn worked, it means the controller correctly determined the phase/hall combo. (or it should mean that) So you shouldn't need to mess with the wiring.

Thank you very much for all the advice of the stuff to check. It ended up not being a hardware related issue. It was the "position ppl" in the software that was badly tuned, when I realised that the P gain and I gain has to be tuned for the motor. Everything started to move smoothly :)
 
Back
Top