Re: [Emc-users] syncing two motors to one axis

2009-04-15 Thread Len Shelton
: [Emc-users] syncing two motors to one axis



On 11 Apr 2009 at 5:45, Len Shelton wrote:

 
 I am unsure of some of the syntax, and this is untested. I will be
 back in
 the shop in a few hours and will be able to try it out.

When I'm testing I do a bit at a time if possible...

 
 Do you see anything blatantly wrong with any of my code?
 
 Do I have to name every signal, particularly the ones to the inputs
 of the
 logic gates? In other words is:

Yes each signal needs a unique name. 

 
net home1  parport.0.pin-10-in and2.0.in0
 
 the same as:
 
net parport.0.pin-10-inand2.0.in0 
 
 ?
 
 Len
  
 
 
 
 -Original Message-
 From: Stephen Wille Padnos [mailto:spad...@sover.net] 
 Sent: Friday, April 10, 2009 10:32 AM
 To: Enhanced Machine Controller (EMC)
 Subject: Re: [Emc-users] syncing two motors to one axis
 
 Len Shelton wrote:
 
 Jon and Rob,
 
 You guys obviously know a lot more about the inner working of HAL
 than I. I
 am still no closer to understanding what lines of code I need to
 put into
 my
 HAL file.
 
 Can you please translate this simple boolean text notation...
 
 home_en1 = dir OR NOT home1
 home_en2 = dir OR NOT home2
 step_1 = step AND home_en1
 step_2 = step AND home_en2
 home = ( ( home1 AND home2 ) AND NOT dir ) OR ( ( home 1 OR
 home2 )
 AND dir )
 
 ...to actual HAL syntax.
   
 
 Well, I'll point you in the right direction anyway :)
 
 First off, the manual sections on HAL are quite good - you should
 (re) 
 read them.
 
 I'm not sure your logic is correct.  I don't believe that the home
 signal should depend on the DIR signal.  I'm pretty sure that home
 should just be (home1 AND home2).  If both switches are closed, then
 you're home regardless of which way the DIR line is pointing. 
 
 Looking at your logic description, these things are apparent:
 1) there are four occurrences of the word OR
 2) there are five occurrences of the word AND
 3) there are three occurrences of the word NOT.  Luckily, all of
 the 
 signals that get inverted come from I/O (if you're using my HOME 
 equation), which provides both a normal and inverted output to HAL,
 so 
 you don't actually need any NOT functions
 4) all of the logical operations are operating on exactly two items
 (ie, 
 there is no a OR b OR c)
 5) This is for only one axis (phew!)
 6) Changing the home equation to home=(home1 AND home2) reduces the
 number of gates to 2x OR, 3x AND, and zero NOT (since you can use
 the 
 inverted home1 and home2 inputs)
 
 Here's how to get 3 AND gates:
 loadrt and2 count=3
 
 This will give you 3 two-input AND gates.  Each one has a function
 which 
 needs to be added to your base thread, before the motion controller
 runs.  This will be a little tricky to get right, since you want to
 read 
 inputs before doing the logic operations, and you want results to 
 propagate through the logic caluclations correctly, you have to
 think 
 about which inputs get connected to which logic elements, and the
 order in which they are evaluated.  I'd suggest drawing this out on
 paper, using a grid.  Start with the inputs on the left, run them 
 towards the right, using columns with only one gate in each logic
 path.  
 When you add functions to the HAL thread, start at the top left and
 add 
 the first column of functions from top to bottom.  Then move over
 one 
 column to the right and add those functions from top to bottom.
 
 This is the logic I would use, which may make the order the
 functions 
 need to run mode obvious:
 step1 = step AND (dir OR home1-invert)
 step2 = step AND (dir OR home2-invert)
 home = (home1 AND home2)
 
 Sorry for the long-winded and not very specific post.  Hope it
 helps.
 - Steve
 
 
 
 
 --
 This SF.net email is sponsored by:
 High Quality Requirements in a Collaborative Environment.
 Download a free trial of Rational Requirements Composer Now!
 http://p.sf.net/sfu/www-ibm-com
 ___
 Emc-users mailing list
 Emc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/emc-users
 
 
 
 --
 This SF.net email is sponsored by:
 High Quality Requirements in a Collaborative Environment.
 Download a free trial of Rational Requirements Composer Now!
 http://p.sf.net/sfu/www-ibm-com
 ___
 Emc-users mailing list
 Emc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/emc-users
 




