Welcome! Log In Create A New Profile

Advanced

Speeding up servo pen up/pen down on pen plotter

Posted by Ohmarinus 
Speeding up servo pen up/pen down on pen plotter
June 15, 2019 07:31AM
Hi, I just realized there isn't a specific 'Gcode' subforum. Maybe that might be an interesting idea as I notice a lot of solutions to a problem come down to an issue related to the lack of knowledge about Gcode options.

Anyway, I have run into an issue where I have to find a solution for creating a 'delay' in my gcode for a pen up/pen down with a servo. Right now I use a M400 before and after the (for example) M280 P0 S40 gcode.

This causes long delays during the print and I think it can all go a bit faster/more dynamically.

Removing the M400 will totally mess up the system so I'm thinking maybe there are ways to do this, maybe by using a delay somehow? Now, I'm not familiar with delays and couldn't find much about this subject using gcode. I know there is 'G4 P[value]', would this be a place to start, or is there another solution?

I'm using Ramps 1.4 with Marlin 2.x bugfix and it's running really well. The reason why I'm using Ramps 1.4 now is because I am using TMC2208 stepper drivers and I am not sure how to use those with stealthchop on the CNC Shield v3.0 with GRBL. So M3 and M5 are out of the question anyway.

Did anyone tackle this servo delay issue before with success? I've seen a lot of videos on youtube of pen plotters running much more dynamically and I think it should be doable for me as well, I just don't know how (yet). In the future I'm also planning on adding a separate module for laser cuts with a separate stepper-driven Z-axis to adjust for material thickness but for now it's a dedicated pen plotter.

Here is a video showing the delay that the M400 command causes:
[www.youtube.com]

Edited 1 time(s). Last edit at 06/15/2019 07:44AM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Speeding up servo pen up/pen down on pen plotter
June 15, 2019 08:40AM
The issue is that servos aren't real axis so they aren't treated the same in marlin

So perhaps the answer is to make them stepper compatible
Hook up nano to the E step and direction lines and the servo, write a simple sketch that counts the steps up or down depending on direction to generate a absolute position for the servo

Then you could just use g1 e0 and g1 e255 (if absolute mode) and the firmware should do the moves in order and quickly etc
Re: Speeding up servo pen up/pen down on pen plotter
June 15, 2019 03:46PM
Quote
Ohmarinus
Hi, I just realized there isn't a specific 'Gcode' subforum. Maybe that might be an interesting idea as I notice a lot of solutions to a problem come down to an issue related to the lack of knowledge about Gcode options.

Anyway, I have run into an issue where I have to find a solution for creating a 'delay' in my gcode for a pen up/pen down with a servo. Right now I use a M400 before and after the (for example) M280 P0 S40 gcode.

This causes long delays during the print and I think it can all go a bit faster/more dynamically.

Removing the M400 will totally mess up the system so I'm thinking maybe there are ways to do this, maybe by using a delay somehow? Now, I'm not familiar with delays and couldn't find much about this subject using gcode. I know there is 'G4 P[value]', would this be a place to start, or is there another solution?

I'm using Ramps 1.4 with Marlin 2.x bugfix and it's running really well. The reason why I'm using Ramps 1.4 now is because I am using TMC2208 stepper drivers and I am not sure how to use those with stealthchop on the CNC Shield v3.0 with GRBL. So M3 and M5 are out of the question anyway.

Did anyone tackle this servo delay issue before with success? I've seen a lot of videos on youtube of pen plotters running much more dynamically and I think it should be doable for me as well, I just don't know how (yet). In the future I'm also planning on adding a separate module for laser cuts with a separate stepper-driven Z-axis to adjust for material thickness but for now it's a dedicated pen plotter.

Here is a video showing the delay that the M400 command causes:
[www.youtube.com]

I guess that's something to do with how Marlin implements M400 and/or M280, because the specification of M400 is that is delays processing of the following command until all moves have been completed. That's how we implement it in RepRapFirmware. Actually, with RepRapFirmware you wouldn't need the M400 commands, because the M280 commands would be synchronised to the movement queue.

So some of your options are to change firmware, for fix this behaviour in Marlin (or persuade the Marlin devs to), or do as Dust suggests, or use a stepper motor to raise/lower the nozzle.

Edited 1 time(s). Last edit at 06/15/2019 03:47PM 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: Speeding up servo pen up/pen down on pen plotter
June 16, 2019 06:36AM
Quote
dc42
Quote
Ohmarinus
Hi, I just realized there isn't a specific 'Gcode' subforum. Maybe that might be an interesting idea as I notice a lot of solutions to a problem come down to an issue related to the lack of knowledge about Gcode options.

Anyway, I have run into an issue where I have to find a solution for creating a 'delay' in my gcode for a pen up/pen down with a servo. Right now I use a M400 before and after the (for example) M280 P0 S40 gcode.

This causes long delays during the print and I think it can all go a bit faster/more dynamically.

Removing the M400 will totally mess up the system so I'm thinking maybe there are ways to do this, maybe by using a delay somehow? Now, I'm not familiar with delays and couldn't find much about this subject using gcode. I know there is 'G4 P[value]', would this be a place to start, or is there another solution?

I'm using Ramps 1.4 with Marlin 2.x bugfix and it's running really well. The reason why I'm using Ramps 1.4 now is because I am using TMC2208 stepper drivers and I am not sure how to use those with stealthchop on the CNC Shield v3.0 with GRBL. So M3 and M5 are out of the question anyway.

Did anyone tackle this servo delay issue before with success? I've seen a lot of videos on youtube of pen plotters running much more dynamically and I think it should be doable for me as well, I just don't know how (yet). In the future I'm also planning on adding a separate module for laser cuts with a separate stepper-driven Z-axis to adjust for material thickness but for now it's a dedicated pen plotter.

Here is a video showing the delay that the M400 command causes:
[www.youtube.com]

I guess that's something to do with how Marlin implements M400 and/or M280, because the specification of M400 is that is delays processing of the following command until all moves have been completed. That's how we implement it in RepRapFirmware. Actually, with RepRapFirmware you wouldn't need the M400 commands, because the M280 commands would be synchronised to the movement queue.

So some of your options are to change firmware, for fix this behaviour in Marlin (or persuade the Marlin devs to), or do as Dust suggests, or use a stepper motor to raise/lower the nozzle.

This sounds like a plan to try out. I've seen you promote the RRF around here a couple of times the past week and it had already gotten my attention. Does RRF work well with CoreXY and TMC2208 drivers in UART mode?

Oh, I now see that I need to have an LCD on my printer to work with RRF, as stated in this guide:
[duet3d.dozuki.com]

I guess that means I'll first have to get an LCD. Maybe the solution that Dust posted might be something to look after. However, I don't have that much (not enough to start doing it) experience with that kind of a project so I'll have to start reading in to it this week.


http://www.marinusdebeer.nl/
Re: Speeding up servo pen up/pen down on pen plotter
June 16, 2019 12:08PM
Nice plotter!

I think there should be a servo delay setting, there was one for a deploy and retract of a servo bed probe. It could be set in milliseconds. Yep, found it, SERVO_DELAY in configuration.h. default value is 300ms. So for deploy and retract together is 600ms.
You can try something like 50ms and see if that leaves a mark on the paper, a dot means too long and a line too short.

Edited 1 time(s). Last edit at 06/16/2019 12:10PM by imqqmi.


--
Kind regards
Imqqmi

NFAN CoreXY printer:
[reprap.org]
Re: Speeding up servo pen up/pen down on pen plotter
June 16, 2019 04:47PM
Quote
Ohmarinus
Oh, I now see that I need to have an LCD on my printer to work with RRF, as stated in this guide:
[duet3d.dozuki.com]

You do not need an LCD to run RepRapFirmware (why did you think that?), you can use the built-in web interface on a smartphone, tablet or PC (or all 3 at once), or even a PC connected over USB. But you do need a compatible 32-bit controller. One option is the Duet Maestro, which has five UART-controlled TMC2224 drivers (same as TMC2208 in a different package) on board.

Edited 1 time(s). Last edit at 06/16/2019 04:49PM 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: Speeding up servo pen up/pen down on pen plotter
June 16, 2019 06:28PM
Hi
I belong to a small number of veterans and we have just discovered 3D printing . We have a mingda 6C printer but it went crazy and the hot end burnt up. We are looking to retrofit with a smoothie board. We do not have the expertise when it comes to programming. Can anyone help to steer us in the right direction as we would like to just pull the old Andciv 3 generation board out and replace it and be on our way . Is this possible as we are in the older age bracket but are keen to started. We have tried new thermistors and elements but when we turn the printer on we cannot control the heater and it over heats. Can anyone please advise .
Thank you
Re: Speeding up servo pen up/pen down on pen plotter
June 17, 2019 02:39AM
Quote
6RAR
Hi
I belong to a small number of veterans and we have just discovered 3D printing . We have a mingda 6C printer but it went crazy and the hot end burnt up. We are looking to retrofit with a smoothie board. We do not have the expertise when it comes to programming. Can anyone help to steer us in the right direction as we would like to just pull the old Andciv 3 generation board out and replace it and be on our way . Is this possible as we are in the older age bracket but are keen to started. We have tried new thermistors and elements but when we turn the printer on we cannot control the heater and it over heats. Can anyone please advise .
Thank you

