sanguinololu 1.3a expansion pins
February 13, 2016 04:07AM
Hi all, can anyone please throw some light on how to contol the sanguinololu expansion pins with gcode. Let me expand a little, I am using an computor power supply to power my printer and I would like to use a gcode command to break the connection of the green and black power supply wires to turn off the power supply on completion of a job, i.e. a post scipt in kisslicer for all jobs. I am sure that this is a simple task using a couple of pins to switch a relay or something, but after hours of trawling the web, I cannot find out how can some kind person throw some light on this subject/problem.
Re: sanguinololu 1.3a expansion pins
February 13, 2016 06:23AM
Choose a pin

control that ping with M42 P{pin number} S{value} where you want S of 0 or 255
NB D12 is miss labelled, its actually D4

eg presume your going to use D4 (labelled on most boards as D12)
Connect D4 to the green power on wire, leave that ground wire it used to use disconnected, you don’t want it.
add M42 P4 S0 in you gcode start file to turn on the supply
add M42 P4 S255 in your gcode end file to turn off the supply

(this on and off may be reversed.. was a long tome ago when I played with this, I don't have atx power supply any more)

NB While power supply is off, SL board gets power from USB cable. If you don’t have usb connected your going to have to do something else.

Edited 1 time(s). Last edit at 02/13/2016 06:24AM by Dust.
Re: sanguinololu 1.3a expansion pins
February 15, 2016 03:04PM
Thank you Dust, I will try your suggestion, as I said before I use kisslicer to produce my gcode and so I can enter the swith on code in the prefix gcode and the switch off in the post fix I can't believe it could be so easy. I will try tommorow .

many thanks.
Re: sanguinololu 1.3a expansion pins
February 17, 2016 03:18AM
Hi Dust, thanks again, I set up the printer and gcode as you suggested and like magic it worked first time.
Re: sanguinololu 1.3a expansion pins
February 21, 2016 09:50AM
Hi Dust, as I said before I set the two lines of code into kisslicer prefix and postfix and both lines work perfect but the line imedietly preceading the switch off i.e.

Kisslicer Prefix code:
; [mm] mode
; absolute mode
;switch on power
M42 P4 S0
; Home
; Heated bed control
M190 S

Kisslicer Postfix code:
; Maybe cool the bed?
M140 S0
; Maybe move to some safe location?
G1 F1200 X0.00 Y0.00 Z
; Switch off power?
M42 P4 S255

actual program gcode:
M42 P4 S0
M190 S

M104 S0

M140 S0

G1 F1200 X0.00 Y0.00 Z21.95

M42 P4 S255

is skipped and power is turned off leaving the hotend and bed cooling whilst still touching the part, any suggestions, I have tried a blank line after the part gcode end and the homing line command above and another after it before the power off command but it still skips the homing line?.
Re: sanguinololu 1.3a expansion pins
February 21, 2016 10:34AM
I'm no expert here, but you might want to put an M109 (with appropriate params) before your M42.

M104 sets target temp and then continues. Obviously G1 is also immediately returning and acting on the next command.

If you so a M109 (which sets target temp and then waits to reach the temp), I assume that it will let the G1 execute first and then will wait for target temp to be reached before executing your M42 commands which will then turn of the printer.

An added advantage of this is that if you have a fan/fans, as you ware waiting for the extruder to cool with power still on, the fan(s) will still be working.

Good luck,

Sorry, only registered users may post in this forum.

Click here to login