Custom robotic stage (inverse kinematics setup)
- robocncd000
- Offline
- New Member
- Posts: 4
- Thank you received: 0
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.
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
Please Log in or Create an account to join the conversation.
- robocncd000
- Offline
- New Member
- Posts: 4
- Thank you received: 0
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)
Please Log in or Create an account to join the conversation.
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.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
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.
Please Log in or Create an account to join the conversation.
- robocncd000
- Offline
- New Member
- Posts: 4
- Thank you received: 0
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?
Please Log in or Create an account to join the conversation.
You need to get to the internet.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?
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.
What version of EMC2/Linuxcnc are you using?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?
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.
- robocncd000
- Offline
- New Member
- Posts: 4
- Thank you received: 0
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.
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).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?
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.
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.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?
Yes. I run it on my Mac under VMWare.Also unrelated I suppose, but can you run EMC2 under emulation in linux or windows (say virtualbox)?
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.