// Set SAM and Tilt Pulse

aHsam = aH90
pwHtilt = 0.0125*trunc(pwH90*35.3/(90.0*0.0125) + 0.5)

if (nHsam < 1) then nHsam = 1 endif // rotor periods per waveform
if (qHsam < 3) then qHsam = 3 endif // amplitude cycles per period

// Synchronize the F1 Dwell amd pwHsam with the Rotor Cycle

$tauR = 0.1*2.0*qHsam*trunc(1.0e6/(srate*2.0*qHsam*0.1) + 0.5)
pwHsam = $tauR
srate = 1.0e6/$tauR
sw1 = 1.0e6/$tauR

 

