Re: [Emc-users] Synchronised cam turning

2009-07-21 Thread Leslie Newell
Hi Jack,

I have done this. A couple of years back I built a 2' x 4' router for a 
local wood worker. It also had an A axis that he used for turning barley 
twist legs and such like. It took a bit of settings up but it worked 
reasonably well. I created a SheetCam post to do the appropriate axis 
swapping.

I don't currently have an A axis for my mill and I can't really justify 
the time and money to build one just for this job. The idea of using a 
lathe with a few code tweaks is much more appealing :-)

I did try playing around with turning the spindle into an A axis but I 
had lots of trouble with tuning. The combination of inverter drive and a 
fair amount of backlash in the gearbox made things rather difficult. I 
might have another go and see if I can get some semblance of stability 
at speed. The spindle encoder gives 4000 counts/rev so if I can get the 
PID loop stable it should have enough resolution for this job.

Les

Jack wrote:
 I went to a ShopBot event last year and saw where folks did 'turning' using
 their indexer.
 
 The process they used was to determine the 'final diameter' and layed out a
 rectangle
 of 'unwraped' surface (length as the length of the turning, width of the
 'final diameter').
 Then put whatever they wanted on the 'triangle' using various methods.  Once
 done,
 the pathed it, and used the just routed the piece as a plane, using the
 indexer as the
 'x' axis, and the 'y' axis as the indexer.
 
 You might be able to take that thought and make your 'unwraped surface' to
 be the
 profiles of the 'unwrapped' cams.
 
 Let us know how you attack this (if you do).

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-21 Thread Leslie Newell
Hi Jeff,

Sorry, I meant do you know of any components that use shared memory to 
communicate between a user space part and a real time part.

Les

Jeff Epler wrote:
 No, I don't think there are any.  I proposed something similar (but it
 doesn't have the adding/removing offsets problem) to some folks doing a
 scanline laser with emc, but to the best of my knowledge they didn't go
 that direction with their implementation.
 
 Jeff


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-21 Thread Jeff Epler
On Tue, Jul 21, 2009 at 08:42:24AM +0100, Leslie Newell wrote:
 Hi Jeff,
 
 Sorry, I meant do you know of any components that use shared memory to 
 communicate between a user space part and a real time part.

Oh, yes.  There are several:
Userspace   Realtime
halscopescope_rt
halsampler  sampler
halstreamer streamer
and of course emc's task (userspace) and motion (rt) communicate through
such a shared memory area.

halstreamer is probably the most similar to what I'm suggesting, because
a userspace process loads data and a realtime process consumes it.

Jeff

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-21 Thread Leslie Newell
Thanks Jeff, you have been very helpful.

One last question for the moment ;-). What is the best way to compile C 
components? With .comp components you use comp with it's various 
switches. What is the correct command line for a C component?

Les

Jeff Epler wrote:
 On Tue, Jul 21, 2009 at 08:42:24AM +0100, Leslie Newell wrote:
   
 Hi Jeff,

 Sorry, I meant do you know of any components that use shared memory to 
 communicate between a user space part and a real time part.
 

 Oh, yes.  There are several:
 Userspace   Realtime
 halscopescope_rt
 halsampler  sampler
 halstreamer streamer
 and of course emc's task (userspace) and motion (rt) communicate through
 such a shared memory area.

 halstreamer is probably the most similar to what I'm suggesting, because
 a userspace process loads data and a realtime process consumes it.

 Jeff

 --
 Enter the BlackBerry Developer Challenge  
 This is your chance to win up to $100,000 in prizes! For a limited time, 
 vendors submitting new applications to BlackBerry App World(TM) will have
 the opportunity to enter the BlackBerry Developer Challenge. See full prize  
 details at: http://p.sf.net/sfu/Challenge
 ___
 Emc-users mailing list
 Emc-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/emc-users
   


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-21 Thread Jeff Epler
On Tue, Jul 21, 2009 at 01:20:48PM +0100, Leslie Newell wrote:
 Thanks Jeff, you have been very helpful.
 
 One last question for the moment ;-). What is the best way to compile C 
 components? With .comp components you use comp with it's various 
 switches. What is the correct command line for a C component?

it should be
comp --compile foo.c
comp --compile --userspace foo.c
though at the moment some bugs break 'comp --compile --userspace' for C
files.

In another message I posted a link to a Makefile that works for
userspace C components:
http://mid.gmane.org/20090720161919.ga3...@unpythonic.net

