Replies: 1 comment
-
Hey zkraw, For closed-loop simulations, we encourage you to make use of the UDP network interface implemented in SHARPy. It allows you to apply any external controller you want to the DynamicCoupled simulation as long as you can establish the UDP connection. In this way, we keep controllers out of our code as many platforms already exist which offer advanced capabilities for control architecture and design. I recently created a tutorial for this, including generating a linear ROM that you can use for an initial control design. The tutorial should also help you with your questions regarding the ordering of the state vector. It has not been merged yet but please feel free to check out the pull request #240. I hope that helps. Have fun designing your controllers! Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am using a version of SHARPy that is about a year or so old (python 3.7.5)
I am currently trying to create a simple PID altitude controller on one of the example configurations provided in SHAPRy to begin getting comfortable with designing controllers. In order to implement this controller, I am running the Dynamic Coupled time marching routine with the velocity field generator set to 'TurbVelocityField' as I have some wind field data I would like to run the aircraft through.
I have a few obstacles that are preventing me from doing so. Firstly, I am not sure how to add a controller in the code base. I understand that all I have to do is update the control surfaces before the aerodynamic solver is run for each time step, but I was not sure if there is a more formal way of doing this other than adding my own routine to the code. I see in Dynamic Coupled that there are 'controller_id' and 'controller_settings' options, but I am not sure how to interface with them as I have not come across any examples/refs that have metnioned these settings including the other discussion posts. Is there any references you can provide to help me figure out how to begin implementing controllers in SHARPy?
Secondly, I have come across discussions about the order of the state vector from the linear assembler. The discussions in #156 were useful in identifying the u vector of the state space representation, but in other discussions, like #199, describing the state vector (X) you point to ref: https://doi.org/10.2514/6.2021-1798 which described the Krylov-based ROM formulation. I am struggling to get a hold of this reference from my university library and was curious if further insight into to the ordering of the state vector could be given? This will be useful for my future efforts designing controllers in SHARPy.
Best regards.
Beta Was this translation helpful? Give feedback.
All reactions