Panning dual extruder setup and configuration
-
Hello,
Recently i've found nice project which i'd like to try out on my printer https://www.thingiverse.com/thing:1362557
Its a digital servo based panning dual extruder.
Why I write here is that, I'd like to ask for some help in wiring the servo to my v1.0 Duet and setting proper G&M codes in configuration. So far i've found basic information about M280 P# S50 and M307 H# A-1 C-1 D-1.
I have tower pro mg-16R servo and I want to use HEATER3 to control it.
how should the configuration file look like to make it work?
Any help would be greatly appreciated! -
I haven't had a chance to play around with hobby servos on Duet yet, but there is this guide on the wiki: https://duet3d.dozuki.com/Wiki/Using_servos_and_controlling_unused_IO_pins
Does that help?Ian
-
That's the site I'm actually stuck on, becouse I need to know which command (M42 or M280) to use to control servo via pin no. 8 (heater 3) and what "Pnnn Pin number" for M42 or "Pnnn Servo index" for M280 would be if using pin no.8
-
@guesswhoo If you are controlling a servo then use M280, it makes it simpler to configure (it is possible to use M42, with a specific PWM frequency, but easier to use M280)
On Duet 2 in RepRapFirmware 2.x the pins are assigned to functions by default, and they need to be removed from their default function before being assigned to an alternative one.
In this case you want to use heater 3. so from the documentation:
Disable the heater using M307 H# A-1 C-1 D-1 to make the pin available, where # is the heater number, and make sure that no tool is configured to use that heater.
so M307 H3 A-1 C-1 D-1
Then you want to configure it as a servo so from the documentation:
Example
- M280 P1 S50
S values below 200 are treated as angles, and 200 or greater as the pulse width in microseconds.
The optional I1 parameter causes the polarity of the servo pulses to be inverted compared to normal for that output pin. The I parameter is not remembered between M280 commands (unlike the I parameter in M106 commands), so if you need inverted polarity then you must include I1 in every M280 command you send.
The servo index is the same as the pin number for the M42 command
So
M280 P3 S50 should move your servo.
-
T3P3Tony, It works
but only with M42 command, the M280 does nothing. Anyway I'd call it enough for me. One more question about M42's "Use M42 Px Sy to set pin x to value y. The S field may be in the range 0..1 or 0..255" - the value of "S" corresponds to pulse width in microseconds or something other?