Master and Slave axes in EMC2+Montec

More
07 Nov 2010 17:30 - 07 Nov 2010 17:30 #5139 by Schnitti
Thanks for the tipps, you can see, what I need!

4 Stepper, 3 axis
Last edit: 07 Nov 2010 17:30 by Schnitti.

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

More
08 Nov 2010 12:12 #5158 by BigJohnT
Nice machine!

John

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

More
08 Nov 2010 16:25 #5164 by Schnitti
Hi John,

this is a real picture from build up my machine. It is a DIY router.

Attachments:

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

More
09 Nov 2010 23:33 #5192 by Rick G
Looks good, is everything working now?

Rick G

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

More
10 Nov 2010 15:51 #5200 by Schnitti
Hi there,

I just tested it in my virtual machine.

Copying Axis0 to Axis3 does NOT do it. As you explained, we need a new stepgen, so I decided to give the dir an steps from Axis3 the new name x1dir and x1step. My opinion is, that if we do not do this, we have 2 X signals. Both ways ends up in an error.

I will append my new hal and ini files.

emc complains

Print file information:
RUN_IN_PLACE=no
EMC2_DIR=
EMC2_BIN_DIR=/usr/bin
EMC2_TCL_DIR=/usr/share/emc/tcl
EMC2_SCRIPT_DIR=
EMC2_RTLIB_DIR=/usr/realtime-2.6.32-122-rtai/modules/emc2
EMC2_CONFIG_DIR=
EMC2_LANG_DIR=/usr/share/emc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
EMC2_EMCSH=/usr/bin/wish8.5
EMC2 - 2.4.5
Machine configuration directory is '/home/wolfgang/emc2/configs/test'
Machine configuration file is 'test.ini'
INIFILE=/home/wolfgang/emc2/configs/test/test.ini
PARAMETER_FILE=emc.var
EMCMOT=motmod
EMCIO=io
TASK=milltask
HALUI=
DISPLAY=axis
NML_FILE=
Starting EMC2...
Starting EMC2 server program: emcsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting EMC2 IO program: io
Shutting down and cleaning up EMC2...
Killing task emcsvr, PID=2283
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Cleanup done

Debug file information:
Unrecognized line skipped: POC FMS LEN DIAM COMMENT
test.hal:83: Ini variable '[AXIS_3]SCALE' not found.
2283
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

Kernel message information:
[ 1095.432455] I-pipe: Domain RTAI registered.
[ 1095.432466] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[ 1095.432470] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[ 1095.432477] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[ 1095.432480] PIPELINE layers:
[ 1095.432485] e3599e20 9ac15d93 RTAI 200
[ 1095.432489] c085cb20 0 Linux 100
[ 1095.483941] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 1095.484631] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[ 1095.484638] RTAI[sched]: hard timer type/freq = APIC/62372381(Hz); default timing: periodic; linear timed lists.
[ 1095.484643] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 990988000 hz.
[ 1095.484647] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[ 1095.484739] RTAI[usi]: enabled.
[ 1095.615434] RTAI[math]: loaded.
[ 1095.741284] GANTRYKINS: joints[0] = 0
[ 1095.741299] GANTRYKINS: joints[1] = 1
[ 1095.741312] GANTRYKINS: joints[2] = 2
[ 1095.741324] GANTRYKINS: joints[3] = 3
[ 1095.741335] GANTRYKINS: joints[4] = 4
[ 1095.741346] GANTRYKINS: joints[5] = 5
[ 1095.741357] GANTRYKINS: joints[6] = -1
[ 1095.741368] GANTRYKINS: joints[7] = -1
[ 1095.741378] GANTRYKINS: joints[8] = -1
[ 1095.782487] config string '0x378 out '
[ 1095.797782] RTAPI: ERROR: Unexpected realtime delay on task 1
[ 1095.797831] This Message will only display once per session.
[ 1095.797862] Run the Latency Test and resolve before continuing.
[ 1096.730887] RTAI[math]: unloaded.
[ 1096.850488] SCHED releases registered named ALIEN RTGLBH
[ 1096.866423] RTAI[malloc]: unloaded.
[ 1096.964853] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[ 1096.999499] I-pipe: Domain RTAI unregistered.
[ 1096.999550] RTAI[hal]: unmounted.

