Camera For Touchoff
Camera View:
The camera needs to be attached firmly and it is wise to spend the time adjusting it so the crosshairs point to the same place when Z is at the top of travel and also at the bottom of travel. Make sure that the crosshairs are aligned properly with the X and Y axes.
Install any dependencies required for Qtvcp (it is supported by default in the new LinuxCNC Buster ISO).
The attached file needs to be copied to the machines config directory.
Edit the machines ini file by adding these lines to the end of the [DISPLAY] section:
EMBED_TAB_NAME = Camera
EMBED_TAB_COMMAND = halcmd loadusr -Wn camera qtvcp -c camera -x {XID} cam_align
EMBED_TAB_NAME = Camera
EMBED_TAB_LOCATION = ntb_preview
EMBED_TAB_COMMAND = halcmd loadusr -Wn camera qtvcp -c camera -x {XID} cam_align
# for the camera tab
[MDI_COMMAND_LIST]
# X and Y are the offset values from the crosshairs to the torch
MDI_COMMAND = G10 L20 P0 X0 Y0
# origin move
MDI_COMMAND = G0 X0 X0
The Mark Edge button and the Goto Origin button will have their names changed to Set Origin and Set 0o Rotate depending on what function they are able to perform.
To touch off a sheet at an angle:
jog to a point along one of the edges that intersects the origin corner of the sheet
press Mark Edge
jog to the origin corner of the sheet
press Set Origin
the X and Y axes are now touched off to zero
You could then press Goto Origin if you wish
To touch off at a zero degree angle with the torch as the origin point:
jog to the point you want the origin
press Mark Edge
Set Origin
the X and Y axes are now touched off to zero
You could then press Goto Origin if you wish
To touch off at a zero degree angle using the current origin point:
press Mark Edge
Set 0o Rotate
the X and Y axes are now touched off to zero
You could then press Goto Origin if you wish
To zoom:
Press the Zoom + or Zoom - button
Holding either button will cause a continuous zoom.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
It also worked on a virtual machine with the inbuilt camera on my Mac.
Please Log in or Create an account to join the conversation.
very nice.
Can this be used with a laser pointer?
Do you have to set the rotation by pressing buttons or does it calculate that?
Please Log in or Create an account to join the conversation.
Rotation is manual with a mouse, right button + scroll.
Please Log in or Create an account to join the conversation.
I think any compatible camera will work, the laptop camera worked too
Please Log in or Create an account to join the conversation.
Camera only.
Rotation is manual with a mouse, right button + scroll.
Another method is to find an edge down the back of the sheet, press a button, and then go to the origin corner and click touchoff and calculate the angle using some trig and adjust for the offset. That is much more accurate when a full sheet (say 2400mm x 1200mm or 3000mm x 1500mm) is used. I have done some work on that with my laser pointer extending some work by BigJohnT.
But with the camera, you should be able to implement edge detection and corner detection using opencv features. Imagine that! Just click one button "Align sheet" and let the machine do it all automagically. Let the camera wander around looking for edges then finally move to the origin corner.
Please Log in or Create an account to join the conversation.
Good question, I used it with a cheap'n'nasty "endoscope" usb camera I had lying around, similar to this
It also worked on a virtual machine with the inbuilt camera on my Mac.
Ah, good call. I guess a mechanical shutter to protect it from splashes would be nice, unless it has a decent focusing distance/long focal length.
Please Log in or Create an account to join the conversation.
Yeah, that would be easy to implement.
Camera only.
Rotation is manual with a mouse, right button + scroll.
Another method is to find an edge down the back of the sheet, press a button, and then go to the origin corner and click touchoff and calculate the angle using some trig and adjust for the offset. That is much more accurate when a full sheet (say 2400mm x 1200mm or 3000mm x 1500mm) is used. I have done some work on that with my laser pointer extending some work by BigJohnT.
There's project for you, Qtvcp uses opencv so it's half done.But with the camera, you should be able to implement edge detection and corner detection using opencv features. Imagine that! Just click one button "Align sheet" and let the machine do it all automagically. Let the camera wander around looking for edges then finally move to the origin corner.
Please Log in or Create an account to join the conversation.
There's project for you, Qtvcp uses opencv so it's half done.
It will be years before I have the time to play with stuff like that plus I much prefer directing software projects than coding them.
The story of my
Please Log in or Create an account to join the conversation.