Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulse jitter at certain speeds #798

Open
J-Dunn opened this issue Sep 9, 2015 · 4 comments
Open

pulse jitter at certain speeds #798

J-Dunn opened this issue Sep 9, 2015 · 4 comments

Comments

@J-Dunn
Copy link

J-Dunn commented Sep 9, 2015

In monitoring the STEP output on an oscilloscope, I notice certain pulse rates show considerable jitter. An example:

200 step/rev ; 5mm pitch lead screw = 40 step/mm or 160 pulse/mm in quarter step mode, hence $101=160

setting $111=1400 produces steady, regular pulse train.
setting $111=1200 produces considerable jitter

The period is 300us with 75us high pulse, the jitter is nominally equal to pulse width, leaving
a shadow trace starting where the regular pulse ends. I'm falling edge triggering so it seems
to be the timing between pulses that is not stable.

1250 and 1150 are fine , 600 shows similar instability.

STEP_PULSE_DELAY is not defined

Are there certain pulse rates that mix badly with GRBL timering ? Is this expected?
Thanks.

@J-Dunn
Copy link
Author

J-Dunn commented Sep 9, 2015

Anotherr, probably related oddity:

$111=2300 produces either a roughly 50% M/S ratio or a very narrow pulse. Period nominally the same.This can happen in either forward or reverse direction or neither. There seems to be some semi-random condition determining whether it takes one form or the other.

Once it decides which M/S it's into, the trace is visually pretty stable at 2300

@chamnit
Copy link
Member

chamnit commented Sep 9, 2015

@J-Dunn : The falling edge of the step pulse can sometimes be delayed by external circumstances, like the serial RX or TX ISRs firing around the time of a step pulse, but this is on the order of a few microseconds.

If you are seeing something around 75us, it's probably AMASS. 300us/4 = 75us. The 4 is the AMASS overdrive level at 3333Hz.

For falling edge stepper drivers, use the step invert setting. This should help with your problem.

@J-Dunn
Copy link
Author

J-Dunn commented Sep 9, 2015

Thanks. I was wondering whether this was AMASS related but had not dug into it.

The falling trigger I mentioned was the scope not the driver. To explain that it was the low level part of the cycle that was variable.

Does that mean that AMASS is flipping between different levels? 300/2 and 300/4 ? Do some step pulse frequencies close to an AMASS boundary cause jitter?

Does this also explain what I reported in #2, where two very different M/S ratios were being produced? That did not seem to produce any irregularity in the motor since the pulse cycle was apparently the same. It just seemed odd that it was not one thing or the other. Either direction could get the short pulse waveform, sometimes neither did.

@J-Dunn
Copy link
Author

J-Dunn commented Oct 14, 2015

I have confirmed that this effect is due to AMASS by recompiling without the feature.

It seems to happen at EVEN multiples of 1200mm/min at 80 steps/mm in half-step mode.
ie 1200, 2400,4800 but not 3600.

I'm wondering whether this irregularity could increase the likelihood of a stall condition during acceleration when driving motors near limit conditions.

Since it is rather irregular as it depends upon the synchronisity of GRBL timers and asynchronous execution of the planner ( and possible incoming gcode ) it may lead to erratic failures that are hard to pinpoint. This will lead to the need to derate the machine performance by slowing down the max pulse rate and/or acceleration settings.

Perhaps some hysteresis in the AMASS boundaries could be used to stop the jitter, with minimal overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants