Using M2## For Part Pickup and Feeder Advance

More
02 Aug 2022 13:22 #248839 by my1987toyota
I am back at it again. Before I go any further I just want to say Thank You to andypugh for his help and contribution of the Python code
that made this M-code possible.

Mainly I was trying to use bin/bash scripting and a  M1## code to send the placing head to a specified feeder . I couldn't for the life of me get it to work. So I posted a question in the G&M codes section forum.linuxcnc.org/20-g-code/46540-how-to-make-m1-execute-gcode  
Apparently I had miss understood what can and can't be done in those codes. He suggested using a M2## code instead because the
M200-M999 codes are re-mappable and capable of executing G-code moves. Their is some things that have to be added into the .ini
file that make it work. You also have to add the Python scripts into the machines profile folder.
that info can be found here forum.linuxcnc.org/20-g-code/46540-how-t...execute-gcode#248707

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

More
02 Aug 2022 13:58 - 02 Aug 2022 14:04 #248841 by my1987toyota
  Now for some tweaking. LOL. I have added more to the original code to customize it to what I want. First off 
I wont B.S. anyone and claim to be an expert.in coding  I'm not . Not even close. So what does M201 do now?
1 It switches to Machine coordinates using G53 so any board / G54 offsets will be ignored.
2 It then travels to the correct feeder position specified by a "P" number
3 Next it lowers the placing head (Z) to pick up the part.
4 Then it activates the vacuum solenoid and dwells for a specified time (G4)
5 Next it retracts the placing head with the part on the nozzle.
6 It then activates M161 P# that advances the feeder so another part is ready for pickup.
7 it exits the code and is ready to travel to where it will be placed on the board
This is written for 48 feeder positions, However if needed more could be added.
I will be posting the Python script in my next post today
Last edit: 02 Aug 2022 14:04 by my1987toyota. Reason: adding info
The following user(s) said Thank You: tommylight

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

More
02 Aug 2022 18:14 - 02 Aug 2022 18:50 #248858 by my1987toyota
Hopefully these files will give you a good idea of what is required
I have M161 listed because that's the code needed to actuate the feeder advancer system
I will need to list it on the "Feeder Control Schemes" section as well as the Ladder logic.

Some of the files may include the date in the file name this will need to be removed to work properly
the python files will also need to have permission to run as an executable program.

File Attachment:

File Name: custom_pos...8-02.hal
File Size:2 KB

File Attachment:

File Name: feeder_adv...V2.2.txt
File Size:17 KB

File Attachment:

File Name: M161.txt
File Size:13 KB

File Attachment:

File Name: remap.py
File Size:12 KB

File Attachment:

File Name: simple_pnp.hal
File Size:12 KB

File Attachment:

File Name: simple_pnp.ini
File Size:5 KB

File Attachment:

File Name: toplevel.py
File Size:0 KB
Attachments:
Last edit: 02 Aug 2022 18:50 by my1987toyota. Reason: correcting the major mess I made of this post

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

More
02 Aug 2022 21:06 #248868 by tommylight
Off topic:
How is the recovery going?
P.S.
I will delete this after i get an answer to keep this topic neat.

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

More
02 Aug 2022 21:40 #248869 by my1987toyota

tommylight post=248868 userid=17274Off topic:
How is the recovery going?

It's going well. Although sometimes I wish it went faster. My left wrist is now in a removable cast so I can at least take it off when
I'm not doing anything. I do have a problem of certain back muscles that want to ache anytime I move around or do anything .
But I am getting better day by day and I am back on my PnP project . So it ain't all bad. LOL
The following user(s) said Thank You: tommylight

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

More
03 Aug 2022 11:11 #248918 by my1987toyota

Off topic:
How is the recovery going?
P.S.
I will delete this after i get an answer to keep this topic neat.
 

I am ok with it being left up. If you wish to delete it let me know so I can delete my reply as well.

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

More
14 Aug 2022 15:58 #249728 by my1987toyota
  So the moral to this story is yes I am now using M201 with a P number to select what feeder to travel to
pick up the component then activate the M-code that cycles the feeder advancing the next part in it's reel
to the pickup position. If some one would want to see how I got to that point follow the link below
forum.linuxcnc.org/pnp/46568-using-m201-...nd-using-it-s-values
The following user(s) said Thank You: tommylight

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

Time to create page: 0.092 seconds
Powered by Kunena Forum