Page 1 of 5

UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 6:39 am
by LBayZG
Partial success. I have just finished building my own CNC mill controller.

Here are the specs.
a) one (1) UC400ETH controller (with licence).
b) one (1) HDBB2 breakout board.
c) four (4) M542 stepper drivers.
d) one (1) Sherline CNC mill with a CNC rotary table accessory.
e) Windows 7-64 running on an i7 at 3.4 GHz.

Electrically and mechanically it works. I managed to figure out the correct steps/unit and a reliable velocity ( about 12 units/min ) and the jogging controls work like a charm.
The jog controls work, both 'continuous' and 'step', for all four axes.

BUT - the UCCNC does not appear to work correctly when running a file. This is what I see happening.

1) The program runs, stepping through the G-code listing.
2) The yellow TCP marker in the toolpath view does not move. It stays on the 'home' position, even though multiple lines of G1 codes are rolling past.
3) When the end of the G-code is reached - nothing happens for about 30 seconds to 1 minute.
4) After this inexplicable delay, the TCP marker on the screen and the mill both move in a straight line from 'home' to the end position it should be in if it had run all the G-codes in the file.

One other really annoying thing. When I use the 'step' jog control. There is a large delay between hitting the jog button and movement occurring on the mill.
For tiny steps (.001) it is not noticeable.
For large ( 1 unit ) steps, the delay is on the order of 10 seconds.
For larger (2 or 3 unit ) steps, the delay will typically reach 40 to 50 seconds before the mill table starts to move. (Z axis has similar delays too.)

For reference, this is the simple test file that I wrote.

%
(FILENAME: test1.nc)
G17
S2000
G0 Z0.4
G04 P2
G1 F3.0
G0 X0.5 Y0.5
G1 Y-0.5
G1 X-0.5
G1 Y0.5
G1 X0.5
G4 P3
G0 Z-0.2
S0
(END)
(OF PROGRAM)


The only movement the machine makes, is to move in a straight line to X0.5 Y0.5 Z-0.2. But that occurs more than 30 seconds after it reaches the final 'S0' G-code.

So, any ideas as to what is happening?

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 7:08 am
by A_Camera
Some missing codes from the G- code.

After S2000 you need to add M3 to start the spindle.
The S0 is not necessary in my opinion, but M5 to stop the spindle is the command to stop it.
The last code should be M30, which stops the code execution and rewinds the code.

I would not trust the S commands to start and stop the spindle, it is not safe.

In my opinion the spindle should be pulled up (positive Z move code) before you stop it, but perhaps "up" (positive movement) for you is the same as down for me, which is negative movement.

...but none of the above should prevent the machine from moving and it is indeed strange that you have movement after the spindle spinning is stopped.

Another thing... what does the % do at the start of the code? Nothing I normally have in my G-code.

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 4:07 pm
by LBayZG
Thanks for your reply, but those changes do not address the issue. In fact the M30 seems to make it worse.

I am basically making a dry run. Since I am trying to verify my setup. Whether the spindle is active or not (it's 100 manual) is not relevant.
I did, however, try your suggestions, since perhaps the UCCNC software might have its own ideas about 'sensible' G-codes.

New observation:
1) As before, the physical tool and the TCP cone in the display - do not move when I start the program.
2) If during the run, I hit the cycle-stop button, the machine (and the yellow TCP cone in the display) immediatly start to move. They make a two segment move towards the theoretical position of the cutting tool at the time I stop the cycle. (This move can be described as first a move at a 45-degree angle and then a straight vertical or horizontal movement. It ends at some point on the tool path.)
If I start the cycle again, the tool and the TCP cone remain motionless, although the display shows segments of the tool-path changing in sequence from blue to green.
3) I can repeat this cycle-stop, cycle-start operation as many time as I want, but the tool ONLY moves when I hit cycle-stop. And it's movement is not along the tool path.

Effect of M30 command:
The tool and the yellow TCP icon begins to move immediately when the code execution reaches the M30 command at the end. There is no 1-minute delay any more.
The tool and the yellow TCP icon only move for a fraction of a second (until the code is rewound) and then they stop - not having reached their final destination.
If I insert a dwell command (G4 P10000) just before the M30, then there seems to be enough time for the tool and the TCP icon to reach their final destination.

My best guess or supposition is the UCCNC software is interpreting the G-code, but for some reason, it is NOT ISSUING any tool movement output.
Only when the cycle stops, either through the intervention of the cycle-stop button or reaching the end of the code, does it actually update the position of the tool with whatever internal position it has calculated that it should be at.

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 4:27 pm
by ger21
What version of UCCNC are you using? Update to the latest, if you're not already using it.
If you are using the latest, maybe do an uninstall and complete re-install?
Something is very wrong with what you're seeing.

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 4:54 pm
by LBayZG
I am running version 1.2029
Firmware version 1.1270

In fact, I just did a fresh install of the UCCNC. I uninstalled it and then a fresh download and install.
I manually re-entered my entire setup. X,Y,Z,A and Spindle.

There is no change in program behavior. Movement only occurs when I hit cycle-stop or the program reaches its end.

If it were not so obvious that the program is not working correctly - THIS WOULD BE A MAJOR SAFETY ISSUE.
When you 'stop' the program, you don't expect the machine to begin moving.

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 5:42 pm
by LBayZG
As I mentioned previously, I did a complete re-install of the 1.2029.
No macros were configured. No plugins installed.

I just checked. I can verify that there are absolutely no macros and no plugins.
This must be some interaction with my PC hardware. Perhaps it does not like to run on 64-bit Windows 7?

My next thought would be to try to install an older version of the UCCNC program. Perhaps there is a bug in the 1.2029?

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 5:47 pm
by cncdrive
Do you have any custom screensets or macros installed?
Or just installed the UCCNC with it's installer and nothing else?

When the UCCNC is running, but no g-code is running if you go to the diagnostics screen what does the Idle LED show, is it on or off?
On your motion controller the blue LED is solid on or blinking when in idle?

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 6:08 pm
by LBayZG
I just installed UCCNC with its installer. Nothing else.

I manually set up the ports and pins for Limit sensors, and the Speeds for the X,Y,Z,A axis.
Charge pump on pin 14. (It works)
E-stop on pin 15. (It works)

When I start the cycle, the Status monitor shows 'run'.
The 'buffer' count slowly steps down from 5 to 0.
When it reaches 1, the Status montior shows 'idle' and the tool starts moving.

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 6:24 pm
by cncdrive
On your motion controller the blue LED is solid on or blinking when in idle?

Re: UCCNC does not execute G-code files.

PostPosted: Tue Jan 31, 2017 6:32 pm
by LBayZG
I presume you mean the blue LED on the UC400ETH?
Yes, the light is constant. No blinking whatsoever, either during 'run' or 'idle'. It never varies.

Note: If I simply rewind the program, without returning the machine to home, the program never moves at all.
Presumably, because the UCCNC knows the tool is already located at the finish point.