Custom Kinematics

More
11 May 2012 22:28 - 11 May 2012 23:08 #20022 by tmade
Custom Kinematics was created by tmade
I'm still quite new to linuxcnc, so I am of course going to run into problems.

I am working through a custom setup to get the hang of making non-trivial machines. The machine is similar to the Alex Jony's Tripod , except I am using 4 steppers in a square configuration. In the attached zip is the source for the kinematics called "4pod.c". I am reusing the basic layout and code from Dave381's post . I installed it using "sudo comp --install path/to/4pod.c". There might be problems in the math, but I don't think that matters at this moment. I also only extended the math from the kinematics page .

My hardware is a 5i25 running the 7i76x2 firmware, but I am using 7i75 daughter boards. The guys from Mesa said this would work fine since my end goal is to use steppers. I got pncconf to work using the instructions in post 18554 , but pncconf doesn't seem to work with non-xyz layouts. It will prompt that "You forgot to designate a stepper/pwm for axis x, y, z". My plan to get around this was to make a basic machine configuration in pncconf and then modify the ini and hal files to my liking.

The new 4pod configuration folder is attached in the zip file as well. When it is run using linuxcnc, Axis will show joints 0,1,2,3 in the axis screen, but trying to jog 3 gives "joint 3 following error". When I home all Axis(joints?) and attempt to run the "LinuxCNC Cutout", I get the following errors: Exceeded positive soft limit on joint 3, joint 1,2,3 following errors, and command (EMC_TASK_PLAN_STEP) cannot be executed until the machine is out of E-stop and turned on.

I'm at a loss of where to go from here, any help, or direction, in troubleshooting, would be greatly appreciated. Even some good samples of custom kinematic machines would be helpful.

Thanks!

File Attachment:

File Name: Machine_an...tics.zip
File Size:9 KB



edit: Also, I should say that my changes to the code were:
to 4pod.hal:
-Copy Axis Z to Axis "D" and change all of the 02 to 03.
-Under HALUI Signals, added "net d-is-homed.." to "net jog-d-analog". Not really sure what these lines do, but I have a feeling I need them. The naming might be wrong.

to 4pod.ini
-under [TRAJ] added A to the coordinates, changes axes to 4.
-copied axis2 and made axis3 from it.
Attachments:
Last edit: 11 May 2012 23:08 by tmade.

Please Log in or Create an account to join the conversation.

More
17 May 2012 15:38 #20182 by andypugh
Replied by andypugh on topic Custom Kinematics
tmade wrote:

I'm still quite new to linuxcnc, so I am of course going to run into problems.

Sorry for the delay responding, somehow I failed to notice this post.

The new 4pod configuration folder is attached in the zip file as well. When it is run using linuxcnc, Axis will show joints 0,1,2,3 in the axis screen, but trying to jog 3 gives "joint 3 following error".


This _might_ simply be that you need to switch to "world" mode immediately after homing. (There is a menu option, or you can use the "$" key)

Please Log in or Create an account to join the conversation.

More
12 Jun 2012 16:51 #20848 by Dave3891
Replied by Dave3891 on topic Custom Kinematics
andypugh wrote:


This _might_ simply be that you need to switch to "world" mode immediately after homing. (There is a menu option, or you can use the "$" key)


Is there any way to auto switch to world mode after the home sequence?

Dave

Please Log in or Create an account to join the conversation.

More
12 Jun 2012 18:17 #20850 by andypugh
Replied by andypugh on topic Custom Kinematics
Dave3891 wrote:

Is there any way to auto switch to world mode after the home sequence?


I think it is possible, but a bit fiddly. There has been a suggestion that it could be an INI file option.

If you have halui loaded (which requires HALUI = halui in the [HAL] part of the INI file) then you have the pins halui.mode.joint and halui.mode.teleop to set the joint/world mode and the pins halui.mode.auto and halui.mode.manual too.
There is some interaction between the 4 pins that I have not quite figured out. You can experiment by typing (for example) "step halui.mode.teleop" in the machine->show HAL config window. (You might have to expand the window to see the command entry box)

Those pins, twiddled in the right order, allow you to change between world and joint modes. You could, in HAL, net the axis.0.homed , axis.1.homed etc pins into a "logic" component (which is a fairly easy way to get a 4-way AND and XOR pin output) and net those to the halui.mode pins.
It ends up looking like this.
loadrt logic personality=0x704
addf logic.0 servo-thread
net X-homed axis.0.homed logic.0.in-00
net Y1-homed axis.1.homed logic.0.in-01
net Z-homed axis.2.homed logic.0.in-02
net Y2-homed axis.3.homed logic.0.in-03
net all-homed logic.0.and halui.mode.manual halui.mode.teleop
net some-unhomed logic.0.xor halui.mode.joint
The following user(s) said Thank You: PKM

Please Log in or Create an account to join the conversation.

More
20 Jun 2012 19:43 #21156 by tmade
Replied by tmade on topic Custom Kinematics
I've been working on this and I've been trying to get the bipod style program to work. It is the example from the manual kinematics - two steppers with wire/string dangling between them.