File Attachment:

File Name: test.zip
File Size:2 KB


Wolfgang
Attachments:

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

More
10 Nov 2010 17:01 #5201 by andypugh
You have an interesting hybrid hal file there :-)

Are you wanting to use gantrykins or trivkins?

As a first experiment, change gantrykins to trivkins in the hal file, then change this section:
setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 1
setp stepgen.3.dirhold 230700
setp stepgen.3.dirsetup 230700
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net xpos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net xpos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
net x1step <= stepgen.3.step
net x1dir <= stepgen.3.dir
net xenable axis.3.amp-enable-out => stepgen.3.enable

To:
setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 1
setp stepgen.3.dirhold 230700
setp stepgen.3.dirsetup 230700
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net xpos-cmd  => stepgen.3.position-cmd
net x1step  <= stepgen.3.step
net x1dir <= stepgen.3.dir
net xenable  stepgen.3.enable

That will (well, should) give you three axes linked to 4 stepgens, but with no way to operate the two X motors independently.
What is happening is that the modified code uses the already defined xpos-cmd signal from the master X axis as the input to the extra stepgen.
There is no indpendent feedback from that stegen, but as they are identical that won't matter (it almost never matters anyway, stepgen feedback only ever detects a stopped stepgen thread or a thread frequency that is too slow for the commanded speed, and generally you hit mechanical limits first).


Alternatively, to use Gantrykins you should make these changes:

Add this code immediately after loadrt gantrykins
setp gantrykins.joint-0 0
setp gantrykins.joint-1 1
setp gantrykins.joint-2 2
setp gantrykins.joint-3 0

Then edit the axis3 stuff to this:
setp stepgen.3.position-scale [AXIS_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 1
setp stepgen.3.dirhold 230700
setp stepgen.3.dirsetup 230700
setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
net x1pos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
net x1pos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
net x1step <= stepgen.3.step
net x1dir <= stepgen.3.dir
net x1enable axis.3.amp-enable-out => stepgen.3.enable

(The only difference is to make all the signal names unique)

The Gantrykins version will start up in joint mode, and won't let you switch to XYZ mode until the axes are all homed. It is well worth making sure you have a working homing sequence as jogging two axes to home at the same time is impossible.

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

More
11 Nov 2010 08:59 - 11 Nov 2010 09:00 #5212 by Schnitti
Hi Andy,

seems to be a very interesting problem.

My interpretation is now:

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.

Then I could go on with testing:

Test Results:

a.) Your first way works, giving me axis 0, 1, 2 and homing and worldmode. -> works.

As you lined out, with no possibility to home both x-axis idependently.

b.) using gantrykins:

hopefully correctly copied together:

File Attachment:

File Name: test-06ff7...07aa.zip
File Size:2 KB


gives:

Print file information:
RUN_IN_PLACE=no
EMC2_DIR=
EMC2_BIN_DIR=/usr/bin
EMC2_TCL_DIR=/usr/share/emc/tcl
EMC2_SCRIPT_DIR=
EMC2_RTLIB_DIR=/usr/realtime-2.6.32-122-rtai/modules/emc2
EMC2_CONFIG_DIR=
EMC2_LANG_DIR=/usr/share/emc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
EMC2_EMCSH=/usr/bin/wish8.5
EMC2 - 2.4.5
Machine configuration directory is '/home/wolfgang/emc2/configs/test'
Machine configuration file is 'test.ini'
INIFILE=/home/wolfgang/emc2/configs/test/test.ini
PARAMETER_FILE=emc.var
EMCMOT=motmod
EMCIO=io
TASK=milltask
HALUI=
DISPLAY=axis
NML_FILE=
Starting EMC2...
Starting EMC2 server program: emcsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting EMC2 IO program: io
Shutting down and cleaning up EMC2...
Killing task emcsvr, PID=3403
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments
Cleanup done

