-
Notifications
You must be signed in to change notification settings - Fork 64
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
Added TI angle observer code, and related parameters #9
base: master
Are you sure you want to change the base?
Conversation
Very nice, did you test it with some hardware? Could it also calculate angular speed to replace the clumsy 10ms angle difference calculation? |
Yup, tested on hardware and it runs.
Yes, the observer code can output speed too, I'll add that in (separate PR?)
…________________________________
From: Johannes Huebner ***@***.***>
Sent: Monday, 19 April 2021 20:35
To: jsphuebner/stm32-sine
Cc: Matt Collins; Author
Subject: Re: [jsphuebner/stm32-sine] Added TI angle observer code, and related parameters (#9)
Very nice, did you test it with some hardware? Could it also calculate angular speed to replace the clumsy 10ms angle difference calculation?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Yes, that would be awesome! |
Now uses speed from the observer code for resolver or encoder ICs, but retains the current speed calculation for other position feedback types. |
Turns out 'lastFrequency' must remain positive - the motor will run fine with it negative but trying to regen results in increased speeds! (The TI observer code outputs speed with a sign - +ve for forward, -ve for backward, and the OpenInverter code 'corrects' that later by multiplying by the sign of the direction. This is needed for other position feedback, so I've left this there, and just 'ABS()'d the lastFrequency in the new code) |
As per https://openinverter.org/forum/viewtopic.php?p=26645#p26645
The new parameters/values, and the old atan2 code probably won't be needed long-term, but I've left them in for testing at the moment.