Making a GUI for Aligning Feeder Positions and Saving the Values to a CSV file

More
14 Aug 2022 15:23 #249720 by my1987toyota
    This is a bit of an ambitious one for me I want to make a GUI and put in a selectable tab on Linuxcnc so I can
use the on board down look camera to align the feeders then save the positions to the Feeders CSV file.

The challenges needing to be addressed
1 Getting familiar with Gladevcp
2 make a small DRO display with the G53 Machine Coordinate System output while in the Feeders tab
3 make a Jog control in the tab to control the X, Y,  Z, and C axis while aligning
4 have a window that displays the real time down look camera image with cross hairs.
5 When the X and Y position is written to the Feeders CSV file it will apply an offset so while running a PnP program
   the picking head will be over the feeder component instead of the camera.
6 When the down look Camera is selected for feeder alignment it will use the saved X and Y position plus the camera offset
   so the camera will be over the top of the Feeder component to be aligned.
7 When aligning the Z axis the feeder head will move to the X and Y position of the component and allow G53 Z height to
  be set and saved to the Feeder CSV file
8 Allow the use of an external MPG pendant while in the Feeders Tab

That's all I can think of for now. I am hoping I can actually get it to the ultimate form of having the machine use the camera to
auto align the X and Y positions of the feeders. For now though I need a manual way of doing it. One step at a time.
 

Please Log in or Create an account to join the conversation.

More
20 Aug 2022 23:24 - 21 Aug 2022 12:44 #250136 by my1987toyota
  This week has been a busy week so I haven't been able to accomplish much
 in way of the pick and place. That said I did make some head way with Opencv.
I wrote a simple Python and Opencv program that uses a usb camera and
places a Red cross-hair on the picture. I have a long way to go to get a working
Glade gui but one step at a time.
 I have been looking over dm17ry's vision and configuration and using that to get
a good starting point.

 In my next post I will be placing my Python / Opencv code in text format for
ease of readability. If you wish to test out the program you will need to
go into synaptic package manager and install python opencv if you don't have
it on your computer already. As far as cameras go I am using an
ELP-USB100W03M-L36 . I am placing the Python file for down load as well.
If you run the program and want to exit press the 'q' key on the keyboard.
Last edit: 21 Aug 2022 12:44 by my1987toyota. Reason: adding info

Please Log in or Create an account to join the conversation.

More
20 Aug 2022 23:26 #250137 by my1987toyota
import cv2 as cv

cap = cv.VideoCapture(0);

cap.set(3, 360)
cap.set(4, 360)
print(cap.get(3))
print(cap.get(4))
#cap.set = 720 X 720
#3 = 600 = 300
#4 = 800 = 400
#
#cap.set = 360 X 360
#3=352.0 = 176
#4=288.0 = 144

while(True):
    ret, frame = cap.read()

#    horz = cv.line(frame, (0, 300), (800, 300), (0, 0, 255), 1)
    horz = cv.line(frame, (0, 144), (352, 144), (0, 0, 255), 1)
    
#    vert = cv.line(frame, (400, 0), (400, 600), (0, 0, 255), 1)
    vert = cv.line(frame, (176, 0), (176, 352), (0, 0, 255), 1)
    
    cv.imshow('Top_CamView', frame)
    
    if cv.waitKey(1) & 0xff == ord('q'):
        break
        
cap.release()
cv.destroyAllWindows()



 

File Attachment:

File Name: camera-vie..._Hair.py
File Size:1 KB
Attachments:
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum