[closed] FreeCAD path, strange movement in Z axis

More
02 Apr 2021 14:10 - 02 Apr 2021 17:22 #204504 by ikkuh
Hi,

Using FreeCAD and the Path workbench I made some g-code to flatten my spoilboard. But there are strange things happening. Hopefully somebody can explain.


The beginning of the g-code file contains some movement commands for the height.
When I run the program then only the Z6 and Z4 movements are done, not the G1 X-0.100 Y536.751 Z-0.100 F900.000

this works:
(Exported by FreeCAD)
(Post Processor: linuxcnc_post)
(Output Time:2021-04-02 15:44:09.383558)
(begin preamble)
G17 G54 G40 G49 G80 G90
G21
(begin operation: Fixture)
(machine: not set, mm/min)
G54 
(finish operation: Fixture)
(begin operation: TC: flat_Endmill)
(machine: not set, mm/min)
(TC: flat_Endmill) 
M5
M6 T1 
G43 H1 
M3 S8123 
(finish operation: TC: flat_Endmill)
(begin operation: MillFace)
(machine: not set, mm/min)
(Coolant On:Mist)
M7
(MillFace) 
G0 Z6.000 
G0 X-0.100 Y536.751 
G0 Z4.000 
G1 X-0.100 Y536.751 Z-0.100 F900.000 
G1 X5.249 Y542.100 Z-0.100 F900.000 

No Z movement for the last 2 lines (all the subsequent lines for that matter):
G1 X-0.100 Y536.751 Z-0.100 F900.000 
G1 X5.249 Y542.100 Z-0.100 F900.000 


When I run just the line
G1 X-0.100 Y536.751 Z-0.100 F900.000
in the MDI then it works just fine. But not as part of the whole program.

What am I doing wrong here?

File Attachment:

File Name: spoilboard.ngc
File Size:9 KB


File Attachment:

File Name: spoilboard...CStd.txt
File Size:36 KB
(remove the .txt extension)
Using FreeCAD linkbranch
LinuxCNC 2.9
gmoccapy 3.1.3.1
Attachments:
Last edit: 02 Apr 2021 17:22 by ikkuh.

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

More
02 Apr 2021 20:33 #204554 by andypugh
At a guess... Spindle at Speed is not being asserted, so the machine waits at the first G1 statement for that to happen.

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

More
03 Apr 2021 10:07 - 03 Apr 2021 10:20 #204603 by ikkuh

At a guess... Spindle at Speed is not being asserted, so the machine waits at the first G1 statement for that to happen.


I searched and found this:

Spindle at speed only inhibits the first cutting motion immediately after a spindle speed command, until the spindle speed is met. After that it is no longer monitored. That is it's designed operation.
forum.linuxcnc.org/38-general-linuxcnc-q...-quite-working#94069

spindle.0.at-speed - (bit, in) Motion will pause until this pin is TRUE, under the following conditions: before the first feed move after each spindle start or speed change; before the start of every chain of spindle-synchronized moves; and if in CSS mode, at every rapid to feed transition. This input can be used to ensure that the spindle is up to speed before starting a cut, or that a lathe spindle in CSS mode has slowed down after a large to small facing pass before starting the next pass at the large diameter. Many VFDs have an at speed output. Otherwise, it is easy to generate this signal with the HAL near component, by comparing requested and actual spindle speeds.


This is really strange. I never had this error before. Was this introduced in a recent LinuxCNC version?

I am using a simple pwm controlled spindle for the moment. It is at speed in under half a second.

The code segment where the PWM commands are given:
loadrt pwmgen output_type=0

# Spindle
setp hm2_7i96.0.pwmgen.00.output-type 1
setp hm2_7i96.0.pwmgen.pwm_frequency 1100
setp hm2_7i96.0.pwmgen.00.scale 10000

net spindle-cmd-rpm => hm2_7i96.0.pwmgen.00.value
net spindle-on <= spindle.0.on => hm2_7i96.0.pwmgen.00.enable
net spindle-on <= spindle.0.on => hm2_7i96.0.ssr.00.out-05
net spindle-cmd-rpm     <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps     <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-at-speed    => spindle.0.at-speed

Would it be possible to add the following to my custom.hal file?
remove: net spindle-at-speed    => spindle.0.at-speed
add: setp spindle-at-speed true
Last edit: 03 Apr 2021 10:20 by ikkuh.

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

