Master and Slave axes in EMC2+Montec

More
11 Nov 2010 10:32 #5219 by Schnitti
@ Rick:

If it is fully functional, I will use 4 Motors and leave off the belt. The belt is vibrating and needs additional damping at fast moves.

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

More
11 Nov 2010 11:47 - 11 Nov 2010 12:07 #5225 by andypugh
Schnitti wrote:

hal needs 4 stepgen. ini has only 3 axes. When hal loads, it looks up the parameters for each axis from ini file, but there is no AXIS_3. So I copied AXIS_0 to AXIS_3 in ini. This solves the AXIS_3 not found error.


The HAL file could actually look up the parameters it needs from the [AXIS_0] sections of the ini file if it was written that way. However there are other parts of EMC2 that read values from the INI file (axis limits are read from the ini file by the GUI, I think).

[ 1849.840681] GANTRYKINS: joints[0] = 0
[ 1849.840687] GANTRYKINS: joints[1] = 1
[ 1849.840875] GANTRYKINS: joints[2] = 2
[ 1849.840880] GANTRYKINS: joints[3] = 3
[ 1849.840885] GANTRYKINS: joints[4] = 4
[ 1849.840890] GANTRYKINS: joints[5] = 5
[ 1849.840895] GANTRYKINS: joints[6] = -1
[ 1849.840900] GANTRYKINS: joints[7] = -1
[ 1849.840904] GANTRYKINS: joints[8] = -1


This bit looks wrong. I have looked through the gantrykins code and the coordinates string that you have ought to do the same thing as the 4 setp lines I suggested (I didn't know it took that parameter)

You might find it better to leave [TRAJ] AXES = 3 and then over-ride that in the HAL file (the ini file parameter is used in the loadrt EMCMOT line as the number of joints. Or you might find that that is a bad idea.

Have you looked in the sample configs at stepper-gantry by the way? That uses gantrykins. You could probably simply edit that config.
Last edit: 11 Nov 2010 12:07 by andypugh.

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

More
11 Nov 2010 16:02 #5243 by Schnitti
Replied by Schnitti on topic gantry example
The example hangs my computer. some files got 0 Byte long. manual copy, restart, hang again.

they are using a XYZA modell.

Does anyone run a gantry with htis config? Really running? What are the experiences with it?

Here the relevant parts:


# Kinematics
loadrt gantrykins

# Settings for gantrykins
setp gantrykins.joint-0 0
setp gantrykins.joint-1 1
setp gantrykins.joint-2 2
setp gantrykins.joint-3 1

++++++++++++++++++++++++++++++++++++++++
setp stepgen.3.position-scale [AXIS_3]SCALE

# Set stepgen module velocity limits - get values from ini file

# Set stepgen module accel limits - get values from ini file

setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL

# Hook up stepgen to motion modules

net PosA-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net PosA-fb stepgen.3.position-fb => axis.3.motor-pos-fb

# Hook up enable signals for step generators
net EnableX axis.0.amp-enable-out => stepgen.0.enable
net EnableY axis.1.amp-enable-out => stepgen.1.enable
net EnableZ axis.2.amp-enable-out => stepgen.2.enable
net EnableA axis.3.amp-enable-out => stepgen.3.enable
++++++++++++++++++++++++++++++++++++++++++

# Hook up the step and dir signals to the parport pins
# Axis A and Y are the same axis but different motors
net StepX stepgen.0.step => parport.0.pin-02-out
net StepY stepgen.1.step => parport.0.pin-03-out
net StepZ stepgen.2.step => parport.0.pin-04-out
net StepA stepgen.3.step => parport.0.pin-05-out
net DirX stepgen.0.dir => parport.0.pin-06-out
net DirY stepgen.1.dir => parport.0.pin-07-out
net DirZ stepgen.2.dir => parport.0.pin-08-out
net DirA stepgen.3.dir => parport.0.pin-09-out

+++++++++++++++++++++++++++++++++++++++++++

TRAJ]
#+ machine specific settings
AXES = 4
COORDINATES = X Y Z A
LINEAR_UNITS = 1.0
ANGULAR_UNITS = 1.0
DEFAULT_VELOCITY = 100
MAX_VELOCITY = 180
DEFAULT_ACCELERATION = 600
MAX_ACCELERATION = 2400

+ Second axis (Y)
[AXIS_1]

TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 170
MAX_ACCELERATION = 2400
STEPGEN_MAXACCEL = 2960
BACKLASH = 0.000
SCALE = 150.333
MIN_LIMIT = -1
MAX_LIMIT = 6050.0
FERROR = 1.270
MIN_FERROR = 0.254
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = -50.0
HOME_LATCH_VEL = 1.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1


#+ Second axis (A)
[AXIS_3]

TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 170
MAX_ACCELERATION = 2400
STEPGEN_MAXACCEL = 2960
BACKLASH = 0.000
SCALE = 150.333
OUTPUT_SCALE = 1.000
MIN_LIMIT = -1
MAX_LIMIT = 6050.0
FERROR = 1.270
MIN_FERROR = 0.254
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = -50.0
HOME_LATCH_VEL = 1.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

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

More
11 Nov 2010 16:21 #5244 by andypugh
Replied by andypugh on topic Re:gantry example
Schnitti wrote:

Does anyone run a gantry with htis config? Really running? What are the experiences with it?


I doubt anyone actually uses that specific demostration config, no.

Odd that it uses XYZA, but then what you call the signals in the HAL file is irrelevant anyway.

I will have a play with your configs this evening to see if I can persuade them to work properly.

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

More
11 Nov 2010 16:26 #5246 by Schnitti
Replied by Schnitti on topic Re:gantry example
Andy,

I totally agree to you.

It results in your first proposal, hard connecting the wires/pins. :)

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

