Advanced Search

Search Results (Searched for: )

  • grandixximo
  • grandixximo's Avatar
Today 05:26 - Today 06:01
Replied by grandixximo on topic Ethercat random jitter fix

Ethercat random jitter fix

Category: EtherCAT

Hi Hakan,

Thanks for the trace, it pointed straight at the bug. I reproduced your observation on my hardware and the root cause is exactly the "bad initial reference time" you flagged, but only in M2R mode. R2M is unaffected because it only writes the ref clock (sync_reference_clock_to) and never reads it back.

I added a small debug capture inside the dcsync callbacks (same columns as yours: cycle, pll-err, ref_time_lo, app_time) and logged the first 10 cycles. Before the fix on M2R:

# cycle pll_err ref_time_lo app_time_ns      app_time_lo
0 0        1875535147 829958931561087328 1037861216
1 0        1037346343 829958931562087328 1038861216
2 -385754  1038312400 829958935857087328 1038893920
3 -382546  1039366179 829958935858087328 1039893920
...

Between cycles 1 and 2, app_time_ns jumps by 4,295,000,000 ns (4.3sec). Same shape as your lcec.write-all trace.

Mechanism, walked through the code:

1. Cycle 0 pre_send reads ref_time_lo = 1,875,535,147. At this point our first frame carrying ecrt_master_application_time() has NOT yet been sent (cycle_start queues it, the actual send happens later in pre_send). So the read is the slave's own free-running DC SystemTime from before it received our epoch, exactly your speculation about the 0x92C offset register. lcec's unwrap code then seeds master->ref_time_ns = (app_time & 0xFFFFFFFF00000000) | 1,875,535,147.

2. Cycle 1 pre_send reads ref_time_lo = 1,037,346,343 (now valid, slave has received our app_time and rebased). The 32-to-64-bit wrap detector sees 1,037,346,343 < 1,875,535,147 and adds (1LL << 32) to master->ref_time_ns. False wrap.

3. With ref_time_ns now 4.3 billion ns ahead of dc_time_ns, the resnap logic in pre_send divides the diff by the period and snaps app_time backwards by 4295 periods. That's your +4.295e9 jump.

4. PI then only has to absorb the sub-period residual, which is why your cycle 3+ looks normal.

Fix is in v1.41.0-pre2. A ref_seeded flag discards the first nonzero read; the second nonzero read seeds the unwrap state without wrap detection; steady-state wrap detect takes over from cycle 2 onward.

After the fix on the same hardware:

# cycle pll_err ref_time_lo app_time_ns      app_time_lo
0 0        3928128362 829970359148090426 4011856954
1 0        4043140737 829970359149090426 4012856954
2 -192285  4044085554 829970359181090426 4044856954
3 -187787  4045074812 829970359182090426 4045856954
...
 

No phantom 4.3sec. The cycle 1 to 2 delta is now 32 ms (32 periods), which is the real initial phase error between the slave's rebased SystemTime and our app_time at startup, snapped to whole periods by resnap. PI absorbs the ~190 us sub-period residual over the settle time. pll_reset_count stays at 0 because the first resnap fires with dc_diff_ns == 0 and skips the counter increment.

So your speculation about the slave maintaining its own time and adding an offset after rebase is consistent with what we observe. The lcec bug was specifically the wrap detector treating the pre-rebase read as the baseline for the post-rebase read.

R2M in the current master was already correct in this respect (no read, no bad baseline), so no change there.

Thanks again for the clear debug output, it was the whole reason this was easy to pin down.

Could you test my 1.41~pre2 release on GitHub, to confirm you get the same result?

github.com/grandixximo/linuxcnc-ethercat...ses/tag/v1.41.0-pre2

But be warned even with this fix the OP time in my case remain about the same, the hardware has to do OP to run in DC, and it does take time, I agree with Rob's assessment, having the first device on the network be a good DC device is a must if you want good DC, I could try to debug what is the problem with papagno's first device, and I am also trying to get Ethercat to fix the function where we will be allowed to move the DC reference to arbitrary devices in the network, at the moment this function is present in the API but does NOT work.

This is simply restart after few minutes LinuxCNC was closed (servos had time to drift apart)
 
12s OP
Then quickly close and open again (servos had NO time to drift apart)
 