My kinematics, hal, and ini are attached. I start the program, home each joint with the starting x,y near the top left joint (see HTML docs ). My +/- x moves works without a problem, but the +/- y moves don't. It looks like joint 2 is going the wrong way. I can tell some math is happening in there, because as I increase Y, the steppers get faster to keep the same Y speed.

Any ideas what would be causing that behavior? I can't find a problem in my math, increase joint (joint mode) causes the length of the string to get longer. That is why my code has joint[1] = -sqrt((Bx-x)^2+y^2). If I wind joint 2 the opposite way, and remove the negative, I get the same behavior.

Thanks

File Attachment:

File Name: Files.zip
File Size:4 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
20 Jun 2012 20:27 - 20 Jun 2012 20:27 #21157 by andypugh
Replied by andypugh on topic Custom Kinematics
I tried it in Excel, it only works if you change
Bx2 to = Bx, but you have:
double Bx =0;//= parMain -> dist;

Attachments:
Last edit: 20 Jun 2012 20:27 by andypugh.

Please Log in or Create an account to join the conversation.

More
20 Jun 2012 20:32 #21159 by tmade
Replied by tmade on topic Custom Kinematics
And that is getting me better results. Thanks for taking a peek at that for me.

Nick

Please Log in or Create an account to join the conversation.

More
26 Jun 2012 15:36 - 26 Jun 2012 15:42 #21366 by tmade
Replied by tmade on topic Custom Kinematics
I am getting better results now, and am hopefully working on the last set of errors on this machine.

1) When I am in world mode, X, Y, and Z are always zero, even though the virtual machine head moves around. If I use HAL meter and select Signal -> X-pos-cmd, I will see a non-zero value that changes with my commands in world mode. Is this expected behavior?

2) When homing the joints in joint mode, only joints 0,1, and 2 will show the Crosshair home symbol. 3 and 4 will update and then change to zero on "Home Axis", but will not show the symbol. A second click will prompt saying the joint is already homed though.

3) Building off (2), If I move the joints, home, and try to enter world mode I get the error in the bottom right saying "all joints must be homed before going into teleop mode". If I then close out Axis and reopen it and home (without moving the joints), it will enter world mode without an error.

Thanks again for the help


Edit: I have made it slightly more complex by converting the bipod to a quadpod. It is a rectangle with a stepper in each corner. The new files and definitions are attached. (1) (2) and (3) above happened with the bipod configuration from my earlier posts too.

j1 = bottom left
j2 = bottom right
j3 = top left
j4 = top right

x = 0, y = 0 at bottom left
j2 is at (jx,0)
j3 is at (0,jy)
j4 is at (jx,jy)

dx and dy are slight offsets to help calculate the real joint wire length because the center piece is not a true point.

File Attachment:

File Name: quadspeed.zip
File Size:9 KB
Attachments:
Last edit: 26 Jun 2012 15:42 by tmade. Reason: Adding files

Please Log in or Create an account to join the conversation.

More
30 Jun 2012 15:51 #21468 by dab77
Replied by dab77 on topic Custom Kinematics
Hi, i've read only now about this thread.
I've done an inverted tetrapod, which lies on a plane. I assume your is built vertically (like something to write on a wall?).
I definitely suggest you to download JointAxes3 branch of LinuxCNC, because with this branch you are free to have x number of joints and y number of axis. (you will work, i think, with 4 joints (motors) and 3 axis (X,Y and Z))... thinking more, maybe you don't need one axis, because you're moving on a plane, is it?
But, anyway, to use custom kinematics, JA3 branch is the way.

If i can help you, just ask.
Ciao Davide.

Please Log in or Create an account to join the conversation.

More
28 May 2013 02:27 #34783 by PKM
Replied by PKM on topic Custom Kinematics

andypugh wrote: Dave3891 wrote:

Is there any way to auto switch to world mode after the home sequence?


I think it is possible, but a bit fiddly. There has been a suggestion that it could be an INI file option.

If you have halui loaded (which requires HALUI = halui in the [HAL] part of the INI file) then you have the pins halui.mode.joint and halui.mode.teleop to set the joint/world mode and the pins halui.mode.auto and halui.mode.manual too.
There is some interaction between the 4 pins that I have not quite figured out. You can experiment by typing (for example) "step halui.mode.teleop" in the machine->show HAL config window. (You might have to expand the window to see the command entry box)

Those pins, twiddled in the right order, allow you to change between world and joint modes. You could, in HAL, net the axis.0.homed , axis.1.homed etc pins into a "logic" component (which is a fairly easy way to get a 4-way AND and XOR pin output) and net those to the halui.mode pins.
It ends up looking like this.
loadrt logic personality=0x704
addf logic.0 servo-thread
net X-homed axis.0.homed logic.0.in-00
net Y1-homed axis.1.homed logic.0.in-01
net Z-homed axis.2.homed logic.0.in-02
net Y2-homed axis.3.homed logic.0.in-03
net all-homed logic.0.and halui.mode.manual halui.mode.teleop
net some-unhomed logic.0.xor halui.mode.joint

That works!
But after the machine is homed I run the program and after that it's joint mode again. Or I switch to MDI and then to Manual and it's joint mode again. I use joints_axes3.
How do I make it "forget" about joint mode?
The perfect behavior would be automatic going to joint mode only when HOME_ALL button pushed (even in world mode) and return to world mode forever after homing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum