Project

General

Profile

z-axis also moves when X or Y axis moved

Added by TheGuv over 10 years ago

Hi All,

I have a shiny new powered table on the z-axis. The z-axis moves in error when either the X or Y axis is moved. This happens both by manually jogging with the LCD module and via job commands.

I can see with a few additional printf's in plan_buffer_line() that the debug output z-axis position variable remains static, but in reality the z-axis most definitely moves physically. Now not being a C++ programmer I'm lost in that function. I'm wondering if this might be a runtime issue with variables or memory reuse.

Anybody familiar with the code able to assist?

Issue #92 raised also.

'guv


Replies (8)

RE: z-axis also moves when X or Y axis moved - Added by KalleP over 10 years ago

I am held back from developing because of the fear of yet another development environment and so have put off even trying to figure out how GIT actually works. I poke around sometimes in projects when trying to find a file or two but do not have a good grip on it even thought some people have written lovely page long instructions (point form so 30 steps to complete). When I get my new machine I will see if I can load a Java and Python development environment and read the GIT manual.

So without having seen the code perhaps there is a possibility that the enable and not step line of the Z-Pololu is being toggled when the X and Y are doing their thing and this is causing it to make tiny steps when there is activity on the other axis. I'm not sure if the enable could cause the step error. Looking at a possible u-hardware cause could the IO pins be switching between output and input and a pull up resistor is causing a step pulse to be generated because the default step line is held low and floats high every time the port is re initialised. Such things have been known to happen to me.

KalleP

RE: z-axis also moves when X or Y axis moved - Added by TheGuv over 10 years ago

Hi KalleP,

Yeah I know the feeling. I'm not a programmer although am happy writing in Perl and will try some simple hacking on most things.

I checked the schematic and can see the Enable lines are all tied together and driven from a single ping (Pin 7) of the Mbed so perhaps it's some other cause. It could be reinitialisation of the ports I guess although I'd have expected all pin to be affected in a similar way, but don't know for sure.

Looking through the code - which I don't really understand - shows that all the axis seem to be coded in identical ways like this:

// output the step bits on the appropriate output pins
static inline void set_step_pins (uint32_t bits) {
xstep = ( (bits & (1<<X_STEP_BIT))?1:0 );
ystep = ( (bits & (1<<Y_STEP_BIT))?1:0 );
zstep = ( (bits & (1<<Z_STEP_BIT))?1:0 );
// estep = ( (bits & (1<<E_STEP_BIT))?1:0 );
}

so it's odd that just the z-axis is having a problem. Unfortunately I have a feeling that the cause is something complex that I won't be able to find. Hopefully somebody with knowledge of the code flow might step in to assist.

'guv

RE: z-axis also moves when X or Y axis moved - Added by TheGuv over 10 years ago

Nobody able to help? I was hoping someone would know the code...

RE: z-axis also moves when X or Y axis moved - Added by peter over 10 years ago

I guess I do :-)
Will work on this, this weekend.

RE: z-axis also moves when X or Y axis moved - Added by TheGuv over 10 years ago

Ah brilliant, I was getting worried for a minute...

I'm around this weekend and would be happy to help out testing :)

'Guv

RE: z-axis also moves when X or Y axis moved - Added by jaap over 10 years ago

We are meeting in Amsterdam now. Join us on skype? user: jaap__

RE: z-axis also moves when X or Y axis moved - Added by TheGuv over 10 years ago

Sure, added you on Skype - user de_guv

RE: z-axis also moves when X or Y axis moved - Added by TheGuv over 10 years ago

I can confirm this is now fixed in Git. Thanks all !

'guv

    (1-8/8)