Welcome! Log In Create A New Profile

Advanced

Teacup help with homing

Posted by profitt 
Teacup help with homing
January 28, 2013 08:15PM
Hi All,

My apologies if this is the wrong place for this question. I am building a printer using a ShapeOko platform (gift), Anduino Uno (low cost) and pretty much hand built everything else (dumb). I am close to my first plastic but am having trouble with homing my axises. More specifically: after finding home all moves are in the negative direction. I can offset to the center of the bed OK but the z-axis moves downward! Inverting the direction signal causes the z-axis to home upwards. Can someone please direct me to the proper gurus for some insight into this. Most likely something simple I have overlooked.

Thank you all in the RepRap community for the great work found here.

Teacup firmware, Slic3r + Ponterface software.
Re: Teacup help with homing
January 29, 2013 06:17AM
A first step would be to ignore homing and make sure the axes move in the right direction when you send G0/G1 commands. It's no problem so send G1 without homing, the zero point is where the printer was at reset time.

That done, check your endstops using M200. Are they configured like you expect them to be?

If there was still no mistake, the only thing I can think of is, you configured max endstops instead of min endstops. In case you have some programming experience, homing code is in home.c and pretty simple.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Teacup help with homing
January 29, 2013 02:55PM
OK, here is a better description: After moving the head to the center of my platform and setting position to 0 (G1 X0 Y0 Z0), a controlled move (G1 X10 Y10 Z1) moves the head to the left front and down. Reading position (M114) confirms this as position -10,-10,-1. Issuing a home command (G28) moves the head to the left front down end stops. Again, M114 reads 0,0,0. Issuing a (G1 X-10 Y-10 Z-1) moves the head back, right and up.

Defined for my application are:
#define X_MIN_PIN AIO5
#define Y_MIN_PIN AIO3
#define Z_MIN_PIN AIO4
#define Y_INVERT_DIR
#define Z_INVERT_MIN

From "home.c":
~/~
void home_x_negative() {
#if defined X_MIN_PIN
TARGET t = startpoint;

t.X = -1000000;
~/~
Thus it appears the home command issues a negative position which homes my machine to the left front down, what is what I want. Issuing a negative move command moves the machine right, back and up, opposite of what I want!

These test were conducted using a terminal emulator (CoolTerm) so this is not a Slic3r, Ponterface issue. If this is something unique to my application I will modify code to the best of my meager abilities. Seems to me though this should have come up before.

Thanks for your reply and any additional insights you may have.
Re: Teacup help with homing
January 30, 2013 06:21AM
Quote

Issuing a (G1 X-10 Y-10 Z-1) moves the head back, right and up.

RepRap machines expect positive Z up, negative Z down. Zero at the bottom (usually the print table surface). Your Z axis is inverted.

Quote

t.X = -1000000;
~/~
Thus it appears the home command issues a negative position which homes my machine to the left front down, what is what I want.

This doesn't fit to the above. Above you said Z-1 would move the axis up, here you say Z-1000 moves the axis down.

Possible opportunities for bugs:

- As you see in the code, homing means to run into the endstop fast, then backing up slowly. It's possible you see the backing up only. To check, please try with SLOW_HOMING defined.

- This t.X = -1000000 causes an integer overflow. To check, replace the 1000000 (one million micrometer) by something smaller.

I was pretty sure Teacup is currently safe against integer overflows, but one never knows, perhaps you've opened a new coner case :-)


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Teacup help with homing
January 30, 2013 08:07PM
You have it, in one instance a (G1 Z-1) moves the head up and in the second (issuing a homing command translates into t.X=-1000000) the head moves in the opposite direction. I believe you are right in that it has something to do with integer math. I changed the Arduino compiler to verbose output and periodically noticed warnings for comparing signed values with unsigned. I am not conversant enough with the Arduino platform to do much debugging so I moved on.

My solution to this issue was to change the direction of my motors such that they move the head up, back and to the right with positive commands. To cure the homing issue I changed the t.X= -1000000 to t.X=+1000000. The same for Y&Z axis. Now a homing command moves the head down,left and backward. Tacky but effective.

Thanks for you help. If anyone else has a similar problem perhaps this issue should be looked into. For me, now that I have my first plastic I have new bugs to fry.
Re: Teacup help with homing
January 31, 2013 06:10AM
Glad you've found a solution.

Quote

I changed the Arduino compiler to verbose output and periodically noticed warnings for comparing signed values with unsigned. I am not conversant enough with the Arduino platform to do much debugging so I moved on.

For me, Teacup compiles with exactly one warning. If this is different for you, I'd appreciate a bug report here or on Github with your compiler settings and perhaps the text of these warnings. Improving things for everybody is the idea of a community, right? Thanks. smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Teacup help with homing
January 31, 2013 03:56PM
These warnings only appear on the first pass and are suppressed on subsequent compiling. Attached is the preferences file for my version of Arduino. I am not certin that this is anything more than an issolated anomoally. Please let me know if I can further this inquiry along should it become interesting.



C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)':
C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp:82: warning: comparison between signed and unsigned integer expressions
C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp: In member function 'virtual size_t HardwareSerial::write(uint8_t)':
C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\HardwareSerial.cpp:390: warning: comparison between signed and unsigned integer expressions



C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\Print.cpp: In member function 'size_t Print::print(const __FlashStringHelper*)':
C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\Print.cpp:44: warning: '__progmem__' attribute ignored



C:\Users\profitt\Documents\arduino-1.0.1\hardware\arduino\cores\arduino\Tone.cpp:108: warning: only initialized variables can be placed into program memory area
Attachments:
open | download - preferences.txt (2.8 KB)
Re: Teacup help with homing
February 02, 2013 06:43AM
I see, thanks.

All the warnings you posted are in the Arduino libraries which aren't used by Teacup. If you use Arduino to compile Teacup they're compiled anyways, that's how the Arduino IDE works.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Sorry, only registered users may post in this forum.

Click here to login