Re: [Emc-users] Parport Bulk Write

2010-11-07 Thread Erik Christiansen
On Sat, Nov 06, 2010 at 03:36:42PM -0700, Kirk Wallace wrote:
 On Sat, 2010-11-06 at 11:49 -0700, Kirk Wallace wrote:
  I am starting to think about how to put an eight bit word on a parallel
  port. My first guess is to load Parport, then write a component that
  shifts an unsigned variable a bit at a time to each parport pin, but I
  wonder if there is a cleaner way to write the whole (8bit) word to, lets
  say, pins 2-9? This will be used with a strobe component to latch data
  to an AVR port.
 
 It turns out this is pretty trivial:
 http://www.wallacecompany.com/machine_shop/EMC2/AVR/conv_u32_8bits.comp 

Kirk, to grab the lowest byte of a uint32_t, I'd be tempted to just do a
typecast in an assignment:

In file: test1.c 

#include stdint.h

int main ()
{  
   
uint32_t given  ;
uint8_t  needed ;
   
   needed = (uint8_t) given ; 
   
}



$ gcc test1.c -Wa,-ahdl=test1.lst

That compiles without errors, and gives some intel assembler in
test1.lst, with (satisfyingly) a movb in the middle of it. The rest is
stage setting, AFAICT. (8 bit intel is OK by me, but I haven't grubbed
in x86, so I have to squint and guess that much of it is preamble and
postample, pushing and popping a stack frame.)

Now there's just the write of the uint8_t to the parport address, and
pulse the strobe line, as you've mentioned. (i.e. the tricky part,
unless an oscilloscope is to hand to check the (presumably) software
timing of the strobe duration.)

Erik

-- 
I've had a perfectly wonderful evening.
But this wasn't it.
 - Groucho Marx

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronized Component

2010-11-07 Thread dambacher-retrofit.de
Am 06.11.2010 19:33, schrieb Kirk Wallace:
 
 Thanks Ulf. This is what I have so far:
 http://www.wallacecompany.com/machine_shop/EMC2/AVR/strobe-1a.jpg 
 http://www.wallacecompany.com/machine_shop/EMC2/AVR/ServoPStart.comp 

Hi Kirk

Try this, the other one is worse. This looks cleaner, compiles and is tested.

halcmd loadrt ServoPStart
halcmd addf ServoPStart.0.doreset servo-thread
halcmd addf ServoPStart.0.docount base-thread


component ServoPStart  This component is part of a parport interface to an
AVR ATtiny2313.(2010/11/05 kwall...@wallacecompany.com);

pin out bit ServoStart This is the output which goes high for one period at
the input toggle.;
pin out bit strobe foobar;
pin out unsigned PCount=0  ;

//variable unsigned PCount=0;   // Holds the number of periods since the 
toggle.

function dostrobe nofp;
function doreset nofp;
license GPL;

;;

FUNCTION(doreset) {
PCount=0;
}

FUNCTION(dostrobe) {
  strobe=0;
  ServoStart=0;
  if (PCount==0) ServoStart=1;
  if (PCount==3) strobe=1;
  PCount++;
}


--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronized Component

2010-11-07 Thread Jeff Epler
On Sat, Nov 06, 2010 at 09:31:31AM -0700, Kirk Wallace wrote:
 I looked at the source for the edge component. It has a variable called
 period that isn't declared in the top portion of the component. Does
 that mean that it is a global variable? If so, is there a convenient
 source for a list of global variables?

http://www.linuxcnc.org/docview/html/hal_comp.html#r1_7

FUNCTION(name)
Use this macro to begin the definition of a realtime function which
was previously declared with function NAME. The function includes a
parameter period which is the integer number of nanoseconds between
^^
calls to the function.

Jeff

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Need a little advice on retroing a CHNC Hardinge

2010-11-07 Thread Ed
Well, I could use some help fellows! My slow motion Hardinge CHNC 
project just got speeded up with the demise of the spidle motor on my 
Pratt and Whitney lathe. What I have got is a stripped machine, the 
resolvers have been replaced with encoders on the X and Z axiis and new 
cables pulled through to the connection area on the back of the X 
axis.Both cables are shielded and drained 6 twisted pair for a total of 
12 leads per cable. Questions:Can I run the axis encoder in the same 
cable as the turret encoder? The turret runs at 12Volts logic, will this 
cause any crosstalk? How did Hardinge do threading with a resolver on 
the spindle? I cannot find an index mechanism or any extra leads that 
would go to one. The spindle resolver is still in place but can be 
replaced easily with an encoder with index. The plan is to fit this all 
up with Pico Systems PWM controller which I have at hand and if needs be 
I have an extra Par port card for extra I/O.  Ed.

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need a little advice on retroing a CHNC Hardinge

2010-11-07 Thread Kirk Wallace
On Sun, 2010-11-07 at 09:11 -0500, Ed wrote:
... snip
 Both cables are shielded and drained 6 twisted pair for a total of 
 12 leads per cable. Questions:Can I run the axis encoder in the same 
 cable as the turret encoder? The turret runs at 12Volts logic, will this 
 cause any crosstalk?

I reused my Hardinge cables on my HNC, which I think are straight,
unpaired with an overall shield. I have the axis and turret encoder
signals running through the same cable, with the turret encoder running
on 12 Volts. It seems to work fine. You might consider looking into
methods of terminating the wire pairs. Such as impedance matching
resistors, although this may be more appropriate for differential
signaling.

http://www.epanorama.net/documents/wiring/cable_impedance.html 
http://en.wikipedia.org/wiki/Twisted_pair 
http://www.maxim-ic.com/app-notes/index.mvp/id/763/CMP/WP-1 

 How did Hardinge do threading with a resolver on 
 the spindle? I cannot find an index mechanism or any extra leads that 
 would go to one. The spindle resolver is still in place but can be 
 replaced easily with an encoder with index.

I believe the resolver is an absolute encoder so the index feature is
inherent.

http://en.wikipedia.org/wiki/Resolver_%28electrical%29 

I replaced my spindle resolver and tachometer with a quadrature encoder.

http://www.wallacecompany.com/cnc_lathe/HNC/00011-1a.jpg 

I had problems with interference on the index signal, which I cleared up
with a mains filter on the spindle VFD. You can see more here:

http://www.wallacecompany.com/cnc_lathe/HNC/ 

  The plan is to fit this all 
 up with Pico Systems PWM controller which I have at hand and if needs be 
 I have an extra Par port card for extra I/O.  Ed.

That's the setup I have.

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


--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Synchronized Component

2010-11-07 Thread Kirk Wallace
On Sun, 2010-11-07 at 07:35 -0600, Jeff Epler wrote:

 FUNCTION(name)
 Use this macro to begin the definition of a realtime function which
 was previously declared with function NAME. The function includes a
 parameter period which is the integer number of nanoseconds between
 ^^
 calls to the function.

Thanks Jeff. This has gotten me to go back and reread the .comp
documentation. Now I have more issues to work out than before. I do have
a pair of clumsy .comp's that get the job done for now, but I will need
to formalize them later.
-- 
Kirk Wallace
http://www.wallacecompany.com/machine_shop/
http://www.wallacecompany.com/E45/index.html
California, USA


--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Problem:System suddenly constantly resetting.

2010-11-07 Thread Kent A. Reed
On 11/5/2010 5:03 PM, Ulf Dambacher wrote:
 Hi everybody

 I just re-assembled my maho 800 with a new hmi and now I have a strange
 problem:

 I can activate emc, but while I activate the machine, activate the
 motion controllers  and do some hand jogging, the process gets stuck,
 monitor gets dark and it looks like the computer is stuck, graphics card
 and keyboard are constantly re-initializing.

Hi, Ulf.

Perhaps you've already tracked down the cause of your problem, but 
another possibility came to me today.

I plugged a vacuum cleaner into a convenient outlet in the basement. 
When I turned it on, the overhead light dimmed slightly. It seems they 
were on the same mains circuit. Including whatever else is on that 
circuit, enough current was being drawn when I added the vacuum cleaner 
to cause a perceptible power sag.

Is there any possibility your computer is experiencing a power sag when 
you activate your machine?

Regards,
Kent


--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need a little advice on retroing a CHNC Hardinge

2010-11-07 Thread Jon Elson
On 11/07/2010 8:11 AM, Ed wrote:
 Well, I could use some help fellows! My slow motion Hardinge CHNC
 project just got speeded up with the demise of the spidle motor on my
 Pratt and Whitney lathe. What I have got is a stripped machine, the
 resolvers have been replaced with encoders on the X and Z axiis and new
 cables pulled through to the connection area on the back of the X
 axis.Both cables are shielded and drained 6 twisted pair for a total of
 12 leads per cable. Questions:Can I run the axis encoder in the same
 cable as the turret encoder? The turret runs at 12Volts logic, will this
 cause any crosstalk?
If your encoders are differential, this should be no problem.  If not 
differential, try it and see.  It most
likely will work fine.
   How did Hardinge do threading with a resolver on
 the spindle?
Most reslover converters also produce the index signal.  If your 
encoders are A-B only, you need to put an ABZ encoder on the spindle, so 
you get the index, too.
   I cannot find an index mechanism or any extra leads that
 would go to one. The spindle resolver is still in place but can be
 replaced easily with an encoder with index. The plan is to fit this all
 up with Pico Systems PWM controller which I have at hand and if needs be
 I have an extra Par port card for extra I/O.  Ed.

Oh, well, the Pico Systems resolver converter would provide index from 
the resolver, so you could use
that, or get an encoder with index.

Jon

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need a little advice on retroing a CHNC Hardinge

2010-11-07 Thread Chris Radek
On Tue, Oct 23, 2001 at 11:10:14PM -0500, Jon Elson wrote:

  I cannot find an index mechanism or any extra leads that
  would go to one. The spindle resolver is still in place but can be
  replaced easily with an encoder with index. The plan is to fit this all
  up with Pico Systems PWM controller which I have at hand and if needs be
  I have an extra Par port card for extra I/O.  Ed.

 Oh, well, the Pico Systems resolver converter would provide index from 
 the resolver, so you could use
 that, or get an encoder with index.

Jon, I have those same resolvers and I use your resolver converter
board.  I am pretty sure there are two indexes per revolution.  The
gearing is 1:1 so I don't think the original spindle resolver can be
used this way.

Chris

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book Blueprint to a 
Billion shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users