Start Gcode not generated when Importing DXF

ivan
Posts: 38
Joined: Tue Apr 16, 2019 5:30 pm

Re: Start Gcode not generated when Importing DXF

Post by ivan » Thu Jul 11, 2019 7:58 pm

Looking at your PLC section in the provided profile, it appears that it has been cleared entirely. While it is possible to re-write the hardware PLC from the ground up, a lot of times it can have unforeseen consequences since a number of things depend on the PLC functioning correctly. For your vacuum table, I would suggest using the Software PLC (the __HANDLER_GCODE_START and the __HANDLER_GCODE_STOP) in order to turn the table on at the beginning of the program and turn it off at the end.

If that for some reason does not suit your setup needs, I'd suggest writing a completely new Hardware PLC set of commands (not changing the M07/M09/etc) and then including them in the header/footer of the DXF file as you have been doing before.

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Thu Jul 11, 2019 9:42 pm

ok so I found this page but a lot of the example code comments are in russian, I'm having a hard time understanding what everything does. http://docs.pv-automation.com/plc/software_plc_examples
I'm just trying to understand what code I need to set the relay 1 high for the Handler_gcode_Start. It's just fine if the vacuum runs using soft plc, it's not time critical.

I'm curious is there an easy way to create a toggle button on the main control screen to turn the vacuum table on and off?

My background is in 3D printing so this very different from what I'm used to working with in the past. I have no experience whatsoever writing PLC code and it's all very confusing.
Last edited by drphil on Fri Jul 12, 2019 2:53 am, edited 1 time in total.

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Fri Jul 12, 2019 2:22 am

For some reason when I Use the shape library and hit the play button it cuts sideways, backwards or other random angles. If I then zero out the axis again it cuts in the correct direction.

Sometimes when I load a new job the c axis spins in circles at super random times. I'm uploading a video
Last edited by drphil on Fri Jul 12, 2019 3:18 am, edited 1 time in total.

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Fri Jul 12, 2019 2:51 am

Is it possible to view the profile of one of the machines you have on your examples page for tangential cnc machines?
By the way you misspelled tangential as "tangentoal" on this page.

https://www.pv-automation.com/applicati ... e-examples

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Fri Jul 12, 2019 5:50 am

I've gone back to trying to use the hardware plc commands to control the vacuum table which is similar to flood. The problem I'm having is that when running a DXF file it only will run one command, not both. I can but both in the header and footer but it will only run the first one.
I've been able to include the flood in the M3 command which runs the knife and the vacuum table but doesn't turn it off.
So I'm stuck with having the vacuum table still turned on after cutting is finished.
I've been sitting in a wearhouse most of the day trying to fix little things that are preventing me from completing this contract. There are too many options in this controller, it's absolutely overwhelming.

ivan
Posts: 38
Joined: Tue Apr 16, 2019 5:30 pm

Re: Start Gcode not generated when Importing DXF

Post by ivan » Fri Jul 12, 2019 3:52 pm

1) Regarding the PLC code examples - I have translated the Russian comments to be in English. However this page shows PLC code for a very complex machine that one of our clients had, with two spindles and two separate "sides" which had to both run the program one after another. The example code you see on that page is more of a demonstration of what the system is capable of rather than a straightforward setup example. I would not recommend using is as a direct 1-to-1 reference.

2) There are two potential ways you can turn the vacuum table ON and OFF using output 2, one possibility being through the Software PLC, and the other through the DXF Header/Footer. The header/footer solution is not ideal since it will turn the vacuum table ON at the beginning of the program, and will only turn it OFF at the very end of the program (so not if you press the STOP button, as that will stop the program before it reaches the command to turn the vacuum table off). If, however, that is something that you prefer, it can definitely be done this way. On the other hand, to start the vacuum table using Software PLC, you can go into Settings > Config > PLC > Software PLC and edit the __HANDLER_GCODE_START and __HANDLER_GCODE_STOP to look as follows:

__HANDLER_GCODE_START:

Code: Select all

main()
 {
  portset(2); //turn output 2 ON
  exit(99);
 };
__HANDLER_GCODE_STOP:

Code: Select all

main()
 {
  portclr(2); //turn output 2 OFF
  exit(99);
 };
Now, every time you start and stop the G-code program, the output port will turn ON and OFF. Remember to press the Save All and Build All buttons for the changes to take effect.

3) It is definitely possible to create a toggle button on the main screen to turn the vacuum table ON and OFF. We have a couple of examples here (although they are for an older profile, the principle is still the same): http://cnc42.com/mycnc/mycnc_screen_con ... ff_buttons

I would recommend first setting up the PLC commands and the rest, and then doing the icons. If you want to turn the vacuum table ON and OFF using the GUI, you can go to the System Diagnostics window and click the output port icon to which the vacuum table has been connected (#2 in your case).

Image

Image

4) The machine videos have been provided to us by our customers, and those using unique setups (like the double-spindle machine I mentioned earlier) have had their profiles developed specifically to suit their needs. While it is entirely possible to create any such profile from the ground up using the tools available within myCNC software, each particular profile that we have developed is its own separate product, which, I am afraid, we cannot share without our customers' permissions. I will keep you posted if we manage to arrange something, but in the meanwhile I'd advise to take a look at the other publicly-available profiles posted on our website (such as the ones for plasma and mill machines) if you want to see more examples of how the buttons/configuration settings have been changed from one machine to another. I realize this does not exactly answer your question, but it is the best we can currently do.

5) As I have mentioned earlier, the current iteration of Shape Library is not recommended for tangential knives as most of the parts include commands for spindle turning on/off, as well as other specific commands related to mill/plasma/gas machines. The behaviour of the parts loaded from the shape library is not specified for the c-axis of the knife, that's why you see the angle being set arbitrarily. As before, I'd advise strictly using DXF import for your setup.

6) C-axis rotation is a common thing on many tangential knife machines/controllers, and is done to return the angle that the knife has turned to back to zero. It's not really a bug, rather a software quirk due to how the system records the angle (for example, if the knife has turned around its own axis twice in the same direction, the angle is now recorded as 720 degrees, and needs to be spun back to zero when the program is starting again). It is possible to get rid of this behaviour, by forcing the knife to "zero" its c-axis coordinate after the program has completed using the M212 macro in the footer of your DXF file (if you restore the PLC commands that were deleted in yesterday's profile).

7)
The "tangential" typo has been fixed - thank you for bringing it to our attention.
Last edited by ivan on Fri Jul 12, 2019 7:02 pm, edited 6 times in total.

ivan
Posts: 38
Joined: Tue Apr 16, 2019 5:30 pm

Re: Start Gcode not generated when Importing DXF

Post by ivan » Fri Jul 12, 2019 5:42 pm

Here is the M212 macro, along with much of the same explanation of its function as I have already mentioned: http://cnc42.com/plc/plc_examples#elimi ... ogram_m212

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Fri Jul 12, 2019 6:07 pm

Attachments
X1366V 7-12-19.zip
(258.72 KiB) Not downloaded yet

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Fri Jul 12, 2019 6:14 pm

Thank you I understand it better now. I need to add a 4 second delay after the relay is triggered for the vacuum table to start sucking hard enough to hold the material down.

drphil
Posts: 34
Joined: Tue May 21, 2019 7:30 pm

Re: Start Gcode not generated when Importing DXF

Post by drphil » Fri Jul 12, 2019 6:27 pm

That should help solve my problems. I have two more questions.
When I import a dxf file how do I get the software to do multiple passes at different depths? That feature only seems to work with the shape library.

I set the Contour direction to CW I don't know if this will cause issues.

The other one is the force home macro which I'm guessing is something I have to write? I just don't want the machine moving by itself when its turned on.

I just realized I can write a macro for the header and footer that contain the commands required so I don't have to put multiple commands in the header sense it only seems to execute one command.

Post Reply