--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https

Re: [Emc-users] syncing two motors to one axis

2009-04-15 Thread Len Shelton
Oops, I meant that I had to add a NOT because of the inverted direction
signal...

Also, beware - there is a line with two nets in it that are actually on
two separate lines. Not sure why my text editor did that - looked fine when
I hit send.

Len



-Original Message-
From: Len Shelton [mailto:l...@probotix.com] 
Sent: Wednesday, April 15, 2009 10:03 PM
To: 'Enhanced Machine Controller (EMC)'
Cc: 'Rob Tilton'
Subject: Re: [Emc-users] syncing two motors to one axis

Gentlemen,

This works! I have had it running for the past week, but I was hoping to
have time to get the rest of the limit/home switches installed before I
posted this.


hal

# Generated by stepconf at Thu Apr  9 23:04:57 2009
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD
servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]SERVO_PERIOD
key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg=0x378
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0

loadrt and2 count=3 
loadrt or2 count=3 
loadrt not count=1 

addf and2.0 base-thread  
addf and2.1 base-thread 
addf and2.2 base-thread 
addf or2.0 base-thread
addf or2.1 base-thread
addf or2.2 base-thread
addf not.0 base-thread

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread

setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd = stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb = axis.0.motor-pos-fb
net xstep = stepgen.0.step
net xdir = stepgen.0.dir
net xenable axis.0.amp-enable-out = stepgen.0.enable

setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd = stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb = axis.1.motor-pos-fb
net ystep = stepgen.1.step
net ydir = stepgen.1.dir
net yenable axis.1.amp-enable-out = stepgen.1.enable

setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd = stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb = axis.2.motor-pos-fb
net zstep = stepgen.2.step
net zdir = stepgen.2.dir
net zenable axis.2.amp-enable-out = stepgen.2.enable

setp parport.0.pin-02-out-reset 1
setp parport.0.pin-03-out-invert 1
setp parport.0.pin-04-out-reset 1
setp parport.0.pin-06-out-reset 1
setp parport.0.pin-08-out-reset 1
setp parport.0.pin-09-out-invert 1


net home-y1 = parport.0.pin-15-in
net home-y2 = parport.0.pin-10-in

net home-y1 and2.0.in0
net home-y2 and2.0.in1
net home-y  and2.0.out

net home-y  = axis.1.home-sw-in

net home-y1-inv = parport.0.pin-15-in-not
net home-y2-inv = parport.0.pin-10-in-not

net ydirnot.0.in
net ydir-notnot.0.out

net ydir-notor2.0.in0
net home-y1-inv or2.0.in1
net doh1or2.0.out

net ydir-notor2.1.in1
net home-y2-inv or2.1.in0
net doh2or2.1.out   

net ystep   and2.1.in0
net doh1and2.1.in1
net ystep1  and2.1.out

net ystep   and2.2.in0
net doh2and2.2.in1
net ystep2  and2.2.out

net xstep   = parport.0.pin-04-out
net xdir= parport.0.pin-05-out
net ystep1  = parport.0.pin-02-out 
net ystep2  = parport.0.pin-08-out
net ydir= parport.0.pin-03-out 
net ydir= parport.0.pin-09-out
net zstep   = parport.0.pin-06-out
net zdir= parport.0.pin-07-out

net home-y1 or2.2.in0
net home-y1 or2.2.in1
net neg-limit-y or2.2.out

net neg-limit-y = axis.1.neg-lim-sw-in
#net home-y1 = axis.1.pos-lim-sw-in
#net home-y2 = axis.1.pos-lim-sw-in

net estop-ext = parport.0.pin-13-in-not

#net estop-out = iocontrol.0.user-enable-out
#net estop-out = iocontrol.0.emc-enable-in

net estop-out = iocontrol.0.user-enable-out
net estop-ext = iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change = hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed = hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number = hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare =
iocontrol.0.tool-prepared

/hal

After taking the time to actually study the HAL manual, I have to say that
HAL ROCKS!

I had to add an extra OR to the logic you guys suggested because my

Re: [Emc-users] syncing two motors to one axis

2009-04-15 Thread Chris Radek
On Wed, Apr 15, 2009 at 10:13:12PM -0600, Len Shelton wrote:
 
 After taking the time to actually study the HAL manual, I have to say that
 HAL ROCKS!
 
 It's really neat to see it in action with an intentionally skewed gantry.

Can you make a video of this somehow?  I would love to see it!

 I'd like to give back by contributing this to the wiki. Can someone do that,
 or can I get access to do that? 

Anyone can edit the wiki - the instructions for editing
are here:  http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?BasicSteps

Chris


--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-15 Thread Kirk Wallace
On Wed, 2009-04-15 at 22:03 -0600, Len Shelton wrote:
 Gentlemen,
 
 This works! I have had it running for the past week, but I was hoping to
 have time to get the rest of the limit/home switches installed before I
 posted this.

Congratulations Len. I'm glad you persevered. I'm looking forward to
pictures or a video.

-- 
Kirk Wallace
http://www.wallacecompany.com/machine_shop/
http://www.wallacecompany.com/E45/index.html
California, USA


--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-12 Thread John Thornton


On 11 Apr 2009 at 5:45, Len Shelton wrote:

 
 I am unsure of some of the syntax, and this is untested. I will be
 back in
 the shop in a few hours and will be able to try it out.

When I'm testing I do a bit at a time if possible...

 
 Do you see anything blatantly wrong with any of my code?
 
 Do I have to name every signal, particularly the ones to the inputs
 of the
 logic gates? In other words is:

Yes each signal needs a unique name. 

 
net home1  parport.0.pin-10-in and2.0.in0
 
 the same as:
 
net parport.0.pin-10-inand2.0.in0 
 
 ?
 
 Len
  
 
 
 
 -Original Message-
 From: Stephen Wille Padnos [mailto:spad...@sover.net] 
 Sent: Friday, April 10, 2009 10:32 AM
 To: Enhanced Machine Controller (EMC)
 Subject: Re: [Emc-users] syncing two motors to one axis
 
 Len Shelton wrote:
 
 Jon and Rob,
 
 You guys obviously know a lot more about the inner working of HAL
 than I. I
 am still no closer to understanding what lines of code I need to
 put into
 my
 HAL file.
 
 Can you please translate this simple boolean text notation...
 
 home_en1 = dir OR NOT home1
 home_en2 = dir OR NOT home2
 step_1 = step AND home_en1
 step_2 = step AND home_en2
 home = ( ( home1 AND home2 ) AND NOT dir ) OR ( ( home 1 OR
 home2 )
 AND dir )
 
 ...to actual HAL syntax.
   
 
 Well, I'll point you in the right direction anyway :)
 
 First off, the manual sections on HAL are quite good - you should
 (re) 
 read them.
 
 I'm not sure your logic is correct.  I don't believe that the home
 signal should depend on the DIR signal.  I'm pretty sure that home
 should just be (home1 AND home2).  If both switches are closed, then
 you're home regardless of which way the DIR line is pointing. 
 
 Looking at your logic description, these things are apparent:
 1) there are four occurrences of the word OR
 2) there are five occurrences of the word AND
 3) there are three occurrences of the word NOT.  Luckily, all of
 the 
 signals that get inverted come from I/O (if you're using my HOME 
 equation), which provides both a normal and inverted output to HAL,
 so 
 you don't actually need any NOT functions
 4) all of the logical operations are operating on exactly two items
 (ie, 
 there is no a OR b OR c)
 5) This is for only one axis (phew!)
 6) Changing the home equation to home=(home1 AND home2) reduces the
 number of gates to 2x OR, 3x AND, and zero NOT (since you can use
 the 
 inverted home1 and home2 inputs)
 
 Here's how to get 3 AND gates:
 loadrt and2 count=3
 
 This will give you 3 two-input AND gates.  Each one has a function
 which 
 needs to be added to your base thread, before the motion controller
 runs.  This will be a little tricky to get right, since you want to
 read 
 inputs before doing the logic operations, and you want results to 
 propagate through the logic caluclations correctly, you have to
 think 
 about which inputs get connected to which logic elements, and the
 order in which they are evaluated.  I'd suggest drawing this out on
 paper, using a grid.  Start with the inputs on the left, run them 
 towards the right, using columns with only one gate in each logic
 path.  
 When you add functions to the HAL thread, start at the top left and
 add 
 the first column of functions from top to bottom.  Then move over
 one 
 column to the right and add those functions from top to bottom.
 
 This is the logic I would use, which may make the order the
 functions 
 need to run mode obvious:
 step1 = step AND (dir OR home1-invert)
 step2 = step AND (dir OR home2-invert)
 home = (home1 AND home2)
 
 Sorry for the long-winded and not very specific post.  Hope it
 helps.
 - Steve
 
 
 
 
 --
 This SF.net email is sponsored by:
 High Quality Requirements in a Collaborative Environment.
 Download a free trial of Rational Requirements Composer Now!
 http://p.sf.net/sfu/www-ibm-com
 ___
 Emc-users mailing list
 Emc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/emc-users
 
 
 
 --
 This SF.net email is sponsored by:
 High Quality Requirements in a Collaborative Environment.
 Download a free trial of Rational Requirements Composer Now!
 http://p.sf.net/sfu/www-ibm-com
 ___
 Emc-users mailing list
 Emc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/emc-users
 