More
03 Apr 2021 11:21 #204610 by andypugh
The problem can only be spindle.0.at-speed if you see _all_ G1 motion paused.
If you see the X and Y move but not the Z, then it is something else.

If you don't have anything driving spindle.0.at speed then change
net spindle-at-speed    => spindle.0.at-speed
to
net spindle-at-speed    => spindle.0.at-speed
sets spindle-at-speed 1

But, as I said, this was just a guess. It could be something else.

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

More
03 Apr 2021 11:56 #204613 by ikkuh

The problem can only be spindle.0.at-speed if you see _all_ G1 motion paused.
If you see the X and Y move but not the Z, then it is something else.


That's precisly the problem.
All the movements are correct except the Z axis. And then only the G1 movements, the G0 Z axis movements are working ok.

But when I run a 'non-working' G1 line in the MDI then it works. But as part of a gcode file it does not.

If you don't have anything driving spindle.0.at speed then change
net spindle-at-speed    => spindle.0.at-speed
to
net spindle-at-speed    => spindle.0.at-speed
sets spindle-at-speed 1

But, as I said, this was just a guess. It could be something else.


Will try that anyway, sounds plausible after trying to understand the manual.
Thanks for your help!

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

More
03 Apr 2021 12:44 - 03 Apr 2021 12:44 #204616 by andypugh
Let's try to be clearer about this.

In your G-code you have:
G0 X-0.100 Y536.751 
G0 Z4.000 
G1 X-0.100 Y536.751 Z-0.100 F900.000 
G1 X5.249 Y542.100 Z-0.100 F900.000

The third line is a move only in Z, as the machine is already at that XY point.
The fourth move is a G1 in X and Y at the same Z.

If the program runs to completion, finishing at X5.249 Y542.100 Z4.00 then the problem is _not_ spindle-at speed.

If the program pauses at X-0.100 Y536.751 Z4.000 and does not run to completion then spindle-at-speed seems like a very likely cause.
Last edit: 03 Apr 2021 12:44 by andypugh.

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

More
03 Apr 2021 13:32 #204620 by ikkuh

Let's try to be clearer about this.

In your G-code you have:
G0 X-0.100 Y536.751 
G0 Z4.000 
G1 X-0.100 Y536.751 Z-0.100 F900.000 
G1 X5.249 Y542.100 Z-0.100 F900.000

The third line is a move only in Z, as the machine is already at that XY point.
The fourth move is a G1 in X and Y at the same Z.


Exactly. That is what is supposed to happen.
But.... I ran the whole program. Alle movement commands except the Z movement in the G1 statements are executed.
The spindle does not move from the initial Z4 position, the X and Y movements are correct.

If the program runs to completion, finishing at X5.249 Y542.100 Z4.00 then the problem is _not_ spindle-at speed.


Ok, it does run the whole program at z=4. So I will stop pursuing the spindle-at-speed route

If the program pauses at X-0.100 Y536.751 Z4.000 and does not run to completion then spindle-at-speed seems like a very likely cause.


There is no pause, the program runs fine after toolchange and toolheight measurement.


The program does the initial xyz movements and they are correct. Until the first G1 command, of the G1 commands only the X and Y positions are executed. The Z value remains at 4.

It might be the speed, or at least thats the only thing left I guess. I will try again with different (slower) speed.

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

More
03 Apr 2021 13:59 #204621 by andypugh
Does the DRO show 4.0 for the Z, or is it that the Z doesn't move when commanded?

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

More
03 Apr 2021 14:07 #204622 by ikkuh

Does the DRO show 4.0 for the Z, or is it that the Z doesn't move when commanded?


Was just about the post a video about the DRO.
There is something strange going on that might be my fault.
If you look at the DRO in the video you can see that right after the first G1 command the DRO goes to -0.1 But the spindle itself didn't move at all in the Z direction, it is physicaly still at 5 (in this case, I changed the gcode file a little).

I do not know how this is possible. My G54 and homing is correct to my knowledge (all the G0 commands work as they should).


Remove the .txt to watch this .mkv video

vokoscreen....mkv.txt

Attachments:

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

More
03 Apr 2021 14:42 #204625 by ikkuh
For now I blame the G43 that is inserted. Tomorrow I will know.

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

Time to create page: 0.128 seconds
Powered by Kunena Forum