Skip to content

Update simulink to include LPF, PLL, and observer#140

Open
noguchi-takahiro wants to merge 63 commits into
mainfrom
user/noguchi-takahiro/update-simulink
Open

Update simulink to include LPF, PLL, and observer#140
noguchi-takahiro wants to merge 63 commits into
mainfrom
user/noguchi-takahiro/update-simulink

Conversation

@noguchi-takahiro

@noguchi-takahiro noguchi-takahiro commented Jun 7, 2025

Copy link
Copy Markdown
Contributor

This PR update simulink to include LPF, PLL, and observer, and update the Encoder Calibration article, especially Computing Speed from Position section to close #147

npetersen2 and others added 30 commits June 5, 2023 17:00
Co-authored-by: Eric Severson <eric.severson@wisc.edu>
Co-authored-by: Eric Severson <eric.severson@wisc.edu>
* Initial commit

* Update readme

* Update readme

* Update readme

* Add files

* Update files

* Changes

* Changes

* Update files

* Get rif of scope image

* Minor updates

* Address review comments

* Remove resources

* Add back resources

* Address review comments

* Address review comments

* Update index.md

* Edit current sensor calibration method section

* Edit calibration method section

* Add section on Recalcilating current sensor offset

* Clarify that we measure a voltage.

* Edit conclusion

* Update index.md

* Update index.md

* Address review comments

* Update index.md

* Update index.md

* Update index.md

* Apply suggestions from code review

Co-authored-by: Eric Severson <eric.severson@wisc.edu>

* Update source/getting-started/control-with-amdc/current-sensor-cal/index.md

* Update source/getting-started/control-with-amdc/current-sensor-cal/index.md

---------

Co-authored-by: Nathan Petersen <npetersen2@wisc.edu>
Co-authored-by: Eric Severson <eric.severson@wisc.edu>
@noguchi-takahiro

noguchi-takahiro commented Jun 8, 2025

Copy link
Copy Markdown
Contributor Author

I have tried to simulate speed control using LPF, PLL, and Observer.

Top level of Simulink

image

There are three types of speed controller with 1) LPF, 2) PLL, and 3) Observer.

Here are what each model looks like (see below). These controllers have the same speed controller, but only differences are how to compute the rotational speed $\Omega$ based on the angle feedback $\theta_m$. Note that these models are coming from BP4 control model.

LPF

image

PLL

image

Observer

image

Notice that there is feedforward torque here.

Speed control results:

plot_results

The speed controller is tuned with 100 Hz bandwidth. Interestingly, only observer approach works well without overshoots, while all controllers have the same bandwidth. This is likely due to the phase delay of low-pass filter and PLL.

For now I am questioning if it would be useful to include this Simulink model? If so, how to organize them? Like maybe it would be helpful when the repo has three types of Reference model for LPF, PLL, and Observer, so that the AMDC users can easily switch them to use in practice?

Any details are available in this m file. To run this, simply run it.

@noguchi-takahiro

Copy link
Copy Markdown
Contributor Author

@elsevers @Daehoon-Sung regarding the organization of the difference-equation-approach section, especially when we think about adding the PLL, we can just add that section as follows:

## Difference Equation Approach
### Low-pass filter
### Observer

## PLL-based Approach

This is because the both the low-pass filter and observer approaches are implemented based on that the angular speed $\Omega_{raw}$ is computed first using this:
image

These methods then filter or refine that initial signal $\Omega_{raw}$.

On the other hand, the PLL approach aims to align the phase of the estimated signal with the one of the measured "angle" $\theta_m$. This means that the PLL does not necessarily use $\Omega_{raw}$ directly, but it detects the angle error, and as a result, it is able to compute the speed indirectly. Interestingly, while the PLL is configured as the closed loop between $\theta_{in}$ and $\theta_{out}$, we only use the $\Omega_{raw}$, which is located the middle of this loop as shown in the image below:

image

@noguchi-takahiro noguchi-takahiro marked this pull request as ready for review November 26, 2025 17:58
@noguchi-takahiro

Copy link
Copy Markdown
Contributor Author

@mhmokhtarabadi @knvprasad-dr @Daehoon-Sung I think the Simulink model is ready for your review. Could you review them?

@noguchi-takahiro

Copy link
Copy Markdown
Contributor Author

@mhmokhtarabadi @knvprasad-dr I wonder if you have had a chance to review this PR? The goal here is to to incorporate/reflect your knowledge from the work with Tim, and make sure the Simulink model we are adding here is accurately modeled.

@noguchi-takahiro noguchi-takahiro linked an issue Feb 6, 2026 that may be closed by this pull request
@elsevers elsevers changed the base branch from add-enc-anirudh to add-control-content June 15, 2026 02:00
@elsevers elsevers changed the base branch from add-control-content to main June 15, 2026 18:53
@elsevers

Copy link
Copy Markdown
Contributor

Everyone, I merged/published the baseline encoder doc. I'd like to soon get this one wrapped up and merged in. We will want to update the doc to explain and link to these files.

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.

Add Simulink model to include LPF, PLL, and observer

4 participants