Welcome! Log In Create A New Profile

Advanced

Pronterface X axis fix for use with M90

Posted by threedyprinter 
Pronterface X axis fix for use with M90
August 30, 2013 07:57AM
Using Pronterface with M90 my little brain gets confused because the move right and move left (X) quadrants are reversed. IE: press a left X quadrant and the carriage moves right and vice versa.

This fix makes the carriage move in the "correct" direction (but does not affect anything else like the 180 degree rotation of the item on the plate, or the operation of the position preset buttons "FM", "BL" etc.) :

Locate file printrun/xybuttons.py in the Pronterface installation directory.
Locate these lines:
def getMovement(self):
 xdir = [1, 0, -1, 0][self.quadrant]

Change 2nd line to:
def getMovement(self):
 xdir = [-1, 0, 1, 0][self.quadrant]
Re: Pronterface X axis fix for use with M90
August 30, 2013 11:26AM
I've always wanted to sort that but never got round to looking. I'm glad I'm not the only one who's head starts to hurt when I keep hitting the wrong sector to move the bed.

Thank you very much for working that out. thumbs up
Re: Pronterface X axis fix for use with M90
September 01, 2013 04:41AM
Thanks for the thanks!
You may also be interested in this fix which rotates the Pronterface visualisation 180 degrees so wysiwyg:

in printrun/gviz.py (somewhere around line 265 in my release of Pronterface) replace:

    def _drawlines(lines, pens):
        def _scaler(x):
             return (self.scale[0]*x[0]+self.translate[0],
                         self.scale[1]*x[1]+self.translate[1],
                         self.scale[0]*x[2]+self.translate[0],
                         self.scale[1]*x[3]+self.translate[1],)
            scaled_lines = map(_scaler, lines)
            dc.DrawLineList(scaled_lines, pens)

        def _drawarcs(arcs, pens):
            def _scaler(x):
                 return (self.scale[0]*x[0]+self.translate[0],
                         self.scale[1]*x[1]+self.translate[1],
                         self.scale[0]*x[2]+self.translate[0],
                         self.scale[1]*x[3]+self.translate[1],
                         self.scale[0]*x[4]+self.translate[0],
                         self.scale[1]*x[5]+self.translate[1],)
         scaled_arcs = map(_scaler, arcs)
         etc....
with:
       def _drawlines(lines, pens):
            def _scaler(x):
                return (self.size[0] - (self.scale[0]*x[0]+self.translate[0]),
                        self.size[1] - (self.scale[1]*x[1]+self.translate[1]),
                        self.size[0] - (self.scale[0]*x[2]+self.translate[0]),
                        self.size[1] - (self.scale[1]*x[3]+self.translate[1]),)
            scaled_lines = map(_scaler, lines)
            dc.DrawLineList(scaled_lines, pens)

        def _drawarcs(arcs, pens):
            def _scaler(x):
                  return (self.size[0] - (self.scale[0]*x[0]+self.translate[0]),
                        self.size[1] - (self.scale[1]*x[1]+self.translate[1]),
                        self.size[0] - (self.scale[0]*x[2]+self.translate[0]),
                        self.size[1] - (self.scale[1]*x[3]+self.translate[1]),
                        self.size[0] - (self.scale[0]*x[4]+self.translate[0]),
                        self.size[1] - (self.scale[1]*x[5]+self.translate[1]),)
         scaled_arcs = map(_scaler, arcs)
         etc....

Oh dear, the formatting has gone wrong but you get the idea I hope.
To test, load android.stl and observe he's now upside down in XY.
This also works for the layer window you get when you click in the visualisation widget. Note: there were and still are bugs in that window* that do strange things when you zoom. (I use Repetier for detailed investigations so I'm not so worried about that.)
*on Linux Mint at least

Edited 2 time(s). Last edit at 09/01/2013 05:35AM by threedyprinter.
Re: Pronterface X axis fix for use with M90
September 01, 2013 01:27PM
Hmm i'm not using pronterface but do i get you right that you have turned your coordinate system around so the right back of the printer is 0,0 or why do you have to turn pronterface around?

Just asking...


Frank
Re: Pronterface X axis fix for use with M90
September 01, 2013 04:35PM
I've only turned Pronterface's visualisation in the GUI round 180 degrees. Nothing else.
Out of the box, Pronterface displays objects 180 rotated as compared with how the M90 prints them. If you were to look at the bed from the back of the M90 everything would seem OK.

Gcode coordinates remain the same; looking at the M90 from the front, X0,Y0 being the bed centre, X-100Y-100 back right , X-100Y100 front right etc.

It's no great shakes, I've mainly done it because my fan casing keeps bashing the foldback clips off the glass (even with the foldbacks removed) when I position them badly because I forget the rotation.
Re: Pronterface X axis fix for use with M90
September 01, 2013 05:04PM
ah ok , well looks like we've just configured the firmware differently. I have x0 y0 at the front left of the bed so i'll see it in my host (Repetier) just right.


Frank
Sorry, only registered users may post in this forum.

Click here to login