-
Notifications
You must be signed in to change notification settings - Fork 60
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
Tutorial for closed-Loop Simulation with SHARPy as a hardware-in-the-loop system #240
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- add cs type to allow deflection control via external controller - use different flap ids for right and left wing, because in the linear model they deflect in different directions - add hinge coord to avoid failure in linearization
- add input settings for number of control surfaces instead of getting number from number of inputted intital deflection values
- causes problem with iostream of jupyter notebook
- export simulink model to be accesible from older matlab versions too (2021a)
- also includes minor documentation adjustments
- causes error in unittest in pazy tests due to renaming and type change
Codecov Report
@@ Coverage Diff @@
## main #240 +/- ##
==========================================
- Coverage 67.20% 67.20% -0.01%
==========================================
Files 156 156
Lines 25924 25923 -1
==========================================
- Hits 17423 17422 -1
Misses 8501 8501
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
- enables the matlab script execution without the need to have a Matlab desktop version (e.g. virtual machines)
…ng code In a previous commit, the input type of the initial cs deflection (from float back to list of floats/ints) has been changed to avoid unittest issues and the updated type makes more sense. The code for closed loop simulation has to be adjusted now as well (instead of list, only give one number to the cilent) as control surfaces are symmetric. Further, float type initial value is enforced in client script, to avoid type errors when creating binary control input message containing control surface deflections.
…ng code In a previous commit, the input type of the initial cs deflection (from float back to list of floats/ints) has been changed to avoid unittest issues and the updated type makes more sense. The code for closed loop simulation has to be adjusted now as well (instead of list, only give one number to the cilent) as control surfaces are symmetric. Further, float type initial value is enforced in client script, to avoid type errors when creating binary control input message containing control surface deflections. This commit also includes the removal of code giving instructions of executing the matlab script from Matlab's Desktop version. Only, Matlab's engine API for Python is recommended here as it can be run within the same document.
rafapalacios
approved these changes
Jun 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job. This will be a very useful example for the community to build upon.
- convert normalized open-loop tip deflection to percent and not in plotting funcition because it is reused later - update fixed result graphs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey team,
I have created a tutorial to familiarize users with the UDP capabilities of SHARPy, in particular the application of an external controller to a dynamic nonlinear aeroelastic simulation. As a simple example, the gust-induced wingtip deflection of the Pazy wing is reduced by an aileron deflection controlled by an external P controller. For the design of the controller, the tutorial also covers the generation of a linear reduced order model (ROM) for a given SHARPy model and an example of the next steps necessary to use this ROM for linear open-loop and closed-loop simulations on common platforms such as Matlab/SIMULINK.
Changes made are mostly adding the Jupyter notebook and other files needed for the tutorial. The documentation has been updated to include the download links of this example and for the tutorial to show up in the menu bar. Minor adaptations have been made in the template for flying wing models to specify the aileron type (necessary for closed-loop simulation) and initial aileron deflections, as well as using different indices for symmetric ailerons due to issue #193.
Looking forward to your feedback!
Best,
Steffi