"Jerking" During X/Y Travel

Ask the MakerGear community for assistance...
User avatar
ryaneb85
Posts: 92
Joined: Mon Oct 19, 2015 2:03 pm
Location: Singapore

"Jerking" During X/Y Travel

Post by ryaneb85 » Sat Apr 16, 2016 10:44 am

I've been playing around with the latest version of Marlin, and while on the whole it seems to be working ok, during the travel movements of a print it seems to jerk a couple of times along the movement. I don't know how best to describe it, but it almost seems like it moves as expected, power is removed for a split second, then the cycle continues.

I was thinking acceleration might be a bit too high and have tried reducing those to around 1500, but it doesn't seem to have an effect. Has anyone else encountered something similar? When I go back to an official Makergear release the problem disappears, so i'm quite sure its not hardware related.

User avatar
PcS
Posts: 667
Joined: Mon Mar 09, 2015 12:19 pm
Location: Michigan

Re: "Jerking" During X/Y Travel

Post by PcS » Sat Apr 16, 2016 12:50 pm

It is not hardware. What version of arduino did you use to upload. Makergear only supports recommends 1.5.5... .I think... my memory is terrible. The newer versions seem to cause issues for some.

User avatar
ryaneb85
Posts: 92
Joined: Mon Oct 19, 2015 2:03 pm
Location: Singapore

Re: "Jerking" During X/Y Travel

Post by ryaneb85 » Sat Apr 16, 2016 12:53 pm

I've tried 1.6.8 and I think 1.6.0. I am aware that 1.5.5 is the recommended version, but the release notes in Github state that you need 1.6.0+ in order to compile and upload 1.1rc5.

User avatar
PcS
Posts: 667
Joined: Mon Mar 09, 2015 12:19 pm
Location: Michigan

Re: "Jerking" During X/Y Travel

Post by PcS » Sat Apr 16, 2016 12:57 pm

I would give it a try with the older one ...worth a shot. That said I have compiled marlin with the newer versions and uploaded them and every time I did I had to slow down my print speeds a little. I think the newer versions run faster. Also did you modify the accel and jerk settings in marlin to match makergears before you upload them ?

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: "Jerking" During X/Y Travel

Post by jsc » Sat Apr 16, 2016 1:06 pm


User avatar
ryaneb85
Posts: 92
Joined: Mon Oct 19, 2015 2:03 pm
Location: Singapore

Re: "Jerking" During X/Y Travel

Post by ryaneb85 » Sat Apr 16, 2016 1:25 pm

I thought we might have been on to something then, but I just checked the firmware and it already has that line included...

I've been pulling my hair out for days over this, so I'm about ready to revert back to the default firmware :cry:

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: "Jerking" During X/Y Travel

Post by jsc » Sat Apr 16, 2016 2:17 pm

Try increasing the 16 to a larger value. Just keep doubling it until it works, or it gets ludicrous.

User avatar
ryaneb85
Posts: 92
Joined: Mon Oct 19, 2015 2:03 pm
Location: Singapore

Re: "Jerking" During X/Y Travel

Post by ryaneb85 » Sat Apr 16, 2016 4:12 pm

Ok, I doubled it frmo 16 to 32 and that seems to have fixed things. I'll need to do a bit more testing to confirm everything is at it should be. I like to understand and learn as I am going along, so can somebody explain what exactly this is doing?

However, now I seem to have encountered another problem. When I am jogging (and eventually homing) the machine via S3D, the x/y axis jog fine, and dropping the bed works fine (+Z movements), but when I try to raise the bed (-Z movements) the bed still drops and makes a weird sound in the process. If I try to home Z, again it makes a weird sound and the bed drops down instead of raising. To clarify, this was happening intermittently before i changed the 16 -> 32, so I don't think they are related. I have checked homing directions etc. and everything seems to be correct.

jsc
Posts: 1864
Joined: Thu Apr 10, 2014 4:00 am

Re: "Jerking" During X/Y Travel

Post by jsc » Sat Apr 16, 2016 4:47 pm

Marlin generates steps by using timer interrupts. It sets a target value (OCR1A), and at every tick of the clock the counter value (TCNT1) goes up by one. When it reaches the target value, it sets the counter to zero, "fires" the interrupt and runs the handler, which calculates whether a step needs to happen, and resets the target value to the next time it needs to wake up and handle another step. The whole time the interrupt handler is running, the counter is still getting incremented. If the new target value is too low (if you're trying to move very quickly, for example) and the counter has already ticked past it because of the time spent running the handler itself, it will keep going all the way to the maximum value of 65535, wrap around to 0, and have to come back around to the target before the handler is run again. The "fix" is to detect this situation and set the target to run as soon as possible. The 16 is a fudge factor to allow time for the handler to exit and be fired again; apparently 16 wasn't enough.

User avatar
ryaneb85
Posts: 92
Joined: Mon Oct 19, 2015 2:03 pm
Location: Singapore

Re: "Jerking" During X/Y Travel

Post by ryaneb85 » Sat Apr 16, 2016 5:07 pm

Thanks JSC. The level of knowledge on this forum amazes me. I used to consider myself pretty handy... :?

Any idea on the z movement? I just swapped the Y and Z connectors at the board hoping to confirm that it's something in the firmware by replicating the same problem on the Y axis, but everything worked like normal (apart the Y axis moved a lot faster, and the Z slower, which I kind of expected). All I've managed to do is confuse myself even more...

Post Reply