How to prevent algebraic loop in the control loop simulation?
Algebraic loops occur when the present-state calculations depend on the present-state output - how can it provide a calculation if it does not have an initial condition?
How to break such loops can be as simple as placing a block that provides an initial output.

Memory block (delay block in XCos)
Transfer function \$\frac{1}{1\mu s + 1} \$

Both provide an initial output of 0 and thus permit the downstream calculations to initialize to then feed back into itself.
If your solver is fixed-step then a Memory block (Delay block) is the best solution as it delays the signal by 1 step. If however the solver is variable then a transfer function with a suitably high time constant is the better solution.
Where to place such block?  on all feedbacks used by the control loop