View unanswered posts | View active topics It is currently Wed May 22, 2013 11:22 am



Reply to topic  [ 6 posts ] 
Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ignored 
Author Message

Joined: Mon Sep 26, 2011 4:30 pm
Posts: 5
Post Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ignored
It sounds kind of unlikely, but I was having some control problems with my brand new Orca 0.3. I've been digging in the firmware for 2 complete days now, so yes, I did a lot of tests.. When using pronterface/repsnapper to manually control the printer I noticed that sometimes any axis just didn't react on a command. For example:
g91 #relative positioning
g1 z1 f1000 #+1z speed 1000
g1 z-1 f1000 #-1z speed 1000
g1 z1 f1000 #+1z speed 1000
g1 z1 f1000 #+1z speed 1000

Then the last commando just didn't got executed. You can hear the motor enabling for a split second, but then just nothing happens. Similar results for x or y axis. After some digging in the firmware I noticed that removing sei() (enable interrupts) from TIMER1_COMPA_vect interrupt handler solved my problem. It just doesn't make much sense for such a small interrupt to enable interrupt handling within the interrupt. What I found from the old stepper.c is the following remark:
// Re enable interrupts (normally disabled while inside an interrupt handler)
// ((We re-enable interrupts in order for SIG_OVERFLOW2 to be able to be triggered
// at exactly the right time even if we occasionally spend a lot of time inside this handler.))

And the MOST important code difference between stepper.c and Marlin.c:
Stepper.c: static volatile int busy;
Marlin.c: static int busy;

I'm almost 100% sure that it should be defined as volatile as this statement will probably be removed by the compiler if it's not:
if(busy){ return; }

So for now the bug is solved by disabling sei() call in the interrupt. I will now try making the busy variable volatile and re-enabling the sei() see what happens then.

Anyone having similar problems with the new firmware?


Fri Oct 21, 2011 3:57 pm
Profile

Joined: Tue Aug 30, 2011 10:58 am
Posts: 3
Post Re: Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ign
Had some similar effects when using manual control,but never during print.


Thu Oct 27, 2011 8:16 am
Profile

Joined: Wed Feb 09, 2011 10:26 pm
Posts: 45
Post Re: Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ign
I can confirm this behavior. I also notice this when I manually try to move the axis with 0.9.3. Don't know if it happens when actually printing because I'm still missing the insert to drive the filament...


Thu Oct 27, 2011 4:52 pm
Profile

Joined: Thu Mar 31, 2011 3:08 pm
Posts: 95
Post Re: Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ign
I have tried running this one step at a time on Pronterface and it works ok I am running 0.9.10.

Geoff

_________________
http://apapageek.blogspot.com


Sun Oct 30, 2011 10:43 am
Profile

Joined: Mon Sep 26, 2011 4:30 pm
Posts: 5
Post Re: Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ign
geoffd123, where did you find the .10 version? I can only find the github version of Marlin (https://github.com/ErikZalm/Marlin) and the -3 version from Camiel (http://www.mendel-parts.com/downloads/firmware/Marlin/).

Btw the bug is also fixed when the variable is defined as static volatile.


Tue Nov 01, 2011 11:24 pm
Profile

Joined: Thu Mar 31, 2011 3:08 pm
Posts: 95
Post Re: Bug in Marlin 0-9-3 icm gen6? Axis command sometimes ign
Hi Ronn

It is the Oct 18 version on ErikZalm's github that you mentioned in your post. I sent Erik some Gcode that crashed the firmware and Erik fixed it. When that version starts it says it is 0.9.10.

Cheers
Geoff

_________________
http://apapageek.blogspot.com


Wed Nov 02, 2011 8:36 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.