DIY-plotter pen lifting servo does not work

Hello everybody and especially Arduino CNC cracks

I built a small DIY drawing maschine and after getting all mechanics and hardware assembled I started to manually move arround all mobile parts on the maschine and got to 66.66% working. (X and Y axis full operable pen lifting servo on Z axis not working at all)

First of all what HW and SW do I have so far:

The maschine works with 2 NEMA stepper motors driven by TMC2208 drivers

limitswitches for X and Y axis

one SG90 microservo connected to Z axis

Arduino UNO board with CNC shield V3.0

SW so far for manual testing: UGS V2.1.18 and grbl 1.1 firmware on the Arduino

With the UGS application on my notebook connected via USB to the Arduino board I can move the X and Y axis and get homing to work properly with the limit switches.

With the lifting of the pen using the servo I got stuck and confused from such a lot of different guides on the web. What I understand so far is that for pen lifting the Z axis is used in a modified way inside the grbl firmware on the Arduino. my last attempt was using a modified grbl version called Grbl_Pen_Servo which I downloaded from github. I replaced it in the libraries folder of the IDE and uploaded the grbl again to the Arduino. After this I connected UGS and played around with the Jog controller and manually sending commands. On all the guides there are discribed two gcode commands (M3 and M5) for operate the servo in two directions. I send them manually to the plotter and nothing happens. Even the servo seems to be not connected because I can move it manually. The servo is connected to the Z axis limitswitch pin and is ok, I checked this with a servo testsketch. What I think is that the bug is in the grbl firmware and I have no clue how to locate it. Some hint pointed me to the spindle_control.c file in the grbl library but what do I need to change or adjust ???

can anybody help and push me to the right path ? thanks so far at least for reading my story

Not possible to pin point the problem out of Your post as no documentation is provided.

Please read and use How to get the best out of this forum - Development Tools / IDE 1.x - Arduino Forum

this is not my first post, I think I discribed well the configuration of my project. what additional information do you need ?

What Grbl code are you using to detect the switch and move the servo?

You posted a sallad of words. That’s not what the forum advice tells.

Please read the link in reply #2! It tells what You need to provide us. Where is schematics and where is the code?

I downloaded Grbl_Pen_Servo from github

if you need schematics and code then you do not understand what I am talking about. The code is Grbl_Pen_Servo and the servo is connected to Z+ (pin11) on the shield/Arduino

Does it have a test for just the servo and switch?

as homing works good the switches for X and Y are working. For the servo I uploaded a simple servo testsketch and this works

That makes it two of us. Good luck.

hello again, I finally improved a little on my servo control issue and got it move by using Z commands in the UGS application. Using the M3 and M5 command nothing happens. Can somebody guide me what I need to configuer in the grbl firmware? Please don´t ask me what I did so far, I just followed some guides which I found on the web but finally I removed the grbl library from the IDE and stored a new clean version of the Grbl_Pen_Lift version in the library folder. https://github.com/bdring/Grbl_Pen_Servo