Thanks gain for the details to face the problem I have experienced with my commuted circuit.
In trying to make my DutyCycle a periodic function I have found a related discussion Periodic piecewise function where periodicity is achieved by the use of the function Mod. One has to be cautious with suggestions given there.
Regards
Jesus Rico