On Sat, Jun 22, 2013 at 07:19:52PM -0500, Bart Dring wrote:
> 
> http://pumpingstationone.org/2013/06/cnc-gonzo-build-2-recap/

Interesting machine!

> We are having trouble getting it to work in EMC. When we turn on the
> machine in EMC, both carriages immediately race at full speed towards the
> home switches. 

There should be no motion until you home.  Since it comes up in
joint mode, your kinematics are not even running.  

> Using the MDI tab with G code commands we are able to get X motion at the
> pen. That is pretty simple because for X, both carriages always run at the
> same speed and direction as the pen. We can command the pen to move in Y,
> but only at very low speeds. If we try to go fast EMC gives us all sorts of
> joint speed and position errors.

As has been pointed out, you should record and report behavior a lot
more carefully if you are asking for help.

> There is a link to our kinemantics file at the link above.  (We just
> modified trivkins.c). At this point I think it has been hacked beyond our
> initial successes, to completely broken.
> 
> 1. For this type of machine, what do we return for kinematicsType()?

BOTH as you have done

> 2. What do I want to do in kinematicsHome(). When is this function called
> and how often?

Never as far as I know

> 3. Why does the machine starting running immediately.?

Not enough information to say.

> 4. Can everything be done in the mykin.c file or do I need to modify other
> areas of the HAL.

I don't think you need to do anything else.  I grabbed the latest??
version of your file which says it's untested.  (It's hard to tell
which version others have tested).  I made a similar test program
that could be run outside LinuxCNC  (I absolutely recommend testing
kins standalone):

        #include <math.h>
        #include <stdio.h>

        #define sq(x) ((x)*(x))

        double c2 = 140.4225;
        double x,y, j[2];

        void f(void) {
                double b = (j[1] - j[0]) / 2;

                x = j[0] + b;
                y = sqrt(c2 - sq(b));
        }

        void i(void) {
                double b = sqrt(c2 - sq(y));

                j[0] = x - b;
                j[1] = x + b;
        }

        void p(double x, double y) {
                printf("%g %g");
        }


        int main(void) {
                x = 3, y = 4;
                t();
                x=4;
                t();
                y=5;
                t();
                x = -1, y = -2;
                t();
                x = 0, y = 0;
                t();
                return 0;
        }


The output looks correct to me, for the expected domain:

        start point: 3 4
        -8.15448 14.1545
        3 4

        start point: 4 4
        -7.15448 15.1545
        4 4

        start point: 4 5
        -6.74349 14.7435
        4 5

        start point: -1 -2
        -12.68 10.68
        -1 2

        start point: 0 0
        -11.85 11.85
        0 -nan


For the positive numbers, start -> inverse -> forward -> compare
gives a match, so your inverse and forward kins match.  This is
good.  Moving the controlled point right increases both joints;
moving it up increases one and decreases the other.

As others have said, you have to be careful about invalid input
values, such as negative Y.  Notice that 0,0 is also bad and you
need to avoid it.  You will have to set your world limits carefully.
Set your machine on graph paper or similar, with the origin at one
end of the rail and move it around by hand to see where the pen can
actually reach.  Set those as your axis limits.  Wildly guessing
from your photo you'll get something like X 15..30 and Y 3..10 if
you're in inches.  Your real constraints are not rectangular, but
you'll need to inscribe a rectangle and use that.

Set up joint homing however is convenient, and note the resulting
world position once homed.  That has to be given in the ini file.
I am not really sure how you can home this safely - you'll have to
be creative and it'll probably involve a homing sequence or even
pre-positioning by hand.

I cannot guess what causes your initial runaway, but I suspect
you've got a problem with your homing procedure that leads to
invalid numbers being sent through your kins.

On a normal trivkins cartesian machine we can be fairly lazy about
homing since it only sets our axis travels and all points in world
space correspond to (matching) points in joint space.  In a machine
like yours, homing is really bootstrapping the machine and getting
the world command, joint command, and kins loaded with numbers that
make sense and correspond to each other.

You should share your whole config (tar it the directory) for better
help...  Also be sure to say what version of LinuxCNC you are using.

This is cool and I hope you get it going.

Chris

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to