--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-11 Thread Len Shelton
Thanks for the help so far. I did some studying of the manual last night and
this is what I have come up with based upon your logic:

loadrt and2 count=3 
loadrt or2 count=2 

addf and2.0 base-thread 
addf or2.0 base-thread 

net home1   parport.0.pin-10-in and2.0.in0
net home2   parport.0.pin-11-in and2.0.in1

net home1inv  = parport.0.pin-10-in-invert
net home2inv  = parport.0.pin-11-in-invert

net homeand2.0.out
net home= axis.1.home-sw-in

net doh1a   Ydiror2.0.in0
net doh1b   home1invor2.0.in1
net doh1or2.0.out

net doh2a   Ydiror2.1.in0
net doh2b   home2invor2.1.in1
net doh2or2.1.out   

net ystep1a   Ystep  and2.1.in0
net ystep1b   doh1   and2.1.in1
net ystep1and2.1.out

net ystep2a   Ystep  and2.2.in0
net ystep2b   doh2   and2.2.in1
net ystep2and2.2.out

net Xstep   = parport.0.pin-03-out
net Xdir= parport.0.pin-02-out
net ystep1  = parport.0.pin-05-out 
net ystep2  = parport.0.pin-07-out
net ydir= parport.0.pin-04-out parport.0.pin-06-out
net Zstep   = parport.0.pin-09-out
net Zdir= parport.0.pin-08-out

I am unsure of some of the syntax, and this is untested. I will be back in
the shop in a few hours and will be able to try it out.

Do you see anything blatantly wrong with any of my code?

Do I have to name every signal, particularly the ones to the inputs of the
logic gates? In other words is:

   net home1parport.0.pin-10-in and2.0.in0

the same as:

   net parport.0.pin-10-in  and2.0.in0 

?

Len
 



-Original Message-
From: Stephen Wille Padnos [mailto:spad...@sover.net] 
Sent: Friday, April 10, 2009 10:32 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] syncing two motors to one axis

Len Shelton wrote:

Jon and Rob,

You guys obviously know a lot more about the inner working of HAL than I. I
am still no closer to understanding what lines of code I need to put into
my
HAL file.

Can you please translate this simple boolean text notation...

home_en1 = dir OR NOT home1
home_en2 = dir OR NOT home2
step_1 = step AND home_en1
step_2 = step AND home_en2
home = ( ( home1 AND home2 ) AND NOT dir ) OR ( ( home 1 OR home2 )
AND dir )

