Thierry,
You will have to test this. I have tested most of the stepper motor hardware and firmware, but have not attempted to change the PPS (step rate) of a running stepper.
I do use the PWM outputs to generate variable frequency pulses. The PWM outputs will change frequency while running. I have verified this with a digital oscilloscope and see that the output goes to the new frequency very "cleanly". You could use a PWM OUPTUT to control a stepper motor and change the frequency, periodically.
The following code has been extracted from one of my products that is in production. The code is called every 0.1 second (10 Hz rate) and changes the PWM frequency. The code is used to simulate the output of a flow meter. The physical flow meter outputs a variable frequency signal that is proportional to the flow of fluid through the flow meter.
if (VFDCurrentHz < 5.00)
' Main Pump speed is too low to generate meaningful flow values
'
SimProductGPM = 0.0
SetPWM 1, 0, 1 ' 0% duty cycle so output is "OFF"
else
' The main pump is running so we will calculate flows based on VFD frequency
'
SimProductGPM = 0.0007 * VFDCurrentHz * VFDCurrentHz + 0.0194 * VFDCurrentHz + 0.7229
' Generate pulse output for flow.
'
SetPWM 1, 5000, SimProductGPM / 60.0 * ProductPPG
endif
Best regards,
Gary Dickinson