Jeff

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


[Emc-users] Synchronised cam turning

2009-07-20 Thread Leslie Newell
Has anyone tried turning a cam on a lathe using EMC? I tried using lots 
of G33 moves but they seem to get out of sync. My machine has pretty 
high acceleration and top speed but even at very low spindle speeds 
(14rpm) it doesn't seem to keep up.

Does EMC have any other way of doing synchronised moves apart from G33/G76?

Les

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Jeff Epler
On Mon, Jul 20, 2009 at 11:23:55AM +0100, Leslie Newell wrote:
 Has anyone tried turning a cam on a lathe using EMC? I tried using lots 
 of G33 moves but they seem to get out of sync. My machine has pretty 
 high acceleration and top speed but even at very low spindle speeds 
 (14rpm) it doesn't seem to keep up.

Without seeing your gcode, I am going to take a guess that the problem
is one of two things: you have lots of tiny moves, or you did not
properly calculate your K values.

emc's spindle synchronized motion is more or less the traditional motion
planner, but using spindle angle instead of time to control the forward
progress.  Specifically, it has the same behavior when there are a lot
of small segments: it will plan each individual move so that it can stop
by the end of that move and stay within machine constraints.

 Does EMC have any other way of doing synchronised moves apart from G33/G76?

emc and gcode don't, but of course hal does.  You could create a
component which offsets the commanded X according to the spindle angle
and the shape of the cam.  The component would include the mathematical
description of the cam shape, r=f(theta)+r0.  It would take as inputs
the spindle angle and the commanded motor position (r0), and output the
modified motor position (r)

net Xpos-cmd = camcutter.pos-cmd-in
net Xpos-cam-cmd camcutter.pos-cmd-out = stepgen.0.motor-pos-cmd # or 
whatever

net Xpos-cam-fb stepgen.motor-pos-fb = camcutter.pos-fb-in
net Xpos-cb = camcutter.pos-fb-out

net spindle-revs = camcutter.spindle-revs

net cam-enable motion.digital-out-nn = camcutter.enable

In emc 2.3 and above double precision numbers are used for hal floats,
so you can probably skip messing with index-enable and just use theta =
2*pi*spindle_revs for a periodic function f().

In your component, you have something like this:
if(enable) {
double theta = spindle_revs * 2 * M_PI;
double displacement = f(theta);
motor_pos_cmd_out = motor_pos_cmd_in + displacement;
motor_pos_fb_out = motor_pos_fb_in - olddisplacement;
olddisplacement = displacement; // (instance variable)
} else {
motor_pos_cmd_out = motor_pos_cmd_in;
motor_pos_fb_out = motor_pos_fb_in;
}
but this gives a step discontinuity when enable changes.  You need to
embellish it with code to slow apply and unapply the displacement.  Such
code is in emc/motion/simple_tp.{c,h} in libraryish form.  (I'd be
tempted to just copy both into a single header, change simple_tp_update
to be static, and include the header)

Jeff

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Leslie Newell
Hi Jeff,

I would have replied earlier but I blew up my X11 settings and it took 
me this long to get it working again...

 is one of two things: you have lots of tiny moves,


Yes. There isn't much choice in this. To even get a simple offset circle 
you need to generate lots of short lines.

 or you did not
 properly calculate your K values.

I don't /think/ I did. For this job, K gets rather confusing. However 
changing the spindle speed affects the results so I would guess that K 
isn't the problem.

 emc's spindle synchronized motion is more or less the traditional motion
 planner, but using spindle angle instead of time to control the forward
 progress.  Specifically, it has the same behavior when there are a lot
 of small segments: it will plan each individual move so that it can stop
 by the end of that move and stay within machine constraints.

Is there any way to trick the motion planner into thinking the machine 
has infinite acceleration during synchronized cutting? As long as you 
are careful with the code, following error shouldn't be too bad.


 emc and gcode don't, but of course hal does.  You could create a
 component which offsets the commanded X according to the spindle angle
 and the shape of the cam.
  The component would include the mathematical
  description of the cam shape, r=f(theta)+r0.


Hmm, interesting idea. Not too bad for a simple circular cam but 
unfortunately I have been supplied with CAD drawings and they are wacky 
profiles. Several different profiles, all one-offs. Is there any way for 
a RT component to read a file when it initializes? I could store the 
profile in a text file which I could generate with SheetCam.