I can help you if you upgrade to Duet electronics, but not Smoothieboard. For help with Smoothieboard, try [reprap.org].



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].
VDX
Re: Speeding up servo pen up/pen down on pen plotter
June 17, 2019 02:39AM
... you can control the heater separate from the other tasks.

I've done this with my CNC-"respstraps" and industrial temperature controllers or DIY-modules for the extruder and bed heaters.

You only have to remove all "waiting on temperature to set" GCodes ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Speeding up servo pen up/pen down on pen plotter
June 19, 2019 06:31PM
Quote
imqqmi
Nice plotter!

I think there should be a servo delay setting, there was one for a deploy and retract of a servo bed probe. It could be set in milliseconds. Yep, found it, SERVO_DELAY in configuration.h. default value is 300ms. So for deploy and retract together is 600ms.
You can try something like 50ms and see if that leaves a mark on the paper, a dot means too long and a line too short.

Awesome! Your tip worked really well! Setting the delay to exactly 50 was the best solution! Works like a treat. Also thanks for the compliment.

Here some more footage of the machine printing some with the new settings, including an overview and closeups of several parts of the machine while printing a stress-test geometric pattern:
[youtu.be]

Edited 1 time(s). Last edit at 06/19/2019 06:32PM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Speeding up servo pen up/pen down on pen plotter
June 20, 2019 08:56AM
Ecellent! Looks great!

One thing though the toolpaths don't seem to be very efficient to me, a lot of pen up/down movement that doesn't seem necessary to me. Maybe you can join paths so it can draw faster?


--
Kind regards
Imqqmi

NFAN CoreXY printer:
[reprap.org]
Re: Speeding up servo pen up/pen down on pen plotter
June 20, 2019 09:36AM
Quote
imqqmi
Ecellent! Looks great!

One thing though the toolpaths don't seem to be very efficient to me, a lot of pen up/down movement that doesn't seem necessary to me. Maybe you can join paths so it can draw faster?

I agree, this should be possible. Sadly when I export it to DXF from Rhino, the import function of Inkscape turns it into loose paths... sad smiley

For the 'crosshatch' I used the eggbot plugins in Inkscape, sadly those too generate only loose lines. There should be another way to make crosshatches that are continuous like the infill setting that Cura has that turns the infill lines into a 'snake'.

Edited 1 time(s). Last edit at 06/20/2019 09:38AM by Ohmarinus.


http://www.marinusdebeer.nl/
Re: Speeding up servo pen up/pen down on pen plotter
July 12, 2019 05:44AM
So, we're one month further. I have completely hacked the shizzle out of the gcodetools.py extension which now adds functionality specific to pen plotters and could potentially add an unlimited amount of tools (as much as you can fit anyway). I have been battling an error I couldn't discover anywhere and apparently the inkscape files save a certain amount of metadata that conflicts with adding new orientation points and tools.

I have been going completely nuts for three days to find out there was a bug in the template file of inkscape. So after fixing that I could just go and fix the rest of the code and orientation model for the extension and have come to a very satisfying result:
[www.youtube.com]

All I need to do now is to find myself some good paper and build a new machine that can handle higher speeds without leaving squiggly lines. I might be able to tweak some jerk and acceleration settings in the current Marlin firmware but I have no experience in that and couldn't find any definitive answer to how to tune those specific values. I'm pretty sure once I get the jerk and accel settings correctly set, I might be able to achieve higher speeds without losing precision.

The mechanical frame I'm using has low quality v-slot rollers and the strings have more flex in them than I had anticipated (bought them from RobotDigg so I thought they were good), so the next machine will have very sturdy linear guide rails by machine company Franke will have a form factor of almost 100x50cm and GT2 fiberglass reinforced belts.

I'd like to hear what you think. Once I can call the machine 'finished' I will make a new topic in the CoreXY folder to explain and show the machines capabilities.


http://www.marinusdebeer.nl/
Sorry, only registered users may post in this forum.

Click here to login