Custom Kinematics
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!
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.
Please Log in or Create an account to join the conversation.
Sorry for the delay responding, somehow I failed to notice this post.I'm still quite new to linuxcnc, so I am of course going to run into problems.
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.
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.
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
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Nick
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
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.
That works!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
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.