# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## emc-users

 Re: [Emc-users] 45 degrees From: ben lipkowitz - 2006-06-21 10:48:44 ```Volker, you need to edit emc2/src/kinematics/trivkins.c which is the default transformation from cartesian coordinates to joint (motor) coordinates. One way to do it would be to modify it to include: #define COS45 0.70710678 #define COS_45 0.70710678 #define SIN45 0.70710678 #define SIN_45 -0.70710678 (in kinematicsForward) pos->tran.x = joints[0]*COS_45 - joints[1]*SIN_45; pos->tran.y = joints[0]*SIN_45 + joints[1]*COS_45; (and in kinematicsInverse) joints[0] = pos->tran.x*COS45 - pos->tran.y*SIN45; joints[1] = pos->tran.x*SIN45 + pos->tran.y*COS45; Sorry about the icky #define's I would have tested to make sure this works but i seem to have borked my compiler just now. HTH -fenn > From: goettler > > The formula I think its right, is a little different: > newX = oldX * cos(45 degree) - oldY * sin(45 degree) > newY = oldX * sin(45 degree) + oldY * cos(45 degree) > but math is not the Problem. > I dont know where to place this transformation permanent in the EMC2, > so that my stepper motors on the X and Y Axes behave like the coordinate > system is turned about 45?. > Because my machine has a special kinematik in that the workpieces, > always turned to exakt 45 Degrees I want this permanent. Therefor the > Machine Coordinate System also can be turned 45? to the physical X and Y > Axes, thats als OK. > I think, this transformation must take place elsewhere between the Nist > 247 G-Code Interpreter with the Display Frontend and the motion Controller. > The Display should show the Coordinates matching to the Diretion of the > Workpiece. > Thanks for your quick answer. > > Volker ```
 Re: [Emc-users] 45 degrees From: goettler - 2006-06-22 07:19:25 ``` Thanks this seems to be exactly what I need.
Question 1:
"define SIN_45 -0.70710678" do you Think there must be a -
Question 2:
is it possible to make a new file For trivkins.c for example trivkins-XY-45degree.c
by following changes in makefile.inc.in
#trivkins.c
trivkins-XY-45degree.c

Question 3:
Because I´m a Linux and EMC newby--- Is there any  guidance to compile
or should this only be done by someone with an acount as Developer of EMC.

Volker

ben lipkowitz schrieb:
Volker, you need to edit emc2/src/kinematics/trivkins.c which is the default  transformation from cartesian coordinates to joint (motor) coordinates.  One way to do it would be to modify it to include:  #define COS45  0.70710678 #define COS_45 0.70710678 #define SIN45  0.70710678 #define SIN_45 -0.70710678  (in kinematicsForward)   pos->tran.x = joints[0]*COS_45 - joints[1]*SIN_45;   pos->tran.y = joints[0]*SIN_45 + joints[1]*COS_45;  (and in kinematicsInverse) joints[0] = pos->tran.x*COS45 - pos->tran.y*SIN45; joints[1] = pos->tran.x*SIN45 + pos->tran.y*COS45;  Sorry about the icky #define's I would have tested to make sure this works but i seem to have borked my  compiler just now. HTH    -fenn
From: goettler <volker@...>  The formula I think its right,  is a little different: newX = oldX * cos(45 degree) - oldY * sin(45 degree) newY = oldX * sin(45 degree) + oldY * cos(45 degree) but math is not the Problem.  I dont know where to place this transformation permanent in the EMC2, so that my stepper motors on the X and Y Axes behave like the coordinate system is turned about 45?. Because my machine has a special kinematik in that the workpieces, always turned to exakt 45 Degrees I want this permanent. Therefor the Machine Coordinate System also can be turned 45? to the physical X and Y Axes, thats als OK. I think, this transformation must take place elsewhere between the Nist 247 G-Code Interpreter with the Display Frontend and the motion Controller. The Display should show the Coordinates matching to the Diretion of the Workpiece. Thanks for your quick answer.  Volker
_______________________________________________ Emc-users mailing list Emc-users@... https://lists.sourceforge.net/lists/listinfo/emc-users;
```
 Re: [Emc-users] 45 degrees From: Anders Wallin - 2006-06-22 19:46:26 ```> Question 3: > Because I=B4m a Linux and EMC newby--- Is there any guidance to compi= le > or should this only be done by someone with an acount as Developer of=20 > EMC. > Volker there are instructions for compiling at: http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl/emcinfo.pl?Installing_EMC2 it is not that hard - even I managed to do it ! AW ```
 Re: [Emc-users] 45 degrees From: goettler - 2006-06-24 08:49:54 Attachments: Message as HTML     Makefile.inc.in ```/******************************************************************** * Description: yourkins.c * Trivial kinematics for 3 axis Cartesian machine * X and Y turned 45Degree * * Derived from a work by Fred Proctor & Will Shackleford * * Author: * License: GPL Version 2 * System: Linux * * Copyright (c) 2004 All rights reserved. * * Last change: * \$Revision: 1.8 \$ * \$Author: goettler \$ * \$Date: 2006/06/23 14:11:07 \$ ********************************************************************/ #include "motion.h" /* these decls */ #define SIN45 0.70710678 #define COS45 0.70710678 int kinematicsForward(const double *joints, EmcPose * pos, const KINEMATICS_FORWARD_FLAGS * fflags, KINEMATICS_INVERSE_FLAGS * iflags) { pos->tran.x = joints[0]*-(COS45) + joints[1]*SIN45; pos->tran.y = joints[0]*-(SIN45) + joints[1]*-(COS45); pos->tran.z = joints[2]; pos->a = joints[3]; pos->b = joints[4]; pos->c = joints[5]; return 0; } int kinematicsInverse(const EmcPose * pos, double *joints, const KINEMATICS_INVERSE_FLAGS * iflags, KINEMATICS_FORWARD_FLAGS * fflags) { joints[0] = pos->tran.x*COS45 + pos->tran.y*-(SIN45); joints[1] = pos->tran.x*SIN45 + pos->tran.y*COS45; joints[2] = pos->tran.z; joints[3] = pos->a; joints[4] = pos->b; joints[5] = pos->c; return 0; } /* implemented for these kinematics as giving joints preference */ int kinematicsHome(EmcPose * world, double *joint, KINEMATICS_FORWARD_FLAGS * fflags, KINEMATICS_INVERSE_FLAGS * iflags) { *fflags = 0; *iflags = 0; return kinematicsForward(joint, world, fflags, iflags); } KINEMATICS_TYPE kinematicsType() { return KINEMATICS_IDENTITY; } ```
 Re: [Emc-users] 45 degrees From: ben lipkowitz - 2006-06-25 15:47:24 ```Volker, You need to switch to "teleop" mode - afaik this only works in TkEmc and you must be homed first. Otherwise jog commands directly jog the motors. On Sat, 24 Jun 2006, goettler wrote: > Date: Sat, 24 Jun 2006 10:55:59 +0200 > From: goettler > Reply-To: info@... > To: "Enhanced Machine Controller (EMC)" > Cc: ben lipkowitz > Subject: Re: [Emc-users] 45 degrees > > Thanks for the information, now it works. > I have changed the two attached file. > The formula for inverse kinematics and kinematics I used: > #define SIN45 0.70710678 > #define COS45 0.70710678 > > joints[0] = pos->tran.x*COS45 + pos->tran.y*-(SIN45); > joints[1] = pos->tran.x*SIN45 + pos->tran.y*COS45; > > pos->tran.x = joints[0]*-(COS45) + joints[1]*SIN45; > pos->tran.y = joints[0]*-(SIN45) + joints[1]*-(COS45); > > There are still existing some problems: > > 1. If I use free motion commands like the Jog command, and enter in > MDI- Mode, > there is a following error. The coordinate system isn't turned for Jog > command. > Can the direction of the Jog command equal be turned, like the for > example contured motion. > > Volker > > > ben lipkowitz schrieb: > > Volker, > you need to edit emc2/src/kinematics/trivkins.c which is the default > transformation from cartesian coordinates to joint (motor) coordinates. > One way to do it would be to modify it to include: > > #define COS45 0.70710678 > #define COS_45 0.70710678 > #define SIN45 0.70710678 > #define SIN_45 -0.70710678 > > (in kinematicsForward) > pos->tran.x = joints[0]*COS_45 - joints[1]*SIN_45; > pos->tran.y = joints[0]*SIN_45 + joints[1]*COS_45; > > (and in kinematicsInverse) > joints[0] = pos->tran.x*COS45 - pos->tran.y*SIN45; > joints[1] = pos->tran.x*SIN45 + pos->tran.y*COS45; > > Sorry about the icky #define's > I would have tested to make sure this works but i seem to have borked my > compiler just now. > HTH > -fenn > > > > From: goettler > > The formula I think its right, is a little different: > newX = oldX * cos(45 degree) - oldY * sin(45 degree) > newY = oldX * sin(45 degree) + oldY * cos(45 degree) > but math is not the Problem. > I dont know where to place this transformation permanent in the EMC2, > so that my stepper motors on the X and Y Axes behave like the coordinate > system is turned about 45?. > Because my machine has a special kinematik in that the workpieces, > always turned to exakt 45 Degrees I want this permanent. Therefor the > Machine Coordinate System also can be turned 45? to the physical X and Y > Axes, thats als OK. > I think, this transformation must take place elsewhere between the Nist > 247 G-Code Interpreter with the Display Frontend and the motion Controller. > The Display should show the Coordinates matching to the Diretion of the > Workpiece. > Thanks for your quick answer. > > Volker > > > _______________________________________________ > Emc-users mailing list > Emc-users@... > https://lists.sourceforge.net/lists/listinfo/emc-users > > > > > home page http://fenn.freeshell.org/home.html on da Super Dimension Fortress ```
 Re: [Emc-users] 45 degrees From: goettler - 2006-06-30 08:00:52 Attachments: yourkins.c ```Is that right, that I must only change from axes to global in the TkEmc to switch to teleop mode, or must I do somthing else. If I do so, the Axis quick jerks into a following error by the JOG- Command under global. If I only Jog with Increment < following Error, the Axes move also with extreme Speed an Acceleration (not the limitation from the ini file). The direction of the JOG is equal to directions af the Joints and not equal to the turned coordinate system like I want. Under MDI and G-code the System now works like I want. Thanks: Volker ben lipkowitz schrieb: >Volker, >You need to switch to "teleop" mode - afaik this only works in TkEmc and >you must be homed first. Otherwise jog commands directly jog the motors. > > > > ```
 Re: [Emc-users] 45 degrees From: Alex Joni - 2006-06-24 09:32:49 Attachments: Message as HTML ```You need to change the kinematics type for this to work properly. right now I suspect you are using KINEMATICS_TRIVIAL, but should change = it to KINEMATICS_BOTH. That will bring some consequences with it: 1. you will need to jog in TELEOP mode (tkemc & mini seem to do it = right) 2. you need to home your joints before switching to world view = (carthesian space) Let me know if you still have problems (as it's not the easiest thing to = set up ;) Regards, Alex ----- Original Message -----=20 From: goettler=20 To: Enhanced Machine Controller (EMC)=20 Cc: ben lipkowitz=20 Sent: Saturday, June 24, 2006 11:55 AM Subject: Re: [Emc-users] 45 degrees Thanks for the information, now it works. I have changed the two attached file. The formula for inverse kinematics and kinematics I used: #define SIN45 0.70710678 #define COS45 0.70710678 joints[0] =3D pos->tran.x*COS45 + pos->tran.y*-(SIN45); joints[1] =3D pos->tran.x*SIN45 + pos->tran.y*COS45; pos->tran.x =3D joints[0]*-(COS45) + joints[1]*SIN45; pos->tran.y =3D joints[0]*-(SIN45) + joints[1]*-(COS45); There are still existing some problems: 1. If I use free motion commands like the Jog command, and enter in = MDI- Mode, there is a following error. The coordinate system isn=B4t turned for = Jog command. Can the direction of the Jog command equal be turned, like the for = example contured motion. Volker ben lipkowitz schrieb: Volker, you need to edit emc2/src/kinematics/trivkins.c which is the default=20 transformation from cartesian coordinates to joint (motor) coordinates.=20 One way to do it would be to modify it to include: #define COS45 0.70710678 #define COS_45 0.70710678 #define SIN45 0.70710678 #define SIN_45 -0.70710678 (in kinematicsForward) pos->tran.x =3D joints[0]*COS_45 - joints[1]*SIN_45; pos->tran.y =3D joints[0]*SIN_45 + joints[1]*COS_45; (and in kinematicsInverse) joints[0] =3D pos->tran.x*COS45 - pos->tran.y*SIN45; joints[1] =3D pos->tran.x*SIN45 + pos->tran.y*COS45; Sorry about the icky #define's I would have tested to make sure this works but i seem to have borked my = compiler just now. HTH -fenn From: goettler The formula I think its right, is a little different: newX =3D oldX * cos(45 degree) - oldY * sin(45 degree) newY =3D oldX * sin(45 degree) + oldY * cos(45 degree) but math is not the Problem. I dont know where to place this transformation permanent in the EMC2, so that my stepper motors on the X and Y Axes behave like the coordinate system is turned about 45?. Because my machine has a special kinematik in that the workpieces, always turned to exakt 45 Degrees I want this permanent. Therefor the Machine Coordinate System also can be turned 45? to the physical X and Y Axes, thats als OK. I think, this transformation must take place elsewhere between the Nist 247 G-Code Interpreter with the Display Frontend and the motion = Controller. The Display should show the Coordinates matching to the Diretion of the Workpiece. Thanks for your quick answer. Volker =20 _______________________________________________ Emc-users mailing list Emc-users@... https://lists.sourceforge.net/lists/listinfo/emc-users =20 -------------------------------------------------------------------------= ----- /******************************************************************** * Description: yourkins.c * Trivial kinematics for 3 axis Cartesian machine * X and Y turned 45Degree * * Derived from a work by Fred Proctor & Will Shackleford * * Author: * License: GPL Version 2 * System: Linux * =20 * Copyright (c) 2004 All rights reserved. * * Last change: * \$Revision: 1.8 \$ * \$Author: goettler \$ * \$Date: 2006/06/23 14:11:07 \$ ********************************************************************/ #include "motion.h" /* these decls */ #define SIN45 0.70710678 #define COS45 0.70710678 int kinematicsForward(const double *joints, EmcPose * pos, const KINEMATICS_FORWARD_FLAGS * fflags, KINEMATICS_INVERSE_FLAGS * iflags) { pos->tran.x =3D joints[0]*-(COS45) + joints[1]*SIN45; pos->tran.y =3D joints[0]*-(SIN45) + joints[1]*-(COS45); pos->tran.z =3D joints[2]; pos->a =3D joints[3]; pos->b =3D joints[4]; pos->c =3D joints[5]; return 0; } int kinematicsInverse(const EmcPose * pos, double *joints, const KINEMATICS_INVERSE_FLAGS * iflags, KINEMATICS_FORWARD_FLAGS * fflags) { joints[0] =3D pos->tran.x*COS45 + pos->tran.y*-(SIN45); joints[1] =3D pos->tran.x*SIN45 + pos->tran.y*COS45; joints[2] =3D pos->tran.z; joints[3] =3D pos->a; joints[4] =3D pos->b; joints[5] =3D pos->c; return 0; } /* implemented for these kinematics as giving joints preference */ int kinematicsHome(EmcPose * world, double *joint, KINEMATICS_FORWARD_FLAGS * fflags, KINEMATICS_INVERSE_FLAGS * iflags) { *fflags =3D 0; *iflags =3D 0; return kinematicsForward(joint, world, fflags, iflags); } KINEMATICS_TYPE kinematicsType() { return KINEMATICS_IDENTITY; } -------------------------------------------------------------------------= ----- # # @configure_input@=20 # on @DATE@ # # User definable build-options # use the next few lines to define the kind of kinematics you want = linked # into the motion module #KINEMATICS=3Dtrivkins KINEMATICS=3Dyourkins #(make sure there is a file emc2/src/emc/kinematics/yourkins.c) # Directories ############# prefix=3D@...@ exec_prefix=3D@...@ EMC2_HOME=3D@...@ LIB_DIR=3D@...@/lib #used for install stuff #but have them here as reference #build system only uses EMC2_RTLIB_DIR when creating rtapi.conf EMC2_BIN_DIR=3D@...@ EMC2_TCL_DIR=3D@...@ EMC2_HELP_DIR=3D@...@ EMC2_RTLIB_DIR=3D@...@ EMC2_CONFIG_DIR=3D@...@ EMC2_USER_CONFIG_DIR=3D~/emc2/configs EMC2_SYSTEM_CONFIG_DIR=3D/usr/local/etc/emc2/configs EMC2_NCFILES_DIR=3D@...@ REALTIME=3D@...@ EMC2_IMAGEDIR=3D@...@ MODULE_EXT=3D@...@ # module extension, used when insmod'ing # used for building RTDIR =3D @RTDIR@ # Standard configure directories # do we really need these? bindir =3D @bindir@ sbindir =3D @sbindir@ libexecdir =3D @libexecdir@ datadir =3D @datadir@ sysconfdir =3D @sysconfdir@ sharedstatedir =3D @sharedstatedir@ localstatedir =3D @localstatedir@ libdir =3D @libdir@ infodir =3D @infodir@ mandir =3D @mandir@ includedir =3D @includedir@ moduledir =3D @MODULE_DIR@ rip_moduledir =3D @RIP_MODULE_DIR@ kernelvers =3D @KERNEL_VERS@ # i18n variables: package =3D @PACKAGE@ localedir =3D @LOCALEDIR@ LANGUAGES =3D @LANGUAGES@ #still needs discussion # do we really need these? initd_dir =3D /etc/init.d docsdir =3D \${prefix}/share/doc/emc2 ncfilesdir =3D \${prefix}/share/emc/ncfiles tcldir =3D \${prefix}/share/emc/tcl # /Standard configure directories RUN_IN_PLACE =3D @RUN_IN_PLACE@ RTNAME =3D @RTNAME@ RTPREFIX =3D @RTPREFIX@ RTAI =3D @RTAI@ RTFLAGS =3D @RTFLAGS@ @EXT_RTFLAGS@ KERNELDIR =3D @KERNELDIR@ RTFLAGS :=3D -I. -I@...@/include \$(RTFLAGS) -DRTAPI -D_GNU_SOURCE = -Drealtime -D_FORTIFY_SOURCE=3D0 USE_RTLIBM =3D @USE_RTLIBM@ USE_LIBM =3D @USE_LIBM@ USE_STUBS =3D @USE_STUBS@ MATHINC =3D @MATHINC@ MATHLIB =3D @MATHLIB@ ULFLAGS =3D -Wall -g -I. -I@...@/include -DULAPI -D_GNU_SOURCE -O2 = -DLOCALE_DIR=3D\"\$(localedir)\" -DPACKAGE=3D\"\$(package)\" MODULE_EXT =3D @MODEXT@ BUILD_SYS =3D @BUILD_SYS@ CC =3D @CC@ DEPSTYLE =3D @DEPSTYLE@ # local flags for GTK include GTK_VERSION =3D @GTK_VER@ GTK_CFLAGS =3D @GTK_CFLAGS@ GTK_LIBS =3D @GTK_LIBS@ # tcl tk cflags, includes and libs TCL_DBGX=3D@...@ TK_DBGX=3D@...@ TCL_CFLAGS=3D@...@ @TK_CFLAGS@ TCL_LIBS=3D@...@ @TK_LIBS@ @LIBS@ AR =3D @AR@ ARFLAGS =3D cr CXX =3D @CXX@ CFLAGS +=3D @WFLAGS@ CXXFLAGS =3D \$(CFLAGS) MAKEFLAGS =3D @MAKEFLAGS@ RANLIB =3D @RANLIB@ RANLIBFLAGS =3D=20 # # i18n # #### BEGIN CONFIG #### # To disable compilation of any particular module, # edit the following lines replacing "m" with "n". # # In time, we may have some fancy dohicky to set # these options at compile time. # usually you need rtapi, # so you probably don't want to change this CONFIG_RTAPI=3Dm # rtapi examples CONFIG_RTAPI_EXAMPLES_EXTINT=3Dm CONFIG_RTAPI_EXAMPLES_FIFO=3Dm CONFIG_RTAPI_EXAMPLES_SEM=3Dm CONFIG_RTAPI_EXAMPLES_SHMEM=3Dm CONFIG_RTAPI_EXAMPLES_TIMER=3Dm # emc motion module CONFIG_MOTMOD=3Dm # HAL components CONFIG_BLOCKS=3Dm CONFIG_DEBOUNCE=3Dm CONFIG_ENCODER=3Dm CONFIG_ENCODER_RATIO=3Dm CONFIG_STEPGEN=3Dm CONFIG_FREQGEN=3Dm CONFIG_SIGGEN=3Dm CONFIG_PID=3Dm CONFIG_SUPPLY=3Dm CONFIG_CLASSICLADDER_RT=3Dm CONFIG_TIMEDELAY=3Dm CONFIG_SIM_ENCODER=3Dm # HAL drivers CONFIG_HAL_PARPORT=3Dm CONFIG_HAL_TIRO=3Dm CONFIG_HAL_EVOREG=3Dm CONFIG_HAL_MOTENC=3Dm CONFIG_HAL_SKELETON=3Dm CONFIG_HAL_STG=3Dm CONFIG_HAL_VTI=3Dm CONFIG_HAL_M5I20=3Dm CONFIG_HAL_AX521H=3Dm CONFIG_HAL_PPMC=3Dm # AXIS autobuild support BUILD_AXIS=3D@...@ AXIS_DIR=3D@...@ #### END CONFIG #### -------------------------------------------------------------------------= ----- Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 -------------------------------------------------------------------------= ----- _______________________________________________ Emc-users mailing list Emc-users@... https://lists.sourceforge.net/lists/listinfo/emc-users -------------------------------------------------------------------------= ----- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.9.3/374 - Release Date: = 23.6.2006 ```