3s OP

if you want to get similar logs
 

File Attachment:

File Name: debug.zip
File Size:426 KB


As far as AssignActivate 0x300 to 0x730 I don't use this type of sync as i run in pos-cmd I don't think is necessary in my use case, but it should work, I think 0x300 should work fine for pos-cmd, if you use vel or torque command with internal PID you might want to look at 0x700 or 0x730
  • jtrantow
  • jtrantow
Yesterday 01:21

Remora - ethernet NVEM / EC300 / EC500 cnc board

Category: Computers and Hardware

I have a working laser config at github.com/JTrantow/configs/tree/main/router3 This directory also works as router so look at laser.hal and laser.ini.

motion.analog-out-00 is the laser output pin from the gcode. I use a mesa card with pwm but I've also used the linux pwm with no problems.

If you use F360 the following post processor will work for simple laser cuts and is compatible with lightburn generated gcode.

github.com/JTrantow/LinuxCNC-F360-Cutting-Post-Processor
  • tommylight
  • tommylight's Avatar
Yesterday 01:01
Replied by tommylight on topic LinuxCNC University

LinuxCNC University

Category: LinuxCNC Documents

1. gcode
2. hal
3. GUI's
4. hardware
  • bedouno
  • bedouno
Yesterday 23:03
LinuxCNC University was created by bedouno

LinuxCNC University

Category: LinuxCNC Documents

Dear friends, honored to be member of the community , as a new migrant from Mach3 i raelly shocked of the level of profissionality and experience and i admit " i regret about the long years i was afraid to join LinuxCNC " , I ask the profissionals to create a roadmap to help of generating new generation of experts to the community, from a to z :
- the programming skills needed.
- the CNC basic and advanced knowledge .
- linuxcnc, system terminology and construction.
this is a basic idea and i hope our superiors and expert to descuss this issue and sure this is a great investement in the future   
  • BIBIGUL
  • BIBIGUL
Yesterday 21:26

Remora - ethernet NVEM / EC300 / EC500 cnc board

Category: Computers and Hardware

I have a few questions regarding the Remora ETH source code. I understand it's built on the lwIP stack.

Does lwIP significantly impact the servo cycle timing? Does it cause noticeable lag/jitter?

Has anyone attempted to implement their own custom stack with Zero-Copy support? I suspect this would yield a decent performance improvement.

How is the time domain problem solved between the PC's servo cycle and the STM32's time domain? Or does the system simply operate in a fast response mode — processing commands immediately upon arrival from the PC?

If the time domain mismatch isn't handled properly, you simply cannot achieve precise velocity and acceleration control, especially when dealing with position feedback from the encoder.

Thanks.
  • rodw
  • rodw's Avatar
Yesterday 20:45
Replied by rodw on topic HAL component for tangential knife

HAL component for tangential knife

Category: HAL

Having looked at this a few times, I think that the best place to do it is actually in a G-code filter. ie calculate the heading from the G-code and insert / append C axis moves as appropriate.

One way I guess, but how does the gcode continually update the heading on a G2 or G3 as it traverses the arc? I found this had to  be done in motion. This will work, I just got taken over by other priorities which are now subsiding.
  • scsmith1451
  • scsmith1451's Avatar
Yesterday 19:26
Launching gladevcp panel with gmoccapy was created by scsmith1451

Launching gladevcp panel with gmoccapy

Category: Gmoccapy

I'm struggling to launch a gladevcp panel from my gmoccapy interface. I've queried the web for examples and feel that I'm on the right track, but without success.  I'm open to any suggestions.

I've attached my .ini file along with my gladevcp.ui and custom_postgui.hal for reference.

FYI - I have a laser crosshair that I use to locate the program start for a project. The laser can be toggled by either the gladevcp panel or via a toggle switch on the machine. I've wired up the machine such that either source will set an input pin high to turn on the panel LED. If the laser is toggled via the machine toggle, I want a visual indicator to remind me to turn it off manually.
Once I get the panel to display and the led to toggle properly, I may split the input to I get a visual indicating which source toggled the LED, but for now I just want to get the panel up and working. There is no custom python handler needed at this time.
  • Dudelbert
  • Dudelbert
Yesterday 17:59