...to actual HAL syntax.
  

Well, I'll point you in the right direction anyway :)

First off, the manual sections on HAL are quite good - you should (re) 
read them.

I'm not sure your logic is correct.  I don't believe that the home 
signal should depend on the DIR signal.  I'm pretty sure that home 
should just be (home1 AND home2).  If both switches are closed, then 
you're home regardless of which way the DIR line is pointing. 

Looking at your logic description, these things are apparent:
1) there are four occurrences of the word OR
2) there are five occurrences of the word AND
3) there are three occurrences of the word NOT.  Luckily, all of the 
signals that get inverted come from I/O (if you're using my HOME 
equation), which provides both a normal and inverted output to HAL, so 
you don't actually need any NOT functions
4) all of the logical operations are operating on exactly two items (ie, 
there is no a OR b OR c)
5) This is for only one axis (phew!)
6) Changing the home equation to home=(home1 AND home2) reduces the 
number of gates to 2x OR, 3x AND, and zero NOT (since you can use the 
inverted home1 and home2 inputs)

Here's how to get 3 AND gates:
loadrt and2 count=3

This will give you 3 two-input AND gates.  Each one has a function which 
needs to be added to your base thread, before the motion controller 
runs.  This will be a little tricky to get right, since you want to read 
inputs before doing the logic operations, and you want results to 
propagate through the logic caluclations correctly, you have to think 
about which inputs get connected to which logic elements, and the 
order in which they are evaluated.  I'd suggest drawing this out on 
paper, using a grid.  Start with the inputs on the left, run them 
towards the right, using columns with only one gate in each logic path.  
When you add functions to the HAL thread, start at the top left and add 
the first column of functions from top to bottom.  Then move over one 
column to the right and add those functions from top to bottom.

This is the logic I would use, which may make the order the functions 
need to run mode obvious:
step1 = step AND (dir OR home1-invert)
step2 = step AND (dir OR home2-invert)
home = (home1 AND home2)

Sorry for the long-winded and not very specific post.  Hope it helps.
- Steve



--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Emc-users mailing list

Re: [Emc-users] syncing two motors to one axis

2009-04-11 Thread Len Shelton
I also noticed some other signals that may be useful?

axis.N.homing OUT bit 
#TRUE if the joint is currently homing
axis.N.home-sw-in IN bit  
#Should be driven TRUE if the home switch for this joint is closed
axis.N.home-state
#Reflects the step of homing currently taking place
axis.N.homed
#TRUE if the joint has been homed

I wonder what the possible values of home-state are and how they could be
used.

Len

-Original Message-
From: Len Shelton [mailto:l...@probotix.com] 
Sent: Saturday, April 11, 2009 5:46 AM
To: 'Enhanced Machine Controller (EMC)'
Subject: Re: [Emc-users] syncing two motors to one axis

Thanks for the help so far. I did some studying of the manual last night and
this is what I have come up with based upon your logic:

loadrt and2 count=3 
loadrt or2 count=2 

addf and2.0 base-thread 
addf or2.0 base-thread 

net home1   parport.0.pin-10-in and2.0.in0
net home2   parport.0.pin-11-in and2.0.in1

net home1inv  = parport.0.pin-10-in-invert
net home2inv  = parport.0.pin-11-in-invert

net homeand2.0.out
net home= axis.1.home-sw-in

net doh1a   Ydiror2.0.in0
net doh1b   home1invor2.0.in1
net doh1or2.0.out

net doh2a   Ydiror2.1.in0
net doh2b   home2invor2.1.in1
net doh2or2.1.out   

net ystep1a   Ystep  and2.1.in0
net ystep1b   doh1   and2.1.in1
net ystep1and2.1.out

net ystep2a   Ystep  and2.2.in0
net ystep2b   doh2   and2.2.in1
net ystep2and2.2.out

net Xstep   = parport.0.pin-03-out
net Xdir= parport.0.pin-02-out
net ystep1  = parport.0.pin-05-out 
net ystep2  = parport.0.pin-07-out
net ydir= parport.0.pin-04-out parport.0.pin-06-out
net Zstep   = parport.0.pin-09-out
net Zdir= parport.0.pin-08-out

I am unsure of some of the syntax, and this is untested. I will be back in
the shop in a few hours and will be able to try it out.

Do you see anything blatantly wrong with any of my code?

Do I have to name every signal, particularly the ones to the inputs of the
logic gates? In other words is:

   net home1parport.0.pin-10-in and2.0.in0

the same as:

   net parport.0.pin-10-in  and2.0.in0 

?

Len
 



-Original Message-
From: Stephen Wille Padnos [mailto:spad...@sover.net] 
Sent: Friday, April 10, 2009 10:32 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] syncing two motors to one axis

Len Shelton wrote:

Jon and Rob,

You guys obviously know a lot more about the inner working of HAL than I. I
am still no closer to understanding what lines of code I need to put into
my
HAL file.

Can you please translate this simple boolean text notation...

home_en1 = dir OR NOT home1
home_en2 = dir OR NOT home2
step_1 = step AND home_en1
step_2 = step AND home_en2
home = ( ( home1 AND home2 ) AND NOT dir ) OR ( ( home 1 OR home2 )
AND dir )

...to actual HAL syntax.
  

Well, I'll point you in the right direction anyway :)

First off, the manual sections on HAL are quite good - you should (re) 
read them.

I'm not sure your logic is correct.  I don't believe that the home 
signal should depend on the DIR signal.  I'm pretty sure that home 
should just be (home1 AND home2).  If both switches are closed, then 
you're home regardless of which way the DIR line is pointing. 

Looking at your logic description, these things are apparent:
1) there are four occurrences of the word OR
2) there are five occurrences of the word AND
3) there are three occurrences of the word NOT.  Luckily, all of the 
signals that get inverted come from I/O (if you're using my HOME 
equation), which provides both a normal and inverted output to HAL, so 
you don't actually need any NOT functions
4) all of the logical operations are operating on exactly two items (ie, 
there is no a OR b OR c)
5) This is for only one axis (phew!)
6) Changing the home equation to home=(home1 AND home2) reduces the 
number of gates to 2x OR, 3x AND, and zero NOT (since you can use the 
inverted home1 and home2 inputs)

Here's how to get 3 AND gates:
loadrt and2 count=3

This will give you 3 two-input AND gates.  Each one has a function which 
needs to be added to your base thread, before the motion controller 
runs.  This will be a little tricky to get right, since you want to read 
inputs before doing the logic operations, and you want results to 
propagate through the logic caluclations correctly, you have to think 
about which inputs get connected to which logic elements, and the 
order in which they are evaluated.  I'd suggest drawing this out on 
paper, using a grid.  Start with the inputs on the left, run them 
towards the right, using columns with only one gate in each logic path.  
When you add functions to the HAL thread, start at the top left and add 
the first column of functions from top to bottom.  Then move over one 
column to the right

Re: [Emc-users] syncing two motors to one axis

2009-04-10 Thread Stephen Wille Padnos
Len Shelton wrote:

Jon and Rob,

You guys obviously know a lot more about the inner working of HAL than I. I
am still no closer to understanding what lines of code I need to put into my
HAL file.

Can you please translate this simple boolean text notation...

home_en1 = dir OR NOT home1
home_en2 = dir OR NOT home2
step_1 = step AND home_en1
step_2 = step AND home_en2
home = ( ( home1 AND home2 ) AND NOT dir ) OR ( ( home 1 OR home2 )
AND dir )

...to actual HAL syntax.
  

Well, I'll point you in the right direction anyway :)

First off, the manual sections on HAL are quite good - you should (re) 
read them.

I'm not sure your logic is correct.  I don't believe that the home 
signal should depend on the DIR signal.  I'm pretty sure that home 
should just be (home1 AND home2).  If both switches are closed, then 
you're home regardless of which way the DIR line is pointing. 

