Setting tool offset using USB microscope
-
@droftarts said in Setting tool offset using USB microscope:
@Danal said in Setting tool offset using USB microscope:
Second, it is SLOW.
Are you doing any post-capture/pre-recognition processing of the image? You can convert colour images to greyscale or black and white (with a threshold level), and even use the black and white version as a mask. This will reduce the amount of image recognition processing massively. I can't say I've tried this myself, just read about it.
Ian
Yeah, that's all very fundamental, always grayscaling, trying different kinds of blur and threshold and mask and... Some do perform better than others, but the best still have highly variable "search" times that are extremely sensitive to the tuning parameters vs. the image.
-
@tekstyle said in Setting tool offset using USB microscope:
(not connected to the duet2. not sure how i would do it).
You can't. Don't connect it. It is really a stand-alone PI, just happens to be built with the Duet image as a start.
i followed this tutorial to set up duetpi on raspberry pi 3. took out the card and put it into the raspberry pi. powered it up, all i get is an endless list of EXT4-fs error lines after line. been doing this for the past 2 hours. not sure if I did something wrong?
Followed the Duet "etch" tutorial? And edited wpasupplicant.conf? And did NOT format when windows complained about the card after etching?
That last bit is the most important. The card is partitioned, with a windows readable "boot" partition and a much larger Linux partition. Windows tries to assign a drive letter to that Linux partition, balks, and asks to format it. Which you must always decline,
EXT4-fs is the file system that windows doesn't like, and asks to format. That certainly seems to relate to those error messages.
-
@Danal said in Setting tool offset using USB microscope:
@tekstyle said in Setting tool offset using USB microscope:
(not connected to the duet2. not sure how i would do it).
You can't. Don't connect it. It is really a stand-alone PI, just happens to be built with the Duet image as a start.
i followed this tutorial to set up duetpi on raspberry pi 3. took out the card and put it into the raspberry pi. powered it up, all i get is an endless list of EXT4-fs error lines after line. been doing this for the past 2 hours. not sure if I did something wrong?
Followed the Duet "etch" tutorial? And edited wpasupplicant.conf? And did NOT format when windows complained about the card after etching?
That last bit is the most important. The card is partitioned, with a windows readable "boot" partition and a much larger Linux partition. Windows tries to assign a drive letter to that Linux partition, balks, and asks to format it. Which you must always decline,
EXT4-fs is the file system that windows doesn't like, and asks to format. That certainly seems to relate to those error messages.
Yup. I followed the tutorial on duet exactly. Only thing was inside the boot partition, it already contained a wpasupplicant.conf file. I Openned itnin notepad and editted it with my ssid and PW. Pulled the card out and popped it in to the rpi. Then powered it up. Will try again tonight
-
@tekstyle said in Setting tool offset using USB microscope:
@Danal said in Setting tool offset using USB microscope:
@tekstyle said in Setting tool offset using USB microscope:
(not connected to the duet2. not sure how i would do it).
You can't. Don't connect it. It is really a stand-alone PI, just happens to be built with the Duet image as a start.
i followed this tutorial to set up duetpi on raspberry pi 3. took out the card and put it into the raspberry pi. powered it up, all i get is an endless list of EXT4-fs error lines after line. been doing this for the past 2 hours. not sure if I did something wrong?
Followed the Duet "etch" tutorial? And edited wpasupplicant.conf? And did NOT format when windows complained about the card after etching?
That last bit is the most important. The card is partitioned, with a windows readable "boot" partition and a much larger Linux partition. Windows tries to assign a drive letter to that Linux partition, balks, and asks to format it. Which you must always decline,
EXT4-fs is the file system that windows doesn't like, and asks to format. That certainly seems to relate to those error messages.
Yup. I followed the tutorial on duet exactly. Only thing was inside the boot partition, it already contained a wpasupplicant.conf file. I Openned itnin notepad and editted it with my ssid and PW. Pulled the card out and popped it in to the rpi. Then powered it up. Will try again tonight
you won't believe this. I used my other laptop running windows 8, win32diskimager to load the duetpi image. and that worked. i have no idea why using balena etcher on win 10 doesn't work.
-
@wilriker said in Setting tool offset using USB microscope:
@dc42 Would a
G10 L10
to set tool offsets relative to current position desirable (makingG10
even more complex OTOH)?Not necessary, because you can already do that using the object model.
@tekstyle said in Setting tool offset using USB microscope:
Tool offset with limit switches would be great.
Already supported if you can configure the limit switch as a Z probe. See the G30 S-2 command.
-
@wilriker said in Setting tool offset using USB microscope:
@dc42 Would aG10 L10
to set tool offsets relative to current position desirable (makingG10
even more complex OTOH)?Also, any scripting environment that is complex enough to do multi-tool alignment with "one button" is going to have basic math. And that's all that is needed to produce the final G10 commands. Subtract T0's coordinates from T1s, etc, etc. So, no, G10 does not need any changes.
P.S. That's why Python at the moment... a better place might be conditional G-Code, but that does not yet work from the Pi DSF... so having a single script have access to the camera, and the printer, requires something on the attached Pi at the moment. Python seems very suitable for the required image processing.
@tekstyle said in Setting tool offset using USB microscope:
Tool offset with limit switches would be great.The "Zonly.py" script in the https://github.com/DanalEstes/PythonDSF/ repository is touchplate based. It is still very much experimental 'under development'. Still maybe worth looking at for ideas.
-
@Danal said in Setting tool offset using USB microscope:
P.S. That's why Python at the moment... a better place might be conditional G-Code, but that does not yet work from the Pi DSF
Expressions within GCode commands do work from the Pi DSF in RRF 3.04. It's meta commands such as 'if' and 'while' that don't yet.
-
@dc42 said in Setting tool offset using USB microscope:
@Danal said in Setting tool offset using USB microscope:
P.S. That's why Python at the moment... a better place might be conditional G-Code, but that does not yet work from the Pi DSF
Expressions within GCode commands do work from the Pi DSF in RRF 3.04. It's meta commands such as 'if' and 'while' that don't yet.
Good point. Lots of progress being made very quickly. Which is quite exciting!!
It is probably more clear to say that touchplate oriented stuff can/could/will be done in Cond G-Code at some point very soon now as that all progresses. On the other hand, Camera based stuff seems like it will be on the Pi for the foreseeable planning horizon.
-
@tekstyle said in Setting tool offset using USB microscope:
you won't believe this. I used my other laptop running windows 8, win32diskimager to load the duetpi image. and that worked. i have no idea why using balena etcher on win 10 doesn't work.
Good news is you are up and have a reproducable path.
Odd thing is I use W10 with Balena for all my SD cards for PIs, and I probably build two a week. Well, maybe one a week. Anyway, it has been trouble free.
Anyway, glad to see you have a working SD, feel free to ask other questions, I'm eager for testing of the camera based scripts in particular.
Sometime today I'm going to post an entirely new set of "machine vision" scripts... had some breakthroughs in the last 24 hours. Look for a new top-level post in a few hours.
-
Unopenned terminal typed CD ~/Desktop/Duet
My folder is on the Desktop and I renamed it to Duet. Didn't find the path. So I just right clicked the .sh file and selected open in terminal. I'll see how it goes after work.
-
pi@duet3:~/Desktop/Duet $ python3 toolAlignImage.py
Traceback (most recent call last):
File "toolAlignImage.py", line 11, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'this is what i am getting when i try to run toolAlignImage.py. i have the camera plugged in as well when I attempt to run the *.py file. it is not connected in any way to the duet2wifi for obvious reasons.
-
That means that OpenCV is not installed.
You can re-run the installOpenCV.sh any number of times. It is long enough that you may need to ensure your Pi does not go to sleep or otherwise time out. It does produce yellow warnings at various points; it should not produce any red failures.
Important If you re-run it, when it finishes, copy the last dozen or so lines of output and post them here.
Also, see this post: https://forum.duet3d.com/topic/15026/tool-alignment-machine-vision-some-progress
I'd highly, highly recommend switching to the code described in that thread. You will still need OpenCV...
-
@Danal said in Setting tool offset using USB microscope:
That means that OpenCV is not installed.
You can re-run the installOpenCV.sh any number of times. It is long enough that you may need to ensure your Pi does not go to sleep or otherwise time out. It does produce yellow warnings at various points; it should not produce any red failures.
Important If you re-run it, when it finishes, copy the last dozen or so lines of output and post them here.
Also, see this post: https://forum.duet3d.com/topic/15026/tool-alignment-machine-vision-some-progress
I'd highly, highly recommend switching to the code described in that thread. You will still need OpenCV...
How do u turn off sleep in duetpi? I can't seem to find it in any menu unlike the raspbian os.
-
-
i tried to disable sleep. i think it worked. then during the install with the file from https://github.com/DanalEstes/installOpenCV, it was going well for a few hours until it froze. wished i can copy and paste what happened.
i am using a 32gb sandisk. i do not have an original duetpi card and i am using a raspberry pi model 3B
-
@tekstyle said in Setting tool offset using USB microscope:
i do not have an original duetpi card and i am using a raspberry pi model 3B
Do you mean physical card? Any "brand name" card should do fine. Most of mine are Sandisk. I'm running a 16G and I have everything in the world installed and it is about 1/2 full.
Do you mean content? When you download the full image from Duet, and etch it to a card, that is the same content they ship. I recommend doing that for the Pi in a D3 (instead of some other raspbian image).
-
@Danal said in Setting tool offset using USB microscope:
Do you mean content? When you download the full image from Duet, and etch it to a card, that is the same content they ship. I recommend doing that for the Pi in a D3 (instead of some other raspbian image).
Yes, I mean physical card. What do you mean by doing that for the Pi in a D3? So far, I've downloaded the deutpi image file and using baleena etcher.
-
@tekstyle said in Setting tool offset using USB microscope:
Yes, I mean physical card. What do you mean by doing that for the Pi in a D3? So far, I've downloaded the deutpi image file and using baleena etcher.
That's the correct thing to do.
I have no idea why yours hangs. Multiple people have run that script, and there is absolutely nothing in it that does anything to any system settings or similar. All it does is install software.
Since that does make the SD card fairly active, you may want to try a physically different card. Long shot, but worth a try.