On 8 June 2010 22:31, Viesturs Lācis <[email protected]> wrote:
> 2) Where can I find some information about the syntax, used in the .c > and .h files? http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?ie=UTF8&s=books&qid=1276036335&sr=8-1 :-) More seriously, perhaps look on the internet. This page was the first I found, but looks OK. http://www.cprogramming.com/tutorial/c/lesson1.html Alternatively, and to see immediate results (albeit results unrelated to your project) you could start where I started a few months ago: http://www.ladyada.net/learn/arduino/index.html Starting in "friendly" programming environment but working closely with hardware might not be the worst place to start. You shouldn't have to learn all of C in one go, it should be possible to take an existing kinematics file and understand which bits do the maths, and just change them. In fact, for your purposes you can just choose a kinematics module that you know you won't use, and "repurpose" it. That way it gets compiled without you having to worry about telling the compiler there is a new file to compile. > I encounter the word "double" in beginning of so many > lines, that I have a suspicion that it is not meant to be mathematical > action. Indeed not. In this case "double" is a type of variable, a floating point one with lots of precision: http://en.wikipedia.org/wiki/Double_precision > I feel that my lack of programming skills is making me > reconsidering, if I ever want to try this :) I won't pretend that it isn't going to be a challenge. But being able to program is very, very, useful. (I understand that it is even possible to get paid for doing it!) > 3) Where are first two files, mentioned below? They are mentioned also > in several .c files, but I do not see them in this folder... > #include "rtapi_math.h" > #include "posemath.h" > #include "genhexkins.h" > #include "kinematics.h" > And what is the purpose of these files? What does each of them define/control? rtapi_math.h includes definitions of a set of realtime-safe functions such as trigonometry. Your kins module will _definitely_ need that one. You will find both in emc2-dev/include. Luckily so will the compiler so you don't have to worry about it other than adding that line. .h files are "headers" they contain definitions of variable types and functions, but don't actually contain any "software" in the sense that you probably think of the term. > Currently it seems to me that this type of solution can manage vast > majority of my needs for 5 axis cutting (assuming that I can change > the angle of tilt with appropriate G-code commands for different > G01/G02/G03 moves or even during them). That is how I envisaged it. > Any ideas, how to implement this? It seems to me that this whole thing > has to be separated in following parts: > a) kinematics for A and B rotary axis, where offset from end of nozzle > to center of rotary axis is handled Indeed, look in genserkins for an example of that sort of calculation, from fixed geometrical constants. > ANY help, tips, advices, opinions or commentaries will be greatly > appreciated :)) You need to learn enough C to be able to read through and get a feel for what is happening, but the actual mathematical descriptions are a very few lines of code. for example rotatekins.c does all the maths in lines 24,25,43 and 45 to make a normal XYZ machine act as if it has a rotary table. Your module would end up looking a lot like that. Looking in that file we can see that the x and y coordinates seem to be returned by pos->tran.x, pos->tran.y etc. That might be all we need, I have tried tracking back through the definitions of pos->tran and find a lot of rather clever stuff going on that I am glad somebody else has already figured out. The only complication I see is that you might have to add some variables to the structure to "remember" X and Y from call to call to get the (dx,dy) to calculate the tangent. Or that information might well be somewhere else in the "pos" structure like pos->vel.x (though I can see no reason for that to be the case) Incidentally, after writing and researching that I now know 20x as much about kinematics as I did before, and might have pulled back ahead of you in understanding emc kins. -- atp ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