Looking at your logic description, these things are apparent:
1) there are four occurrences of the word OR
2) there are five occurrences of the word AND
3) there are three occurrences of the word NOT.  Luckily, all of the 
signals that get inverted come from I/O (if you're using my HOME 
equation), which provides both a normal and inverted output to HAL, so 
you don't actually need any NOT functions
4) all of the logical operations are operating on exactly two items (ie, 
there is no a OR b OR c)
5) This is for only one axis (phew!)
6) Changing the home equation to home=(home1 AND home2) reduces the 
number of gates to 2x OR, 3x AND, and zero NOT (since you can use the 
inverted home1 and home2 inputs)

Here's how to get 3 AND gates:
loadrt and2 count=3

This will give you 3 two-input AND gates.  Each one has a function which 
needs to be added to your base thread, before the motion controller 
runs.  This will be a little tricky to get right, since you want to read 
inputs before doing the logic operations, and you want results to 
propagate through the logic caluclations correctly, you have to think 
about which inputs get connected to which logic elements, and the 
order in which they are evaluated.  I'd suggest drawing this out on 
paper, using a grid.  Start with the inputs on the left, run them 
towards the right, using columns with only one gate in each logic path.  
When you add functions to the HAL thread, start at the top left and add 
the first column of functions from top to bottom.  Then move over one 
column to the right and add those functions from top to bottom.

This is the logic I would use, which may make the order the functions 
need to run mode obvious:
step1 = step AND (dir OR home1-invert)
step2 = step AND (dir OR home2-invert)
home = (home1 AND home2)

Sorry for the long-winded and not very specific post.  Hope it helps.
- Steve


--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-09 Thread Len Shelton
Jon and Rob,

You guys obviously know a lot more about the inner working of HAL than I. I
am still no closer to understanding what lines of code I need to put into my
HAL file.

Can you please translate this simple boolean text notation...

home_en1 = dir OR NOT home1
home_en2 = dir OR NOT home2
step_1 = step AND home_en1
step_2 = step AND home_en2
home = ( ( home1 AND home2 ) AND NOT dir ) OR ( ( home 1 OR home2 )
AND dir )

...to actual HAL syntax.

Thanks a bunch, really.

Len


-Original Message-
From: Jon Elson [mailto:el...@pico-systems.com] 
Sent: Wednesday, April 01, 2009 8:30 PM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] syncing two motors to one axis

Len Shelton wrote:
 So, are you saying that it can't presently be done because no one has
 written the hal components to do it?

   
No, actually I do not believe any new HAL components are needed.  You 
need an and gate to detect when both home switches have been tripped.  
This AND output sets a flip-flop.  The flip-flop is cleared when you 
start the home sequence.  When the FF is clear, an and gate stops each 
side of the gantry from moving when that home switch trips.  When the FF 
is set, all move commands pass through.
 I have searched the archives and found very little.

 FWIW - this machine uses steppers and no encoders.
   
OK, your homing is not going to be as precise with this, but it can 
still be plenty good enough for a hobby level machine.  it is also 
simpler, as there is no complex homing sequence to use encoder index 
pulses.  I'm less familiar with the internal hook-up of step generators 
to the parallel port, but what you want to do is stop the first side 
that hits home, and not terminate the homing sequence until BOTH sides 
have hit their home switches.  Sounds quite simple.

Jon


--
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-09 Thread Rob Jansen
Len,

you give me too much credits.
I don't know that much about the HAL and to be honest, I am just able to
understand the HAL files that I got as samples.
Did this all with a bit of standard logic gates since my PC does not have
enough I/O to capture all the signals.
But my 5i20 and 7i43 Mesa cards are about to arrive  so next week I should
be able to start converting one system from 2.2 to 2.3 and start
implementing all these extras in HAL.

I'll post my progress over the next few weeks; I've leeched enough from this
list. Time to contribute ;-)

Cheers,

Rob