Debug file information:
Unrecognized line skipped: POC FMS LEN DIAM COMMENT
test.hal:91: Pin 'axis.3.motor-pos-cmd' does not exist
3403
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components

Kernel message information:
[ 1849.523749] I-pipe: Domain RTAI registered.
[ 1849.523760] RTAI[hal]: <3.8.1> mounted over IPIPE-NOTHREADS 2.6-03.
[ 1849.523764] RTAI[hal]: compiled with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) .
[ 1849.523771] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[ 1849.523775] PIPELINE layers:
[ 1849.523779] e2ab8e20 9ac15d93 RTAI 200
[ 1849.523783] c085cb20 0 Linux 100
[ 1849.580905] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 1849.581484] RTAI[sched]: IMMEDIATE, MP, USER/KERNEL SPACE: <with RTAI OWN KTASKs>, kstacks pool size = 524288 bytes.
[ 1849.581500] RTAI[sched]: hard timer type/freq = APIC/62253769(Hz); default timing: periodic; linear timed lists.
[ 1849.581514] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 990799000 hz.
[ 1849.581526] RTAI[sched]: timer setup = 999 ns, resched latency = 2944 ns.
[ 1849.581769] RTAI[usi]: enabled.
[ 1849.726065] RTAI[math]: loaded.
[ 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
[ 1849.876648] config string '0x378 out '
[ 1849.927385] RTAPI: ERROR: Unexpected realtime delay on task 1
[ 1849.927428] This Message will only display once per session.
[ 1849.927456] Run the Latency Test and resolve before continuing.
[ 1850.897726] RTAI[math]: unloaded.
[ 1851.009362] SCHED releases registered named ALIEN RTGLBH
[ 1851.026632] RTAI[malloc]: unloaded.
[ 1851.124895] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[ 1851.150117] I-pipe: Domain RTAI unregistered.
[ 1851.150141] RTAI[hal]: unmounted.
Attachments:
Last edit: 11 Nov 2010 09:00 by Schnitti. Reason: correction

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

More
11 Nov 2010 09:51 #5215 by Rick G
Maybe I am missing something here but, it looks to me like you are making it more complicated than it needs to be. It appears you have a belt running from one x axis motor to the other mechanically linking them? In this case you will not need separate homing or limit switch settings.

Keep it simple just use the standard Stepconf for xyz and modify the hal file to connect the step and direction pins in hal to the two sets of parallel port pins instead of one (one for each motor that drives x). It may also be possible to use the same 2 parallel port pins to drive both the x drivers.

It seems to me you do not even need an extra axis.

Rick G

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

More
11 Nov 2010 09:55 #5216 by Schnitti
Hi again,

gantrykins is partly working, if we set ini to XYZA mode. 4 joints and 4 axes visible.

switching to XYZX

Integrators Manual:

AXES = 3 One more than the number of the highest joint number in the system. (we have 4 joints!)

It is permitted to write an axis name twice (e.g., X Y Y Z for a gantry machine) but this has no effect.

--> 3 joints/axes.

By the way: gantry with X Y -Y Z should do the invert problem (see Integrators manual)

So I am searching for the trick using gantrykins with 4 joints in joint mode an 3 axes in world mode. This is, what i am expecting from gantrykins.

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

More
11 Nov 2010 10:24 #5218 by Schnitti
Replied by Schnitti on topic Solution!
Hi,

I hope, I could make it!!!

Could someone test it together with me?

Using gantrykins, it shows in HAL Monitor, that we have axis 3 move along with axis 0.

Now I will test on my real machine.

BUT: No independent homing. 3 joints, 3 axes.

File Attachment:

File Name: test-a0162...ba4a.zip
File Size:2 KB
Attachments:

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

Time to create page: 0.265 seconds
Powered by Kunena Forum