Hi
I have a cascaded control loop system (a dc motor running at 1500rpm with speed and current feedback),both sensors (s1=current and s2=speed generate interrupts when their data become available), my problem is that the internal control loop sensor has different sampling frequency than the outer loop sensor(fS1 <> N*fS2),
I'm wondering how and where should I update the inner and outer control loops.
I have thought of several options but non of them feels right to me!
1. Update both loops in a free running timer and update the sensor values in their respective interrupts.
2. Update the inner loop variable(current) in its interrupt and update both inner and outer loops with the same frequency at the outerloop sensor interrupt
3. try resampling so that N*fS1 = fS2