Jon and Rob,

 You guys obviously know a lot more about the inner working of HAL than I. I
 am still no closer to understanding what lines of code I need to put into
 my
 HAL file.

 Can you please translate this simple boolean text notation...

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-01 Thread Jon Elson
Len Shelton wrote:
 So let's say you have two drives, two motors, and two home switches on the
 same axis (gantry type machine). The problem with this arrangement is
 synchronization. The control needs to be aware of the two motors and needs
 to home both at the same time. While homing, we need to bring both motors
 towards the home switches together then independently home each motor when
 it reaches the home switch. 

 How can this be done in EMC2?
   
We've gone over this a dozen times, at least.  It would take about 10-15 
lines of HAL and several HAL components to perform the logic.
Basically, you make the two motors run at the same rate.  As each motor 
hits the home switch, it stops.  When both have touched home, they move 
together again to complete the precision home sequence to the encoder 
index pulse.  EMC2 already has features in HAL to handle tandem axes 
like this, once homing is done.  You feed the lettered axis (as in X) 
position to two numbered joints as in zero and one.  So, the only 
detail up in the air is how to do the homing.

Jon

--
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-01 Thread Len Shelton
So, are you saying that it can't presently be done because no one has
written the hal components to do it?

I have searched the archives and found very little.

FWIW - this machine uses steppers and no encoders.

Len



-Original Message-
From: Jon Elson [mailto:el...@pico-systems.com] 
Sent: Wednesday, April 01, 2009 11:28 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] syncing two motors to one axis

Len Shelton wrote:
 So let's say you have two drives, two motors, and two home switches on the
 same axis (gantry type machine). The problem with this arrangement is
 synchronization. The control needs to be aware of the two motors and needs
 to home both at the same time. While homing, we need to bring both motors
 towards the home switches together then independently home each motor when
 it reaches the home switch. 

 How can this be done in EMC2?
   
We've gone over this a dozen times, at least.  It would take about 10-15 
lines of HAL and several HAL components to perform the logic.
Basically, you make the two motors run at the same rate.  As each motor 
hits the home switch, it stops.  When both have touched home, they move 
together again to complete the precision home sequence to the encoder 
index pulse.  EMC2 already has features in HAL to handle tandem axes 
like this, once homing is done.  You feed the lettered axis (as in X) 
position to two numbered joints as in zero and one.  So, the only 
detail up in the air is how to do the homing.

Jon


--
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


--
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-01 Thread Rob Jansen
Len,

steppers makes this problem very easy and it has indeed been discussed 
before.
Searching on the term two motors I was able to retrieve a number of my 
own posts about this.

http://article.gmane.org/gmane.linux.distributions.emc.user/8147/match=two+motors
 
is an older post describing a possible solution in words.
http://article.gmane.org/gmane.linux.distributions.emc.user/10276/match=two+motors
 
is a later posting with some boolean algebra (not HAL though - I decided 
to use standard 74LSxx gate logic).

There are more mail about this. Use 
http://news.gmane.org/gmane.linux.distributions.emc.user to search the 
archives - it's nicer than the sourceforge archives ...

Regards,

Rob

Len Shelton wrote:
 So, are you saying that it can't presently be done because no one has
 written the hal components to do it?

 I have searched the archives and found very little.

 FWIW - this machine uses steppers and no encoders.
   

--
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] syncing two motors to one axis

2009-04-01 Thread Jon Elson
Len Shelton wrote:
 So, are you saying that it can't presently be done because no one has
 written the hal components to do it?

   
No, actually I do not believe any new HAL components are needed.  You 
need an and gate to detect when both home switches have been tripped.  
This AND output sets a flip-flop.  The flip-flop is cleared when you 
start the home sequence.  When the FF is clear, an and gate stops each 
side of the gantry from moving when that home switch trips.  When the FF 
is set, all move commands pass through.
 I have searched the archives and found very little.

 FWIW - this machine uses steppers and no encoders.
   
OK, your homing is not going to be as precise with this, but it can 
still be plenty good enough for a hobby level machine.  it is also 
simpler, as there is no complex homing sequence to use encoder index 
pulses.  I'm less familiar with the internal hook-up of step generators 
to the parallel port, but what you want to do is stop the first side 
that hits home, and not terminate the homing sequence until BOTH sides 
have hit their home switches.  Sounds quite simple.

Jon

--
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users