Welcome! Log In Create A New Profile

Advanced

RAMPS with solenoid for air pressure extrusion

Posted by jessicabrenner 
RAMPS with solenoid for air pressure extrusion
January 11, 2015 09:35PM
Hello,

I'd like to open and close a solenoid valve using the RAMPS controller. The solenoid valve will act as a second extruder. Is there a way for RAMPS to open and close the solenoid valve easily (without heavily modifying the code or adding extra electronics)? The valve just needs 12V (or 24V depending on which solenoid valve I use) whenever extrusion is necessary.

Thanks,
Jessica
Re: RAMPS with solenoid for air pressure extrusion
January 12, 2015 07:19AM
there is no way to connect a solenoid to a ramps without extra electronics.

Its just a arduino see [playground.arduino.cc] to see how to connect a 5v io line to a 12v high current solenoid.

Then you still have to control it...

A m42 command on the IO pin will work. but how your going to generate gcode with that in it will require coding.

Edited 1 time(s). Last edit at 01/12/2015 07:20AM by Dust.
Re: RAMPS with solenoid for air pressure extrusion
January 13, 2015 12:56AM
Is there a way to use the 2nd extruder heater (D09) output pin to drive the solenoid? What about using one of the second extruder's pins? I know that these options would require a bit extra code, but would this be possible? What are the voltage outputs of the pins I suggested?

Alternatively, using extra electronics, I can use an H-Bridge. If going with this option, should I look to modify the slicer code, or the code that goes on the RAMPS? I'm a little confused with all the different software (pronterface, slic3r, and marlin).
Re: RAMPS with solenoid for air pressure extrusion
January 13, 2015 05:48PM
Yes, you could use D9 to drive a 12V solenoid (with a current demand of no more than about 5A 3A) if you are not using it for a hot end or a fan. You must connect a flyback diode in parallel with the solenoid, otherwise you are likely to destroy the mosfet. Any silicon rectifier diode with a current rating as high as the current taken by the solenoid (or higher) will do. You should be able to find an option in Marlin firmware to drive a cooling fan from those pins, and you can use the same option to drive a solenoid. Then you can use command M106 S255 to turn the solenoid on, and M106 S0 to turn it off.

EDIT: bear in mind that D9 and D10 are both fed by the same 5A polyfuse. Therefore, if you energise the solenoid and the hot end at the same time, then the total current draw of both should not be much greater than 3A (because the stepper motors will need at least about 1A).

Edited 2 time(s). Last edit at 01/13/2015 05:57PM 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].
Re: RAMPS with solenoid for air pressure extrusion
January 13, 2015 11:43PM
Thanks a lot dc42! I'll look into that. My next step is to figure out how to edit the software to do what I want. If I understand correctly, the slicer software creates the Gcode, so I must edit the slicer program so that it outputs M106 in the gcode where I want it. Then I must edit the Marlin firmware to interpret the M106 code I think and subsequently turn on D9 when I need it to... or something. Its not clear to me right now, but I'll get it with a bit more reading.
Re: RAMPS with solenoid for air pressure extrusion
January 14, 2015 04:16AM
I think the default configuration for Marlin may already be to drive D9 with PWM according to the S parameter in the M106 command. In which case, you won't need to change Marlin.



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].
Re: RAMPS with solenoid for air pressure extrusion
January 14, 2015 02:46PM
Ok that makes sense. So I should edit the program that makes the gcode (which is the slicer) from the STL file. Alternatively, would I just be able to edit the gcode in TextEdit or something before sending it to the ramps board? I was thinking maybe there is a simple solution where I can just Find & Replace something in the gcode so that the M106 command (and anything else that is necessary) will place itself where it needs to in the code.
Re: RAMPS with solenoid for air pressure extrusion
March 28, 2015 03:47PM
So I ended up using an I/O pin to control an h-bridge to control the solenoid. I made some code that would take g-code from slic3r as input, and output modified g-code that would turn the I/O pin on and off where needed. Worked great except the flow rate was really variable because the pressure was not regulated.
Re: RAMPS with solenoid for air pressure extrusion
March 13, 2016 01:19PM
Hi,

I am very new at 3D printing and have the same issue: I am building a dual extruder printer using solenoid valves and RAMPS 1.4.
I tried to change the Marlin code so that it would stop extruding when changing extruder or when no E was present in the gcode line (or E=0) but seem to have failed.
I am now trying to make a program taking the g-code from Slic3r as an inout and going through the commands and adding commands stopping the extrusion and starting it automatically but can't seem to figure out how.

How can I edit a g-code file in C?
How can I go through the lines one by one and check if it should be extruding?
How cna I add my own commands automatically?

Sorry for all those questions, I really hope someone can help.

Kind regards
Sorry, only registered users may post in this forum.

Click here to login