Przykład:M67 E0 Q1000
w pliku HAL
loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net pwm-value-0 <= motion.analog-out-0 => pwmgen.0.value
setp pwmgen.0.enable 1
net pwm-0 pwmgen.0.pwm parport.1.pin-09-out
jeszcze trzeba ustawić parametry generatora PWM
(float) pwmgen.<chan>.pwm-freq -- Desired PWM frequency, in Hz. If 0.0, generates PDM instead of PWM. If set higher than internal limits, next call of update_freq() will set it to the internal limit. If non-zero, and dither is false, next call of update_freq() will set it to the nearest integer multiple of the make_pulses() function period.
(bit) pwmgen.<chan>.dither-pwm -- If true, enables dithering to achieve average PWM frequencies or duty cycles that are unobtainable with pure PWM. If false, both the PWM frequency and the duty cycle will be rounded to values that can be achieved exactly.
czyli wystarczy ustawić zamiast PWM -> PDM (gęstości)... przetwornik PWM2DC to przełknie...
setp pwmgen.0.pwm-freq 0