Replicating fan speed as a servo signal on custom PWM pin

  • Hello,
    I posted this question under Hardware and Wiring and that might have been a little off topic, so I'm trying here in the general part instead.

    Is it possible to set up a custom output on the Duet Wifi that will generate a servo signal (1-2 mS) that follow/is proportional to the value of FAN0?
    f ex
    0% = 1.0mS
    100% = 2.0 mS

    If that's not possible, tweaking the FAN0 PWM output itself to produce a 22mS period pulse train with 1-2 mS duty cycle would yield a valid servo signal between 5...9 % in its entire span. Not much to play around with.

    I could solve this in the Slicer (S3D) if math in the G-code was possible with a REPLACE macro that would produce something like this.
    ; Before
    M106 S127

    ; After
    M280 P1 S(([fan_speed_pwm]/255)*1000 +1000) ; S127 "Imaginary" expression

    Any thoughts ? Did I miss something?

    Regards /Thom

  • administrators

    That will be possible when the RepRapFirmware object model is implemented (which I hope will be in firmware 2.03), because at that time maths in GCode commands will be supported. Or you could modify the firmware to set the servo output automatically.

  • OK, Great! In the mean time I'll just filter the output from S3D through a AutoIt serial editor filter that will perform the conversion.

    Thanks /Thom


Looks like your connection to Duet3D was lost, please wait while we try to reconnect.