Custom robotic stage (inverse kinematics setup)

More
13 Sep 2012 01:45 #24221 by robocncd000
Please bare with me as I am a 100% noob and dont know what Im doing. Please confirm and reject my understanding:

I'm made aware that EMC2 can be configured to run custom robotic stages, such as parallel mechanism, scara robot or delta robots for example. Ive also read the manual, specifically the inverse kinematics section (although not very indepth beyond that).

First you need to figure out the math for your robot. So I need to figure out the forward kinematics equations and inverse kinematic equations. Then I will need to create a C file that is used to calculate the forward and inverse kinematics.

Then what? After I have the .c file programmed correctly (a task in itself), what is the next step to make it work? Im not sure how to 'install it'. Anything else I will need?

I read loosely you need to compile a new EMC2 using the kinematics C file? How do I do this? Is there a step by step instructions anywhere? What else do I need?

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

More
13 Sep 2012 07:24 - 13 Sep 2012 07:33 #24229 by cncbasher
what type of robotic stage are you interested in ? ,
if it needs a new kinematics file then you need to be using probably the development build of linuxcnc and compile in your new kinematics.c file

and then in your hal file replace the trivkins with the kins file you have produced


Dave
Last edit: 13 Sep 2012 07:33 by cncbasher.

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

More
13 Sep 2012 12:46 - 13 Sep 2012 12:48 #24239 by robocncd000
Might go with something easy first. Probably start with a simple delta robot to test the process first.

Im not sure how to proceed yet. Are there instructions on what to do? The notes on inverse kinematics isnt very in depth. It doesnt say what you do after.

By the way I have already used EMC2 and have one setup running a mill. Is there a way I can play around with the new setup without messing up the current setup if I were to use the same computer? Since that EMC2 is 'dialed in' for the mill already and its been working for ages so I dont want to mess with it.

Could you provide a workflow of sorts for the things I need to do? For example I'd imagine something like: (1) write .c kinematics file, (2) get GIT to download source... etc? (<
I made that up just now as information is all over the place and not very detailed from a lot of forum posts)
Last edit: 13 Sep 2012 12:48 by robocncd000.

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

More
13 Sep 2012 14:23 #24240 by andypugh
bobteal wrote:

By the way I have already used EMC2 and have one setup running a mill. Is there a way I can play around with the new setup without messing up the current setup

Yes, just make a duplicate of the config directory. Optionally change the names of the INI and HAL files in the new directory to match.

As for compiling the new kinematics file, you can probably compile and install it with "comp" so there is no need to download all the LinuxCNC source.
It's probably easiest to start with trivkins and modify it, it's here:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...082c4cafa137f7c7a16d

Most of it you can leave untouched. But you need to change the KINEMATICS TYPE to "BOTH"
Then just change the equations that define the positions in terms of joints, and vice-versa.

Alternatively, you might be able to use Genserkins if your robot can be described by Denavit-Hartenberg parameters.

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

More
13 Sep 2012 15:02 #24241 by cncbasher
i have delta kinematics already done if you need

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

More
15 Sep 2012 05:10 - 15 Sep 2012 05:10 #24282 by robocncd000
I installed emc2 from a livecd. Does this version have all that is required to compile it? Or do I need to get it to a network to download source files?

Also I just dont know what the procedure is to doing this. What files do I need in total? Do I need to place them all in a folder? Does the kinematics C file need to be in this folder?Then are there commands I need to type in to start the process? AFter this, where do I find this special version of emc2 that is distinct from the standard mill (cartesian bot) version?

Sure, if you have the delta kinematics that will be great thanks. I figure it is the easiest to build to learn the concept since it requires 3 motors, 6 arms and a triangular platform. BTW, is it ok to use steppers instead of servos? or do you at least need rotary encoder on it?
Last edit: 15 Sep 2012 05:10 by robocncd000.

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

More
15 Sep 2012 10:12 #24285 by andypugh
bobteal wrote:

I installed emc2 from a livecd. Does this version have all that is required to compile it? Or do I need to get it to a network to download source files?

You need to get to the internet.
I do most of my compilation with SSH from the comfort of the living room, while the CNC machine and its computer stay in the garage.

Also I just dont know what the procedure is to doing this. What files do I need in total? Do I need to place them all in a folder?

What version of EMC2/Linuxcnc are you using?
The first step is to network the PC and in a terminal
sudo apt-get install build-essential
That makes sure you have all the compilers and suchlike.
The, if you are running EMC2
sudo apt-get install emc2-dev
Or if you are running a LinuxCNC version (2.5 upwards)
sudo apt-get install linuxcnc-dev

You should then be able to put a kinematics file in any folder and compile/install it with
sudo comp --install mykinematicsfile.c

Start with trivkins (change the file name so you don't break linuxCNC, and change the author info so it's still true.)
It is also imperative that you change line 83 where the module declares it's HAL name, or it will all go wrong.
Note that once it has gone wrong, RTAI often stays wrong, and you will find that you still can't reload it after fixing the problem in your kins file. You will have to restart the PC.
(I am currently restarting a VM after crashing RTAI due to not changing line 83 of the new "andykins" )
of the file, then right-click the trivkins.c link near the top, and save-as that file.

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

More
14 Oct 2012 00:47 #25287 by robocncd000
Thanks. I will give that a try soon. I'm wondering, if I dont have the 'lengths' correct for a kinematic robot, and I wish to 'fine tune' these settings to make things more precise, do I need to recompile since the kinematic lengths are in the inverse kinematics file?

I believe I have v2.4.3, which was installed from the liveCD.

I am just starting to get back looking into this after time off. I'm wondering if as you say it may mess up my current setting, should I then do this on a spare HDD instead so I dont screw up my current setup?

Also unrelated I suppose, but can you run EMC2 under emulation in linux or windows (say virtualbox)?

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

More
15 Oct 2012 12:07 #25333 by andypugh
bobteal wrote:

I'm wondering, if I dont have the 'lengths' correct for a kinematic robot, and I wish to 'fine tune' these settings to make things more precise, do I need to recompile since the kinematic lengths are in the inverse kinematics file?

Which kinematics file are you using? Most of them take the lengths as parameters which can be easily changed in the HAL file (or the INI file if the HAL file has been set up with INI file links).
If the lengths are hard-coded into the kinematics file then you do need to recompile that file, but that can often be done using "comp" rather that compiling the whole application from source.

I'm wondering if as you say it may mess up my current setting, should I then do this on a spare HDD instead so I dont screw up my current setup?

There is no need to go that far, just make a copy of the configuration folder for the machine and change the name of the INI file. I have two different configs for my machine and that co-exist without any problems.

Also unrelated I suppose, but can you run EMC2 under emulation in linux or windows (say virtualbox)?

Yes. I run it on my Mac under VMWare.
I am not sure why you would bother with emulation under Linux, though. You can simply use the "pure simulator" version if the issue is one of kernel compatibility.

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

Time to create page: 0.098 seconds
Powered by Kunena Forum