svenhb / GRBL-Plotter

A GCode sender (not only for lasers or plotters) for up to two GRBL controller. SVG, DXF, HPGL import. 6 axis DRO.
https://grbl-plotter.de/
GNU General Public License v3.0
696 stars 176 forks source link

Z axis servo reveresed #183

Closed DFBRews closed 3 years ago

DFBRews commented 3 years ago

Hello I am running the hex file for a plotter and the z axis servo movement is reversed I am very new to grbl and dont know how to proceed thanks

running an uno with v3 shield and have the signal for the servo into z + limit on the shield.

edit:

I believe I found a hex file that addresses this issue I will check it tomorrow and update

svenhb commented 3 years ago

Hi, to use the servo you need to create specific gcode (commands to control your grbl-controller) because you want to control a servo (via spindle-speed commands) instead of using a Z-axis. This can be done by importing graphics (HPGL, SVG, DXF) in GRBL-Plotter with specific settings. For servo, the yellow marked settings are important. To switch the up/down movement, just reverse the Pen-up / Pen-down values (in this case 200, 800) - which controles the servo position (possible range for this grbl-version is 0 to 1000 as I know). image

More example settings you find here: https://grbl-plotter.de/index.php?id=setups&setlang=en

DFBRews commented 3 years ago

Thanks for the reply Reversing the s800 and and s200 got the pen to move properly the issue I am having now is when the g code finish’s even though a pen up command is sent the pen stays down until I manually command it up

Thanks

Paul

Sent from my iPhone

On Feb 9, 2021, at 11:54 PM, Sven notifications@github.com wrote:

 Hi, to use the servo you need to create specific gcode (commands to control your grbl-controller), which can be done by importing graphics (HPGL, SVG, DXF) in GRBL-Plotter with specific settings. For servo, the yellow marked settings are important. To switch the up/down movement, just reverse the Pen-up / Pen-down values (in this case 200, 800) - which controles the servo position (possible range for this grbl-version is 0 to 1000 as I know).

More example settings you find here: https://grbl-plotter.de/index.php?id=setups&setlang=en

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

svenhb commented 3 years ago

You may have a short example code? I assume the problem is a final switch off of the spindle (M5). If so, I should change this bevavior if using a Servo. Perhaps you can add a M3 S800 (pen up) in the footer section, to lift the pen finally.

svenhb commented 3 years ago

The final M30 command is the reason, It switches off the spindle, this equals spindle speed = PWM value = 0. M2 or M30 is needed to mark the program end. This causes grbl to reset it's parser. I tried to set M3 S500 after M30, but it's too late, the servo has enough time to move down. I assume the only two solutions are

svenhb commented 3 years ago

Because i have the same problem at the moment, I made new version 1.5.6.1: https://github.com/svenhb/GRBL-Plotter/releases The possibility to skip the M30 command

DFBRews commented 3 years ago

thank you I will install it on Monday and see how it works and let you know. Thanks again for all the support

Sent from my iPhone

On Feb 12, 2021, at 2:19 PM, Sven notifications@github.com wrote:

 Because i have the same problem at the moment, I made new version 1.5.6.1: https://github.com/svenhb/GRBL-Plotter/releases The possibility to skip the M30 command

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

svenhb commented 3 years ago

I added a new option - Check new version: https://github.com/svenhb/GRBL-Plotter/releases Option to control the servo during setup of the Servo PWM values image

DFBRews commented 3 years ago

Thanks again for the help I am able to keep the pen up when the program is finished by removing the m30 completely from the footer and having the ignore m30 checked in the z servo box.

Sent from my iPhone

On Feb 27, 2021, at 7:52 AM, Sven notifications@github.com wrote:

 I added a new option - Check new version: https://github.com/svenhb/GRBL-Plotter/releases Option to control the servo during setup of the Servo PWM values

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

svenhb commented 3 years ago

The option to avoid sending "M30" keeps the servo-position on it's last position and will not send a "M5", which causes the firmware to apply a pwm-value of 0: See https://github.com/cprezzi/grbl-servo/blob/eggbot/grbl/spindle_control.c comment: // For servo send min. PWM instead of deactivate PWM