More
11 Nov 2010 17:50 #5247 by Schnitti
Replied by Schnitti on topic gantry
Hi there,

BigJohnT wrote a good post #5005 with an example from 4.5

and I found this:

INI

this is close to my understanding. n axes and m joints possible.

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

More
11 Nov 2010 18:16 #5248 by andypugh
Replied by andypugh on topic Re:gantry example
OK, I had a fiddle with the configs you posted earlier.
The only problem was an Axis problem, not a fault in the configs. Unless you have
COORDINATES = XYZA
in the config then you can only jog motors 0 1 and 2, Axis does not create a 3 button. This also means you can't home 3, and can't switch to world mode.

If you then have
loadrt gantrykins coordinates=XYZX
(as you have) then you can skip the 4 setp lines, I checked and the coordinates modparam works as documented.

So, with the config you posted, simply adding an A will let you run in gantrykins mode.

If you do that you should find that Axis starts up with axes 1 2 3 and 4, rather than X Y Z A. You can then jog the X axes seperately. Once all joints are homed, If you press $ then it will switch to World (XYZA) mode. The A is totally inactive and spurious and something needs to be done about that.

It is rather important to add homing switches, homing sequence and search speeds to the INI file if you are going to use gantrykins.

I would be tempted to make the config automatically go into World mode once homed (not too difficult to achieve with a bit of HAL logic operating on the joint.is-homed pins and the halui,mode.teleop and halui.mode.joint pins.

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

More
11 Nov 2010 18:23 #5249 by andypugh
Replied by andypugh on topic Re:gantry
Schnitti wrote:

and I found this
INI


I think that is the proposed structure for the joints_axes3 branch, and is not currently available.

I suppose you could check out and compile that branch :-)

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

More
11 Nov 2010 20:40 #5254 by viesturs.lacis
Hello!

I have a gantry machine and currently I am using custom kinematics module, but at the beginning I was using gantrykins, so I will try to share my experience.

First thing is that AFAIK in EMC2 the number of joints in joint mode and number of axis in world mode is the same. I have 2 motors on X axis and I have always had XYZA axis in world mode. I do not know the way to change that, From the discussions with Andy Pugh I recall that he mentioned - this joint/axis thing will be sorted out in one of the next major releases of EMC2, because there is A LOT of rewrite to do to sort it out.

So my opinion:
1) put 4 joints in INI file - from Axis0 to Axis3,
2 in kinematics file assign joint to axis in whatever order You want - I have joint.0 and joint.1 assigned to X axis
3) my subjective suggestion - in HAL file You have x and x1, I think that for any reader it would be easier to understand, if You had x1 and x2 - both with numbers. You are kindly welcome to ignore this, if You prefer so :)
4) unfortunately - get used to having one more axis un world mode in EMC2. AFAIK it just is the way it is. That won't hurt anyway - You can even test - try some test g-code and include commands for A axis - nothing happened when I tested it.

So conclusion - gantrykins is working nicely, just the thing that EMC2 wants the number of axis to be the same as number of joints, but I do not know, if there is a solution yet. If there is, please let me know, I would like to sort that out too.

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

More
12 Nov 2010 09:15 #5259 by Schnitti
Hi,

OK thats same result I got when testing it. :)

Screenshot with axis NOT running A but HAL does.



Thanks.

Wolfgang
Attachments:

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

Time to create page: 0.099 seconds
Powered by Kunena Forum