cnpcshangbo / simscapeFOPD

Simscape drone altitude control with fractional order proportional derivate controller
Other
9 stars 5 forks source link

Error after changing the sampling period #25

Open cnpcshangbo opened 6 years ago

cnpcshangbo commented 6 years ago

Simulation 3 Clear 12:57 PM Elapsed: 21 sec The sample time 0 of 'Quadrotor_Controller/Controller/Tuned IOPID/Derivative' at input port 1 is different from the sample time 0.1 of 'Quadrotor_Controller/Controller/Tuned IOPID/Gain2' at output port 1. Consider inserting a Rate Transition block between the two ports or clearing the 'Configuration Parameters' > 'Solver' > 'Treat each discrete rate as a separate task' option. Alternatively, you can control the diagnostic action for unspecified rate transitions by changing the option "Multitask (or Single task) rate transition" on the Sample Time Diagnostics pane of the Configuration Parameters dialog box.

cnpcshangbo commented 6 years ago

image I tried to change the sampling period by using this rate transition, but it causes error.

cnpcshangbo commented 6 years ago

The plan for this is to use the method described here: https://stackoverflow.com/questions/37628283/matlab-simulink-convert-pid-continuous-to-discrete to convert the continuous controller to discrete-controller into a parameterised format. In this way, we can keep using the anti-windup mechanism.

Method two: Use m function to make a controller in this way we can put the anti-windup mechanism in it? No.

cnpcshangbo commented 6 years ago

Try to insert a zero-phase-holder to simulate a communication delay.