[Easy Servo] Z Tracking not working

I recently built and installed the hardware that goes along with the Easy Servo plugin and, while the servos are working correctly, I can't seem to get the Z Tracking working correctly. Whether or not I have Y axis inversion enabled, the camera always goes down rather than up. I have the following settings:

GPIO Numbers: Defaults
X Autohome Angle: 90
Y Autohome Angle: 85
X Axis Inversion: Enabled
Y Axis Inversion: Tried both
X/Y Sleep Time: Defaults
X Offset: 355mm
Y Offset: 101mm

I sliced a 200mm cylinder and printed in vase mode. When started, the camera looks like:

When completed, the current position is (X: 89, Y: 91) no matter whether inversion is enabled and it looks like:

If it makes any difference, I'm using these servos. Can anyone suggest what might be going on?

Thanks,
Craig

Does anyone have a suggestion for how to get help? Maybe a good way to contact the plugin's author?

You may check this:

and this:

BTW: Plugin authors homepages usually are always provided with the plugins within the Plugin Manager of OctoPrint.

Yes. I'm aware of the GitHub project and have even pulled down the sources from there. With that said, there is no obvious way to contact the author in the project. In a case like that, is it best to use the Github user's email address to attempt to contact the author?

Either you open a ticket at github or maybe @jneilliii (one of the authors) get notice of this thread.

I just aided @FranFran in writing that plugin, you'd get better support from him.

2 Likes

Hi,

Did you configured the Z-Tracking offsets in the settings ?
Please check this if not done

1 Like

Thanks for responding @FranFran . I did set up Z Tracking. Hopefully I did it correctly. From my original post:

GPIO Numbers: Defaults
X Autohome Angle: 90
Y Autohome Angle: 85
X Axis Inversion: Enabled
Y Axis Inversion: Tried both
X/Y Sleep Time: Defaults
X Offset: 355mm
Y Offset: 101mm

I'm happy to do whatever I can to help with the effort. I was considering adding additional logging inside the plugin, but wasn't quite sure what I should even be looking for.

Sorry, I did not read well :smiley:
I'm checking my code and will notify you for the updates !

No worries! I'm happy to help in any way that I can. I think your project is very cool. I also created an adapter to tie together my previous camera mount arm with your pan tilt setup. Pan Tilt Camera Mount by csete - Thingiverse

2 Likes

I love it! You could post it as a "remix" if you want, but it's not a big deal.

So the way the "z-tracking" is working is that it is trying to figure out where, in Z, is your nozzle placed.
But it cannot make any difference if the Z coordinates are relative, or absolute, and is hard to track if relative. Maybe that it was the case during your print ?

You could try to see if the camera if following the print head by typing "G0 Z100 F2000", "G0 Z20 F2000" in the terminal, after making sure that you are in absolute positionning.

Of course, that could be a bug from my calculation. In this case, I'm giving you the same plugin, the only difference is that it will be logging the computed angle in the logs of octoprint that you can send me if it's not working. Here is the .zip file:

OctoPrint-EasyServo.zip (3.1 MB)

You can install it from the plugin manager.

Thank you very much for your interest !

I tried to make my design a remix and it didn't seem to work. Not sure what happened there... probably one of the never-ending issues with Thingiverse :slight_smile: I can give it a try again.

I will give things a try with the additional logging. I hadn't considered just using Z position commands in the terminal rather than actually doing a tall print. That may speed up my ability to make sense of this.

1 Like

@FranFran - So far I'm not having much luck collecting more information for you. I installed the updated plugin and set the logging level of the plugin to DEBUG. I don't see a separate Easy Servo log file and all I see in octoprint.log is:

2021-08-04 13:21:10,094 - octoprint.plugins.EasyServo - INFO - The libraryUsed is pigpio
2021-08-04 13:21:10,096 - octoprint.plugins.EasyServo - INFO - Initializing pigpio
2021-08-04 13:21:10,099 - octoprint.plugins.EasyServo - INFO - <pipio.pi host=localhost port=8888>
2021-08-04 13:21:10,103 - octoprint.plugins.dashboard - INFO - Dashboard started

I don't see anything else no matter whether I change the Z height using G0 or change the camera angle manually. In addition, it doesn't seem like the camera angle is even changing while there is Z movement at all now. It will make an initial angle change to the camera at the beginning of the Z movement, but nothing after that.

Suggestions on what to try next?

Was the z tracking activated ? If no, there is an issue that doesn't activate it in the backend

I did turn on the z tracking explicitly, since it seemed to "forget". (I'm assuming that is the issue you are referring to?)

Yes, it does "forget" the z-tracking option if the server is restarted but should not if the webpage is just refreshed.
I'm getting the logs from my side, that should look like this:

From the python code, the condition to call the function computing (and then logging in the .zip I provided you) the angle is pretty self-explaining:

So the only thing that is left is that maybe you're using Pimoroni rather than Pigpio library ?
I didn't made z-tracking available for this library for some reasons, but I could absolutely enable it for this library in the next version if that's your case.

I'm absolutely using pigpiod as can be seen from the very limited logging I added above.

I can manually alter the pan/tilt from the control panel. Before installing the version you provided with additional logging, the z tracking attempted to work, but was backward. With the version with additional logging installed, it doesn't seem to do anything. And as I mentioned, I'm not really seeing any significant logging from the plugin.

I'm open to other suggestions at this point.
Thanks,
Craig

Hey @csete .
Sorry for the late reply but my servo motors were not working anymore and got some issues on my printer, so my motivation wasn't on the highest... But I managed to make everything work again so I'll ensure myself that the z-trackin works before publishing the next release.

No worries @FranFran . I've been busy with other things as well. Just let me know if there is anything I can do to help with or test.

Craig

Hey @csete !
I think that I solved the bug as well as some others that were on the road. If you wish to test it, you can install it from zip in the "devel" branch. I noticed that the angle calculation was totally wrong, so the approach is slightly different now, you will need to measure the X distance between the camera eye and the bed center, the Y offset between the eye of the camera and the bed (currently called offset over bed, but this name is not right), and the Y offset between the bed and the center of rotation (position of the servo, and same, bad name for now. It's called offset under bed..)
Thanks and sorry for making you wait!