Considering a Full Rewire on a Working Schaublin 125 CNC

Category: Turning

Thanks for the replies. The spindle.0.revs seems to be right when turning by hand, and when driving with the VFD active it is hard to tell exactly, but it seems to be correct as well.

Trying in constant speed instead of surface speed is a good idea, I will try that next.

And regarding diameter and radius, the man page I even linked says:

Note: When G7 Lathe Diameter Mode is in force, the values for I, J, and K are diameter measurements. When G8 Lathe Radius Mode is in force, the values for I, J, and K are radius measurements.

I don’t know how I overlooked that, it is really obvious now.
  • spumco
  • spumco
Yesterday 17:54 - Yesterday 17:57
Replied by spumco on topic REMAP: gang lathe tool orientation

REMAP: gang lathe tool orientation

Category: Advanced Configuration

I set up front and back angles, but it needed diameter to start displaying the inset shape.

However... it's displaying the tool tip past centerline when the tool is at X0.  I tried fiddling with the table angles (-87 & -32 vs 342.5 & 287.5) and it didn't make a difference.

Same display issue when the WCS rotation is in effect.

Below photos has tool #2 active.

 
  • andypugh
  • andypugh's Avatar
Yesterday 17:43
Replied by andypugh on topic HAL component for tangential knife

HAL component for tangential knife

Category: HAL

Having looked at this a few times, I think that the best place to do it is actually in a G-code filter. ie calculate the heading from the G-code and insert / append C axis moves as appropriate.
  • andypugh
  • andypugh's Avatar
Yesterday 16:29
Replied by andypugh on topic REMAP: gang lathe tool orientation

REMAP: gang lathe tool orientation

Category: Advanced Configuration

I am surprised that you have tool cones and not lathe tool shapes in the graphics. You should have a reasonably accurate picture of an insert.
You may need to set up frontangle and backangle in the LinuxCNC tool table for that to work, as well as the orientation.
  • andypugh
  • andypugh's Avatar
Yesterday 15:54
Replied by andypugh on topic Yukon Drive

Yukon Drive

Category: General LinuxCNC Questions

The manual mentions "analog setpoint" and that this is +/-10V DC.
So, I think you probably can.
  • andypugh
  • andypugh's Avatar
Yesterday 15:42
Replied by andypugh on topic Proper value for FERROR ? (EtherCAT Servo)

Proper value for FERROR ? (EtherCAT Servo)

Category: EtherCAT

f-error calculations compare joint.N.motor-pos-cmd and joint.N.motor-pos-fb.

Maybe you are not scaling the -fb value before passing it back to LinuxCNC (or, possibly, the scaling is taking place in the wrong slot in the servo thread)
  • spumco
  • spumco
Yesterday 15:27
Replied by spumco on topic REMAP: gang lathe tool orientation

REMAP: gang lathe tool orientation

Category: Advanced Configuration

Tested F360's' "turn below center" feature and it seems to work quite well with the standard LCNC post.

Example:
  • Tool is a 'back' tool, but on my backtool-defined lathe the tool is pointing away from the operator (up).
  • Tool defined in F360 as 'normal' orientation, i.e. tip down.  F360 defaults to a slant-bed turret lathe, so X+ is up in the simulation.
  • Tool set to 'turret 104' for post 'gang-tool on X+ turret'
OP1 OD turning looks good:
Warning: Spoiler!

 


OP2 ID turning, with 'turn in negative X' enabled:
Warning: Spoiler!

 

Tool is set in the LCNC tool table with orientation as T2 (earlier post), so the backplot looks like reality with the WCS rotation M-code.

It seems like this workflow and post means I don't have to set up different tools in the same library for multi-function ID/OD tools.  Nice.
 
  • RotarySMP
  • RotarySMP's Avatar
Yesterday 15:07
Replied by RotarySMP on topic Retrofitting a 1986 Maho MH400E

Retrofitting a 1986 Maho MH400E

Category: Milling Machines

That shifting into neutral also annoyed me. That was corrected. Take a look in the github for some revision he did. That made it stay in gear.

Not sure way you mean by F9 engaging low first gear?
Displaying 1 - 15 out of 285349 results.
Time to create page: 2.072 seconds
Powered by Kunena Forum