For the realtime application the controlleur needs to be sampled. The inner electrical control loop will be sampled à 20kHz (PWM frequency). The outer mechanical control loop will be sampled at 500Hz. For this purpose, use the Sampling block commented in the simulation. Apply the sampled control to the downloaded model and compare with the continous control.