Re: [Emc-users] How to create custom kinematics module?

2010-06-15 Thread Andy Pugh
On 11 June 2010 13:46, Viesturs Lācis viesturs.la...@gmail.com wrote: 13     double xy_tan = atan2(pos-tran.y - old.y,pos-tran.x - old.x); I have been thinking about this some more, and it is too simplistic and may be causing problems. What happens when X and Y are stationary? atan2(0,0) is

Re: [Emc-users] How to create custom kinematics module?

2010-06-15 Thread Viesturs Lācis
2010/6/15 Andy Pugh a...@andypugh.fsnet.co.uk: On 11 June 2010 13:46, Viesturs Lācis viesturs.la...@gmail.com wrote: 13     double xy_tan = atan2(pos-tran.y - old.y,pos-tran.x - old.x); I have been thinking about this some more, and it is too simplistic and may be causing problems. What

Re: [Emc-users] How to create custom kinematics module?

2010-06-11 Thread Viesturs Lācis
Hello, folks! I have several questions about following part of my kinematics module (I have added the numbering at the beginning of lines, so that it is easier to understand, which phrase or line is being discussed): 1 #include rtapi_math.h 2 #include kinematics.h /* these decls */

Re: [Emc-users] How to create custom kinematics module?

2010-06-11 Thread yann jautard
Viesturs Lācis wrote: 1) What would correct syntax for line 18 and 19 look like? could be something like : 18 for (int i=1; i limit; i++){ 19 if (xy_tan == (90+(180*i)) || xy_tan == (90-(180*i))) 19 pos-a = asin(sin(joints[5]) / sin(xy_tan)); 20 }

Re: [Emc-users] How to create custom kinematics module?

2010-06-11 Thread Viesturs Lācis
2010/6/11 Przemek Klosowski przemek.klosow...@gmail.com: 1 #include rtapi_math.h 2 #include kinematics.h               /* these decls */ 3 4 const double head_offset = 200; 5 6 PmCartesian old; 7 8 in t kinematicsForward(const double *joints, 9                     EmcPose * pos, 10      

Re: [Emc-users] How to create custom kinematics module?

2010-06-11 Thread Neil Baylis
If atan2() returns a negative result, add 360 degrees (or the equivalent in radians) to the result. Neil 2010/6/11 Viesturs Lācis viesturs.la...@gmail.com 2010/6/11 Przemek Klosowski przemek.klosow...@gmail.com: 1 #include rtapi_math.h 2 #include kinematics.h /* these decls

Re: [Emc-users] How to create custom kinematics module?

2010-06-10 Thread Viesturs Lācis
Hello, Andy! I have done some braining-activity and complemented ABkins.c (that is how I temporarily called my customized kinematics module) with formulas for forward and inverse kinematics. As I have gantry style machine, I have a suspicion, that current syntax is not good - joint[1] is not

Re: [Emc-users] How to create custom kinematics module?

2010-06-10 Thread Viesturs Lācis
Hello! I have been trying to write my kinematics module, with extensive help from Andy Pugh I have made some little progess and I would like to ask anyone, who has some knowledge and experience in developing kinematics modules, to comment on what I have done. I have attached 2 files: ABkins.c -

Re: [Emc-users] How to create custom kinematics module?

2010-06-09 Thread Viesturs Lācis
I think that I give up trying to do this by myself (see below on reasons, that have driven me to the desperation) and so I would like to ask, if anyone can write a kinematics module for me and what would be the fee for that? 2010/6/9 Andy Pugh a...@andypugh.fsnet.co.uk: Indeed, look in

Re: [Emc-users] How to create custom kinematics module?

2010-06-09 Thread Andy Pugh
I would have taken this offlist some time ago, were it not that I am talking from a position of almost total ignorance myself, and might make some huge error that needs correcting). The reason I am even trying to explain this is a feeling that explanations from someone who knows only fractionally

[Emc-users] How to create custom kinematics module?

2010-06-08 Thread Viesturs Lācis
2010/6/5 Andy Pugh a...@andypugh.fsnet.co.uk: You would create a new file viesturskins.c (and possibly a .h) and put it in the src/emc/kinematics/ directory, then recompile. The module would then be available to load in HAL. You might need to add it to a makefile or header file somewhere.

Re: [Emc-users] How to create custom kinematics module?

2010-06-08 Thread Andy Pugh
On 8 June 2010 22:31, Viesturs Lācis viesturs.la...@gmail.com 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=UTF8s=booksqid=1276036335sr=8-1 :-) More