Skip to content
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 2FOC V3.5 application. #91

Closed
wants to merge 8 commits into from
Closed

Added 2FOC V3.5 application. #91

wants to merge 8 commits into from

Conversation

ale-git
Copy link
Contributor

@ale-git ale-git commented Aug 14, 2019

Now the 2.5 motors are controlled in a way as much similar as possible to 3.0 motors in the experimental release V3.5 of the 2FOC firmware:

  • the quadrature encoder alone is used to measure the rotor angle
  • the Hall effect sensors are used to reset the quadrature encoder (1 <-> 6 sector transition), in the same way the Index tick is used with 3.0 motors.

…motor control are as aligned as possible: the rotor encoder is used for field control and the Hall effect sensor is used to reset the encoder (2.5) or the index tick is used for the same purpose (3.0).
@ale-git ale-git requested a review from marcoaccame August 14, 2019 07:56
@ale-git
Copy link
Contributor Author

ale-git commented Aug 17, 2019

Some improvements have been added:

  • now the integer arithmetic of the Clarke-Park transformations is more precise thanks to rounding terms
  • gain calibration of the ADC converter is now performed at startup in addition to offset calibration

@nunoguedelha
Copy link
Contributor

We have to test on the robot before merging the PR.

@nunoguedelha
Copy link
Contributor

@ale-git why have we duplicated the whole folder? Are maintaining 2 releases? If it's the case it's better to create release branches. It makes it easier to compare/merge changes between the 2 releases.

ale-git and others added 5 commits August 31, 2019 17:31
…motor control are as aligned as possible: the rotor encoder is used for field control and the Hall effect sensor is used to reset the encoder (2.5) or the index tick is used for the same purpose (3.0).
Discarded files generated by the IDE or the build, since they are IDE, platform and sometimes user dependant.
Merge from commit 'cd0f640':
- Ported changes in 2FOC-V35 folder into 2FOC-V3 folder
- Merged these changes with base of 2FOC_V35 branch
@nunoguedelha
Copy link
Contributor

Moving the files from 2FOC-V35 to 2FOC-V3

@ale-git I ported the changes into the original folder 2FOC-V3, merging them with the changes for:

  • the PWM clock rate increase
  • the fix of the memory alignment issue.

Once the review is finished, we can delete the files in 2FOC-V35 folder.

@marcoaccame, as agreed with @ale-git , we moved the files instead of keeping duplicates, for the following reasons:

  • keeping a clear history of all the changes so far
  • if eventually we keep two releases V3.5.x and V3.3.x (I strongly suggest not to), it will be easier to deploy common fixes to both releases and track those changes. For that we need to use two release branches, but that can be discussed in a next meeting..

I suggest we discuss on this today on skype (I'm working from home today and tomorrow morning), or tomorrow afternoon.

@nunoguedelha
Copy link
Contributor

nunoguedelha commented Sep 9, 2019

We agreed with @ale-git to revert the HES/ADC offset calibration to the former original method: PWM on all phases is set to OFF prior measuring the offset currents on terminals A and C. Refer to #96 (comment).

Changes pushed in 41b228b. But this change was done on the old folder 2FOC-V35. Porting now to 2FOC-V3.

- Ported changes on 2FOC_V3 folder.
- Removed 2FOC_V35 folder.
nunoguedelha added a commit that referenced this pull request Sep 12, 2019
@nunoguedelha
Copy link
Contributor

nunoguedelha commented Sep 18, 2019

ciao @ale-git , here are the tests I think would be performance improvement indicators for this pull request, illustrating the two main expected improvements:

  1. obtain a clean current waveform on each stator phase, without current discontinuities through a full electric cycle.
  2. have a stator direct field (Id) always well aligned with the rotor, even after a few laps and transitions between sectors 1 & 6.

Here's a proposal for the tests to run...

Test 1: clean current waveform on each stator phase

We have to verify that there are no current discontinuities through a full electric cycle. These discontinuities were previously observed at the switching between sectors 1<->2<->3<->4<->5<->6, while the rotor position detection was hybrid, using the optical encoder and the HES.
With the new solution you've implemented, there could still be a small step, but just between sectors 1 & 6, when the variable tracking the rotor position is reset.

Two possible approaches...
While rotating the rotor at very low speed (~ 1 deg/s)

  1. Measure the phase currents on the oscilloscope (I can help you on this) and check that there are no discontinuities.
    or...
  2. Log the computed PWM, on phase A for instance (computed from the rotor angle delta which is a priori impacted by the sector transition 6->1) and compare with a PWM computed from the raw motor enc (enc = QEgetElettrDeg()).

Test 2: stator direct field (Id) always well aligned with the rotor

After a few laps and switching between sectors 1 & 6, there could be a slight misalignment between the stator field and the rotor. We can measure that error through the following procedure (while the rotor has no mechanical load):

  1. run the usual rotor alignment procedure,
  2. set Iq = 0, and wait a few ms that the rotor position stabilizes (cogging effects),
  3. stop the rotor position tracking (delta is fixed),
  4. set Id to a high value. If there is a misalignment, the rotor moves a fraction or a few degrees.
  5. measure final rotor position and compare to delta.

@ale-git, does this seem reasonable with respect to the new rotor alignment you have implemented?

@marcoaccame
Copy link
Contributor

marcoaccame commented Feb 11, 2021

having talked w/ @ale-git we can close this old PR w/out merging and delete the branch

@marcoaccame marcoaccame deleted the 2FOC_V35 branch February 11, 2021 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants