Welcome! Log In Create A New Profile

Advanced

External start switch / trigger

Posted by CaptainSpark 
External start switch / trigger
October 02, 2015 12:01PM
Hi,

I have made a small pen plotter that will draw a name on a card.
Now i would like to hack the Marlin Firmware in a way. That it holds the g code for the name writing and will automatically restart every time i place a new card.

Im having a sensor that is 5v in place, which i could hook up to the Arduino Mega.

I have looked at the code for marlin, but to be honest i was kind of demotivated by the shear size of it.

Does anyone know an easy way to link an sensor, as a start button? and how would it know what file to play?

Any input is welcome thanks!
Re: External start switch / trigger
October 04, 2015 06:53AM
Why not just use a small microswitch the card will press when in place and
is wired directly to the reset on the ramps(?).
I think the configuration.h has towards the end a custom m-code section.
I think also there are g-codes to load a file.

ie,
stick card in place.
Microswitch triggers reset switch, some sort of one shot pulse circuit that resets when the card is removed.
marlin restarts
autoloads file, (I think this might only be from sdcard?)


Please correct my mistakes,
Andrew

Edited 1 time(s). Last edit at 10/04/2015 11:12PM by friarfish.
Re: External start switch / trigger
October 05, 2015 04:30AM
No need to reset the controller everytime,
just check M23-M26 codes and write an endless -loop in the end-Gcode of your handwriting. You´d have to navigate through the LCD menu to resume printing, but with a little writing, it should be possible to use the encoder push button to resume.
-Olaf
Re: External start switch / trigger
October 07, 2015 04:43PM
Thanks Guys,

I'm checking the M23 and M26 codes. seems pretty straight forward to be honest.

So in the end of the G-code I load the same Gcode by sending M23 and the filename.
Next a M24 on switch to trigger.
This could give me control over the same or some sets of gcode. What about using an external arduino, doing some Gcode generation to be able to make adjsutments on the fly?

Does this work? can I get a serial port connection, just binding rx and tx from one to the other? I tried this a little but so far i was not extremely successful.

I think this would be nice, so i can customize my card to size on the fly, rather than make a new drawing, send it to a Gcode(cam) software, send to the Mega...
Re: External start switch / trigger
October 08, 2015 04:29AM
The filename should be short, as some hosts have problems with long filenames.
An arduino doesn´t do any slicing/scaling, you would need a set of scaled up g-codes on your SD-card that suites your needs.
-Olaf
Sorry, only registered users may post in this forum.

Click here to login