How to correctly create a controller #60
-
Hi, I have questions regarding how to create a controller. The summary would be this:
Context
Question 1I would like to know the difference between using
And the output looks like this:
All this using the Question(s) 2I read that making a load dependent on the system state is not recommended (in this comment).
I am making my controllers (through You suggested (in a different context) implementing the control law in Is there a place in the documentation where I can learn more about this? I don't think I've come across explicit examples on this topic. Thanks! EDIT: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
the difference between the two choices are: There are several examples for serial robots which use controllers. Using RigidBodySpringDamper or any other spring: then you can directly couple the P and D-values (stiffness and damping) to control inputs. Do not forget to set both offset and offset_t for set values for the controller. |
Beta Was this translation helpful? Give feedback.
-
Just to add one thing: The simpler functionality based on the |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. I'm using
Now I can really focus on creating a good controller. |
Beta Was this translation helpful? Give feedback.
the difference between the two choices are:
loadVectorUserFunction: is called in every iteration of the solver - in particular for implicit solvers. This means that this is the most accurate solution. However, for large P-control values, the solver does not know the strong coupling of controller output to sensor values, which can be added by using AddODE2LoadDependencies(...), see https://exudyn.readthedocs.io/en/latest/docs/RST/cInterface/SystemData.html
SetPreStepUserFunction: this is a weak coupling, which is similar to a real controller which acts every delta t (the step size or whatever you implement in SetPreStepUserFunction. This may lead to controller instabilities like in real wo…