Thanks,
Les

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Dave Caroline
An excuse to put a milling spindle on the crossslide maybe.
will the clearance angle be ok if turning

Dave Caroline

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Gene Heskett
On Monday 20 July 2009, Dave Caroline wrote:
An excuse to put a milling spindle on the crossslide maybe.
will the clearance angle be ok if turning

Dave Caroline

I think that is something I would do with the A axis.  I have turned stuff 
with it, but haven't tried to make a cam yet.  I got stuck needing the laathe 
for something, but had a large piece of alu I didn't want to lose the center 
of, so I did the other small piece on the mill.  Slow, but worked well.

-- 
Cheers, Gene
There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order.
-Ed Howdershelt (Author)
The NRA is offering FREE Associate memberships to anyone who wants them.
https://www.nrahq.org/nrabonus/accept-membership.asp

A gambler's biggest thrill is winning a bet.
His next biggest thrill is losing a bet.


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Jeff Epler
  emc and gcode don't, but of course hal does.  You could create a
  component which offsets the commanded X according to the spindle angle
  and the shape of the cam.
   The component would include the mathematical
   description of the cam shape, r=f(theta)+r0.
 
 
On Mon, Jul 20, 2009 at 05:25:19PM +0100, Leslie Newell wrote:
 Hmm, interesting idea. Not too bad for a simple circular cam but 
 unfortunately I have been supplied with CAD drawings and they are wacky 
 profiles. Several different profiles, all one-offs. Is there any way for 
 a RT component to read a file when it initializes? I could store the 
 profile in a text file which I could generate with SheetCam.

rtai has shared memory between realtime components and userspace.  This
is how the communication between task and motion works, and how it works
between the userspace and realtime parts of scope, sampler, and
streamer.

In this case, you'd have to arrange for userspace to load a 1D array of
f(theta) values before beginning the cam cycle, then the realtime
f(theta) becomes: find nearest table values to theta, and use an
interpolation algorithm on those values (such as linear interpolation on
two values) to give the offset.

Jeff

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Leslie Newell
Heh. An A axis would be too easy :-) TBH I think I may pass on this job. 
Too many unknowns. I will check if the cams can be made in pieces. If so 
then I could simply mill the lobes.

Les

Gene Heskett wrote:
 On Monday 20 July 2009, Dave Caroline wrote:
 An excuse to put a milling spindle on the crossslide maybe.
 will the clearance angle be ok if turning

 Dave Caroline
 
 I think that is something I would do with the A axis.  I have turned stuff 
 with it, but haven't tried to make a cam yet.  I got stuck needing the laathe 
 for something, but had a large piece of alu I didn't want to lose the center 
 of, so I did the other small piece on the mill.  Slow, but worked well.
 

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Leslie Newell
Thanks Jeff

I'll look into it. Do you know off-hand if there are any current 
components that do this?

Les


 
 rtai has shared memory between realtime components and userspace.  This
 is how the communication between task and motion works, and how it works
 between the userspace and realtime parts of scope, sampler, and
 streamer.
 
 In this case, you'd have to arrange for userspace to load a 1D array of
 f(theta) values before beginning the cam cycle, then the realtime
 f(theta) becomes: find nearest table values to theta, and use an
 interpolation algorithm on those values (such as linear interpolation on
 two values) to give the offset.
 
 Jeff
 

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Jack
I went to a ShopBot event last year and saw where folks did 'turning' using
their indexer.

The process they used was to determine the 'final diameter' and layed out a
rectangle
of 'unwraped' surface (length as the length of the turning, width of the
'final diameter').
Then put whatever they wanted on the 'triangle' using various methods.  Once
done,
the pathed it, and used the just routed the piece as a plane, using the
indexer as the
'x' axis, and the 'y' axis as the indexer.

You might be able to take that thought and make your 'unwraped surface' to
be the
profiles of the 'unwrapped' cams.

Let us know how you attack this (if you do).
--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronised cam turning

2009-07-20 Thread Jeff Epler
On Mon, Jul 20, 2009 at 10:25:58PM +0100, Leslie Newell wrote:
 Thanks Jeff
 
 I'll look into it. Do you know off-hand if there are any current 
 components that do this?

No, I don't think there are any.  I proposed something similar (but it
doesn't have the adding/removing offsets problem) to some folks doing a
scanline laser with emc, but to the best of my knowledge they didn't go
that direction with their implementation.

Jeff

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users