Welcome! Log In Create A New Profile


M280 after M42

Posted by unromeo21 
M280 after M42
November 17, 2016 04:44PM
Hi everybody,

So I was using a servo in the previous version ( 1.15) and I had to disable the servo after moving into position because of interference that caused the servo to jitter when the extuder motor was running.
I was doing this by pulling the control line high with M106 P1 I0 S0 (it's actually floating, but because of the pullup resistor it's going high).
My "deployproble.g" was looking like this:

M106 P1 I1 F50 S0.120
G4 P500
M106 P1 I0 S0

Now, in the new 1.16, I moved the servo from the Fan1 to Heater3 pin. Heater 3 was disabled in the config per documentation.

I can move the servo with M280, I can also disable it using M42 P3 S0 so I don't have the jitter, but I cannot move it afterwards with M280 any more. It seems that M42 is blocking the pin and M280 cannot use it any more. Is there something I can do to get the same functions that I had with ver.1.15 using the M106 commands ?


Re: M280 after M42
November 17, 2016 04:54PM
Well, I found out why I was having issues. M280 is working a lot slower than the M106 which I used before, so the 500ms delay was not enough. I was pulling high the control line before the servo got any signal to move. Seems that there is quite a high delay between issuing the M280 command and servo reaction, around 3 to 4 seconds, so now I wait around 5 seconds until I issue the M42 command.

Is there something that can be done to have a quicker reaction on M280 command ?

Re: M280 after M42
November 17, 2016 05:58PM
As it happens I have been working on this problem all afternoon. The first time you use M280 on heater 3 after using the pin for something else, there is a delay of up to about 2.5 seconds before the PWM appears.

The problem turned it to be an undocumented bug in the PWM3 subsystem on the SAM4E chip (I haven't checked whether other channels or the SAM3X chip are affected too). The PWM counter is supposed to be reset when you enable the channel, but that doesn't happen.

I eventually found a workaround, which is implemented in the 1.17dev4 firmware release. Alternatively, use the heater 4 channel instead of heater 3. That will avoid the problem if you are using a Duet WiFi - not sure about the wired Duets though.

Btw you can turn off the servo pulses by sending M280 P3 S-1.

Edited 1 time(s). Last edit at 11/17/2016 06:00PM by dc42.

Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login