[closed] FreeCAD path, strange movement in Z axis

More
5 years 6 months ago - 5 years 6 months ago #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:
Code:
(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):
Code:
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
Code:
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
Last edit: 5 years 6 months ago by ikkuh.

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

More
5 years 6 months ago #204554 by andypugh
Replied by andypugh on topic FreeCAD path, strange movement in Z axis
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
5 years 6 months ago - 5 years 6 months ago #204603 by ikkuh
Replied by ikkuh on topic FreeCAD path, strange movement in Z axis

andypugh wrote: 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:
Code:
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?
Code:
remove: net spindle-at-speed => spindle.0.at-speed add: setp spindle-at-speed true
Last edit: 5 years 6 months ago by ikkuh.

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

More
5 years 6 months ago #204610 by andypugh
Replied by andypugh on topic FreeCAD path, strange movement in Z axis
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
Code:
net spindle-at-speed => spindle.0.at-speed
to
Code:
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
5 years 6 months ago #204613 by ikkuh
Replied by ikkuh on topic FreeCAD path, strange movement in Z axis

andypugh wrote: 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.

andypugh wrote: If you don't have anything driving spindle.0.at speed then change

Code:
net spindle-at-speed => spindle.0.at-speed
to
Code:
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
5 years 6 months ago - 5 years 6 months ago #204616 by andypugh
Replied by andypugh on topic FreeCAD path, strange movement in Z axis
Let's try to be clearer about this.

In your G-code you have:
Code:
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: 5 years 6 months ago by andypugh.

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

Time to create page: 1.167 seconds
Powered by Kunena Forum