-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HallSensor interpolation/smoothing/prediction #9
Comments
I did some tests, it seems the zero_electrical_angle was still off by 0.17 something (should be 1.92 instead of 2.09), it needed to be tweaked. I might have to work on a better sensor alignment for hall sensor. |
With my 2.0 board the sensor alignment procedure never did work at all. Only with the Gen1 stm32F103 did it succeed.
Might be good if you would be more prescise. We have used the word "alignment" in so many contexts by now, so i do not really understand what you mean with "better sensor alignment". |
the motor is blocking in the other direction if I am using 1.92. |
Ok I think I found the solution, and I have learned more, I summarized it all here |
Nice. I do not really understand a lot of your post over there. (today i worked on a 20A 80V ESP32 OLED mppt charger..) |
I updated the dev branch. |
Now that is a bit confusing (for me). You seem to work on three different branches and the latest _configure6PWM is in main but smoothedSensor in another branch ? |
I did a pull request to simplefoc dev branch with the direction fix and they accepted it. |
Okay @Candas1 here my test comparison between EFeru and your firmware here on a Gen1 board:
This inital nasty "push" might be because some class variable is not initialized to 0.. To make the Commander class work nicely with the short uart cable of the gen1 board, it would be nice if you would update your config.h to
https://github.com/Candas1/Split_Hoverboard_SimpleFOC/blob/dev/src/main.cpp#L88 would be changed to
Lower case comands were more suitable for me:
I also added a low pass to
maybe this line is missing your main.cpp:
|
Thank you. It could be the inductance value has to be tweaked on different motors. I am using one with 5 coil wires and 30mm magnets. I am thinking about buying a LCR meter to measure it. I tried the low pass filter class from SFOC some time ago but couldn't get it to work for the target. No driver and voltage limit are equal by default. |
I don't think so:
But i do no longer want to think about that stupidity to have two different voltage_limit |
|
If you uncommented the curent sense, maybe the current sense alignment is running |
Your last update to Candas1/Arduino-FOC/tree/dev-gd32 was two weeks ago. |
I already discussed with the contributor, I told him it's not optimal for hall sensors. But that's the best solution we have now and it works most of the time. EFeru would stop predicting at slow speed or direction change, this is easy to do. |
I guess i will spend half a day to test my direct HallSensor impelementation against these SmoothedSensor results here :-) |
You could have checked already weeks ago. |
Again, i do not want to pose problems when i can not offer solutions. And i already figured out that linear prediction with a speed average is sufficient. It is possible to give
but as the speed will not change when And when i only call So everything is okay with SmoothingSensor :-) |
OK then we are aligned. |
I think it is already perfect for us. But this is only needed at very slow speeds and we do not need to care for that. Now seeing that SmoothedSensor is more silent than my linear prediction, i happily close that chapter. I guess when you have finished your channel3 timer0 adc, you have successfully ported SFOC to GD32F130. I would still like to have a callback when adc has finished to trigger motor.loopFOC() every second call :-) |
continuing from #6
@Candas1 applying https://github.com/dekutree64/Arduino-FOC-drivers/blob/dev/src/encoders/smoothing/SmoothingSensor.cpp#L11 wrote: The extrapolation seems to work at constant speed at least now.
Nice visualization tool you have: https://user-images.githubusercontent.com/20670049/256005760-0de8c63f-a36a-48b2-a815-bd4770bc186d.png
You may also want to check max speed with this new inline function HallSensor.h :
float getRpm(){return direction * (60000000.0f / pulse_diff) / (cpr); };
and in main.cpp
OUT2T("KV",sensor.getRpm() / driver.voltage_power_supply )
The text was updated successfully, but these errors were encountered: