How to use switch case with PID controller?

I have two inputs V1 and V2 connected to two different subsytems...The outputs of two subsystems are substracted together to provide a final single output (theta)...Now if I want to use reference angle as a sine wave, I want PID controller to provide the desired voltage V1 and V2 such that if reference angle is positive then V1 is supplied and V2 is zero whereas if referenve angle is negative, V2 is supplied by the controller and V1 would be zero... If Reference is zero then both V1 and V2 must be zero...(Attached is the block diagram for better understanding of the query)...How to solve this problem in simulink? whether a switch case resolves this problem or a simple switch? or some other block? ...Dont know whether two different PID needs to be executed? Kindly suggest....

Answers (1)

I think the switch looks like this:
Since there are two V's, I guess you will need two PIDs.

Products

Release

R2021a

Asked:

on 21 Jul 2022

Answered:

on 21 Jul 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!