Re: [Emc-users] Spindle rps and index

2021-04-07 Thread Nicklas SB Karlsson

Den 2021-04-05 kl. 21:48, skrev Karl Schmidt:

On 3/19/21 4:53 AM, andy pugh wrote:

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg


I've updated the svg - but I think it might be missing the 
spindle-index-enable connection?


Does the go to both the position-pid and the velocity-pid?

A copy of a working orient hal-file would be helpful.  (Feel free to 
send me one off-list)..
In Linuxcnc config folder sim/axis/vismach/VMC_toolchange have a working 
.hal file, there are two different to chose from. Also have one for 
myself, more or less working.


M19 is used to orient spindle.


Nicklas Karlsson



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


Re: [Emc-users] Spindle rps and index

2021-04-05 Thread andy pugh
On Tue, 6 Apr 2021 at 02:13, Karl Schmidt  wrote:
>
> Motion's spindle.0.speed-out is always in RPM. Encoder outputs both 
> 'velocity' and velocity-rpm (not sure why as scale
> should get us to either unit?)

spindle.N.speed-out-rps, speed-out-rps-abs and speed-out-abs (rpm)
also exist. This is just a convenience as there is practically no
overhead in calculating them inside the originating components.

Yes, you can use "scale" but that slightly complicates the HAL.
-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


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


Re: [Emc-users] Spindle rps and index

2021-04-05 Thread Karl Schmidt
Motion's spindle.0.speed-out is always in RPM. Encoder outputs both 'velocity' and velocity-rpm (not sure why as scale 
should get us to either unit?)  so I can plug RPM into the PID (I think both the PID.command and PID.feedback should be 
in the same units), but then pid.output passes through ABS - then to the frequency-input of the VFD .


The PID output should self correct (via P) for what ever unit is used to jump it up to inverter frequency - but that 
might be sub optimal?  Not sure this matters? Do I need to scale RPM to frequency?


I can fix the vfd component so it has a frequency scale input - is it worth it 
to fix this?




--

Karl Schmidt  EMail k...@lrak.net
3209 West 9th Street Ph (785) 979-8397
Lawrence, KS 66049



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


Re: [Emc-users] Spindle rps and index

2021-04-05 Thread andy pugh
On Mon, 5 Apr 2021 at 20:50, Karl Schmidt  wrote:

> I've updated the svg - but I think it might be missing the 
> spindle-index-enable connection?

That isn't really related to orient. I don;t know if it belongs in the
diagram, or whether it would cause confusion.

> Does the go to both the position-pid and the velocity-pid?

It would, but it is only used to mask a momentary glitch when the
encore resets.

> A copy of a working orient hal-file would be helpful.  (Feel free to send me 
> one off-list)..

Oddly, I have never actually had to configure spindle orient on one of
my own machines.

> I'm also puzzled about the details of encoder.N.counter-mode - I think it 
> does more than switch to step and direction?

Counter mode makes the encoder just a single-channel pulse counter. It
increments by one on every rising edge of channel A and ignores
channel B.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


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


Re: [Emc-users] Spindle rps and index

2021-04-05 Thread Karl Schmidt

On 3/19/21 4:53 AM, andy pugh wrote:

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg


I've updated the svg - but I think it might be missing the spindle-index-enable 
connection?

Does the go to both the position-pid and the velocity-pid?

A copy of a working orient hal-file would be helpful.  (Feel free to send me 
one off-list)..

--
I'm also puzzled about the details of encoder.N.counter-mode - I think it does 
more than switch to step and direction?






--

Karl Schmidt  EMail k...@lrak.net
3209 West 9th Street Ph (785) 979-8397
Lawrence, KS 66049



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


Re: [Emc-users] Spindle rps and index

2021-03-31 Thread andy pugh
On Thu, 1 Apr 2021 at 00:54, Karl Schmidt  wrote:

The names of these pins seem to have changed..


Good point. It's an SVG, so the changes can be made with a text editor and
find/replace. motion.spindle- to spindle.0.
(in most cases).

It is probably possible to pass the .svg through the regex search/replace
here:
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/ini/update_ini.py#L515

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is designed
for the especial use of mechanical geniuses, daredevils and lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912

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


Re: [Emc-users] Spindle rps and index

2021-03-31 Thread Karl Schmidt

On 3/19/21 4:53 AM, andy pugh wrote:

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg


The names of these pins seem to have changed..

For instance - there is no motion.spindle-on - must be spindle.0.on

I'm going to edit this up if anyone is interested.

Could be that the dual PID's/orient/mux/abs should eventually be built in to an 
orienting PID?


--

Karl Schmidt  EMail k...@lrak.net
3209 West 9th Street Ph (785) 979-8397
Lawrence, KS 66049



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


Re: [Emc-users] Spindle rps and index

2021-03-21 Thread Karl Schmidt

On 3/19/21 4:53 AM, andy pugh wrote:

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg


I happen to be doing about the same thing - The svg is quite helpful but I 
ended up with 3 questions..

In my case output of will go to a VFD - that currently has only an input for Hz.

I have been thinking of adding a scaling input to the VFD component - which would apply a scaling factor to the input ( 
and an output pin so one can see the resulting Hz) .  This is because the ini file has


MAX_OUTPUT
OUTPUT_SCALE
That are involved in this - defined as RPM - so I'm thinking there needs to be a scaling so the input to the VFD is 
actually in RPM? ( Are these actually inputs to the motion component?


I'm not clear as to what sets the speed that orient happens at?


Also - If someone has the ini and hal files for the orient schematic above - I 
would love to see them.

(Looks like the Hal code for orient is going to be a bit of a mess to write 
clearly )

--

Karl Schmidt  EMail k...@lrak.net
3209 West 9th Street Ph (785) 979-8397
Lawrence, KS 66049



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


Re: [Emc-users] Spindle rps and index

2021-03-19 Thread Peter C. Wallace

On Fri, 19 Mar 2021, Nicklas SB Karlsson wrote:


Date: Fri, 19 Mar 2021 19:07:50 +0100
From: Nicklas SB Karlsson 
Reply-To: "Enhanced Machine Controller (EMC)"

To: emc-users@lists.sourceforge.net
Subject: Re: [Emc-users] Spindle rps and index

Den 2021-03-19 kl. 10:53, skrev andy pugh:

On Fri, 19 Mar 2021 at 01:46, John Dammeyer  wrote:

I take it then that you can't actually move the spindle to the index 

position unless you have some sort of control beyond velocity?

Velocity control + PID = position control.

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg
Yes schematic it is, once concluded .hal file is more or less a netlist 
and have been able to use gschem to draw schematics and generate .hal file.



Think it is similar or same as VMC_toolchange among the simulation 
machines in Linuxcnc. orient.N.position is a float  and it will work if 
it overflow each turn?


Otherwise then spindle rotate, position get larger, decimal point is 
moved and after slightly more than 77 hours at 3 600 rpm resolution is 
so bad it can't count a full turn. To get a resolution of 256 degrees 
per turn 8 bits are necessary and this point is passed already after 
slightly more than 18 minutes. Reason is for a float 24 bits are used 
for digits, the other eight bits are used for sign and placement of 
decimal point, there are also a few special cases like NaN/-Inf/Inf. 
Often used float for analog values, there it have been great since 
resolution have been known while scaling vary.



Nicklas Karlsson


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



If spindle position is the same as other LinuxCNC axis, its a double precision
float so will take a _lot_ longer to lose precision.

That said, typical spindle orient routines use the index so the count gets reset
when orienting.


Peter Wallace
Mesa Electronics



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


Re: [Emc-users] Spindle rps and index

2021-03-19 Thread Nicklas SB Karlsson

Den 2021-03-19 kl. 10:53, skrev andy pugh:

On Fri, 19 Mar 2021 at 01:46, John Dammeyer  wrote:


I take it then that you can't actually move the spindle to the index position 
unless you have some sort of control beyond velocity?

Velocity control + PID = position control.

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg
Yes schematic it is, once concluded .hal file is more or less a netlist 
and have been able to use gschem to draw schematics and generate .hal file.



Think it is similar or same as VMC_toolchange among the simulation 
machines in Linuxcnc. orient.N.position is a float  and it will work if 
it overflow each turn?


Otherwise then spindle rotate, position get larger, decimal point is 
moved and after slightly more than 77 hours at 3 600 rpm resolution is 
so bad it can't count a full turn. To get a resolution of 256 degrees 
per turn 8 bits are necessary and this point is passed already after 
slightly more than 18 minutes. Reason is for a float 24 bits are used 
for digits, the other eight bits are used for sign and placement of 
decimal point, there are also a few special cases like NaN/-Inf/Inf. 
Often used float for analog values, there it have been great since 
resolution have been known while scaling vary.



Nicklas Karlsson


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


Re: [Emc-users] Spindle rps and index

2021-03-19 Thread John Dammeyer
> From: Roland Jollivet [mailto:roland.jolli...@gmail.com]
> On Fri, 19 Mar 2021 at 11:58, andy pugh  wrote:
> 
> > On Fri, 19 Mar 2021 at 01:46, John Dammeyer 
> > wrote:
> >
> > > I take it then that you can't actually move the spindle to the index
> > position unless you have some sort of control beyond velocity?
> > 
> 
> 
> My machine has a BT30 and an ATC.
> The Fanuc AC spindle motor has no encoder, but there is an inductive sensor
> on the spindle aligned for the ATC.
> When you perform an M19 it spins a few times then stops on the sensor. (lit)
> 
> I suspect it turns a few times and takes a 'snapshot' of the drive
> waveform. It then simply applies that waveform to hold the spindle in the
> correct position
> On a M19, it holds the spindle quite firm if I try to rotate it by hand,
> but have not tried to move it past the encoder. I suspect it will give an
> error..
> 
> Roland
Hi Roland,
Thanks for that feedback.  Interesting.

My AC Servo is currently running PWM with a small PWM to 10V module from China. 
 I'm limited to about 100RPM which is till 290RPM lower than it was with single 
phase and 2HP running belt reduction.  Once I rewire to the second parallel 
port I'll have step/dir and I'll add an encoder with index.

At the moment I'm still trying to keep the system portable between MACH3 and 
LinuxCNC and although MACH is clever enough to be able to check a box and 
change the STEP output to PWM using the same Direction pin unfortunately to do 
this with the MESA board would require new software and reprogramming the MESA 
each time the system booted to the other OS. That's why at the moment I'm 
running PWM.

But then I don’t think MACH3 can do absolute positioning of the spindle so for 
the moment step/dir is on hold.  Plus I'm using TT type tool holders so rotary 
position isn't super important.

I'm swinging more and more to probably never again booting the system with 
WIN-XP and MACH3 although I must admit the built in wizards for MACH3 are sure 
handy.

John



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


Re: [Emc-users] Spindle rps and index

2021-03-19 Thread John Dammeyer
> From: andy pugh [mailto:bodge...@gmail.com]
> On Fri, 19 Mar 2021 at 01:46, John Dammeyer  wrote:
> 
> > I take it then that you can't actually move the spindle to the index 
> > position unless you have some sort of control beyond velocity?
> 
> Velocity control + PID = position control.
> 
> Here is a schematic of a typical LinuxCNC spindle orient setup:
> https://wiki.linuxcnc.org/uploads/orient.svg
> 
> --
Thanks Andy.
Zoomed drawing.  Screen captured. Pasted and cropped in image program. Printed 
so it's readable rather than teensy weensy.
John




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


[Emc-users] Spindle rps and index

2021-03-19 Thread Roland Jollivet
On Fri, 19 Mar 2021 at 11:58, andy pugh  wrote:

> On Fri, 19 Mar 2021 at 01:46, John Dammeyer 
> wrote:
>
> > I take it then that you can't actually move the spindle to the index
> position unless you have some sort of control beyond velocity?
> 


My machine has a BT30 and an ATC.
The Fanuc AC spindle motor has no encoder, but there is an inductive sensor
on the spindle aligned for the ATC.
When you perform an M19 it spins a few times then stops on the sensor. (lit)

I suspect it turns a few times and takes a 'snapshot' of the drive
waveform. It then simply applies that waveform to hold the spindle in the
correct position
On a M19, it holds the spindle quite firm if I try to rotate it by hand,
but have not tried to move it past the encoder. I suspect it will give an
error..

Roland







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


Re: [Emc-users] Spindle rps and index

2021-03-19 Thread andy pugh
On Fri, 19 Mar 2021 at 01:46, John Dammeyer  wrote:

> I take it then that you can't actually move the spindle to the index position 
> unless you have some sort of control beyond velocity?

Velocity control + PID = position control.

Here is a schematic of a typical LinuxCNC spindle orient setup:
https://wiki.linuxcnc.org/uploads/orient.svg

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


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


Re: [Emc-users] Spindle rps and index

2021-03-18 Thread dave engvall
My Mazak V5 had a coarse helix cam which oriented the spindle. The one 
at Galesburg used something closer to  an  inductive sensor to sense 
index.. I think that got swapped out for an encoder. Once it picked up 
the index it then rotated n counts to index the spindle for tool 
change.  If memory serves the spindle did  a dampened oscillation to get 
to position.


Dave

On 3/18/21 8:10 PM, John Dammeyer wrote:



-Original Message-
From: Jon Elson [mailto:el...@pico-systems.com]

Interesting topic.

I take it then that you can't actually move the spindle to the index position 
unless you have some sort of control beyond velocity?

I'm currently using PWM on mine but once I redo some wiring I can run it with 
step/dir.  So theoretically it should be possible to

move to a 'home' or '0.000' position.  But how is that even done if the spindle 
is controlled with M3,M4 and Sxxx?



You have to put some kind of custom component in between.
The problem is you now want to
have a thing which switches back and forth between a spindle
(M3, 4 and 5 and Sxxx) and an axis C.  You have to give some
kind of command with a custom M code that disconnects it as
an axis and connects it as a spindle, and then reverses the
process, all without causing a following error.
It could be a bit tricky.  This has come up a number of
times in the past.

Jon

Not having one of those keyed tool changers or for that matter a HAAS to play 
with I'm partly in the dark here.  If your mill has one of those BT-30 to BT-50 
type holders with the two slots on the side do they not need to lock into the 
spindle?

Done by hand I guess a human just rotates it until it slips the rest of the way 
in.

Is the machine told turn 1 RPM while the tool changer presses the tool up so it 
latches into the slot?  Or do the fancy machines have an index to which they 
locate so the tool automatically latches in with the correct orientation?

Thanks
John




___
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] Spindle rps and index

2021-03-18 Thread John Dammeyer



> -Original Message-
> From: Jon Elson [mailto:el...@pico-systems.com]
> > Interesting topic.
> >
> > I take it then that you can't actually move the spindle to the index 
> > position unless you have some sort of control beyond velocity?
> >
> > I'm currently using PWM on mine but once I redo some wiring I can run it 
> > with step/dir.  So theoretically it should be possible to
> move to a 'home' or '0.000' position.  But how is that even done if the 
> spindle is controlled with M3,M4 and Sxxx?
> >
> >
> You have to put some kind of custom component in between.
> The problem is you now want to
> have a thing which switches back and forth between a spindle
> (M3, 4 and 5 and Sxxx) and an axis C.  You have to give some
> kind of command with a custom M code that disconnects it as
> an axis and connects it as a spindle, and then reverses the
> process, all without causing a following error.
> It could be a bit tricky.  This has come up a number of
> times in the past.
> 
> Jon

Not having one of those keyed tool changers or for that matter a HAAS to play 
with I'm partly in the dark here.  If your mill has one of those BT-30 to BT-50 
type holders with the two slots on the side do they not need to lock into the 
spindle?  

Done by hand I guess a human just rotates it until it slips the rest of the way 
in.

Is the machine told turn 1 RPM while the tool changer presses the tool up so it 
latches into the slot?  Or do the fancy machines have an index to which they 
locate so the tool automatically latches in with the correct orientation?

Thanks
John




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


Re: [Emc-users] Spindle rps and index

2021-03-18 Thread Jon Elson

On 03/18/2021 08:43 PM, John Dammeyer wrote:



-Original Message-
From: Jon Elson [mailto:el...@pico-systems.com]
Sent: March-18-21 6:22 PM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Spindle rps and index

On 03/18/2021 05:18 PM, Nicklas SB Karlsson wrote:

Need to orient spindle. Using a quadrature encoder spindle
need to be "homed" by rotating up to one revolution to
find index pulse but there is no homing for spindle. Know
what index pulse is in encoder but what does the index
enable signal for spindle do? or how is it used?



On most encoder counters, if one component sets
encoder.xx.index-en (or whatever it is called in that
rendition) to true, and then the encoder is turned until it
generates the index pulse, the position count will jump to
zero at that instant.  Also, at that instant, the index
enable pin will be set back to false.

Jon

Interesting topic.

I take it then that you can't actually move the spindle to the index position 
unless you have some sort of control beyond velocity?

I'm currently using PWM on mine but once I redo some wiring I can run it with 
step/dir.  So theoretically it should be possible to move to a 'home' or 
'0.000' position.  But how is that even done if the spindle is controlled with 
M3,M4 and Sxxx?


You have to put some kind of custom component in between.  
The problem is you now want to
have a thing which switches back and forth between a spindle 
(M3, 4 and 5 and Sxxx) and an axis C.  You have to give some 
kind of command with a custom M code that disconnects it as 
an axis and connects it as a spindle, and then reverses the 
process, all without causing a following error.
It could be a bit tricky.  This has come up a number of 
times in the past.


Jon


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


Re: [Emc-users] Spindle rps and index

2021-03-18 Thread John Dammeyer



> -Original Message-
> From: Jon Elson [mailto:el...@pico-systems.com]
> Sent: March-18-21 6:22 PM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Spindle rps and index
> 
> On 03/18/2021 05:18 PM, Nicklas SB Karlsson wrote:
> > Need to orient spindle. Using a quadrature encoder spindle
> > need to be "homed" by rotating up to one revolution to
> > find index pulse but there is no homing for spindle. Know
> > what index pulse is in encoder but what does the index
> > enable signal for spindle do? or how is it used?
> >
> >
> On most encoder counters, if one component sets
> encoder.xx.index-en (or whatever it is called in that
> rendition) to true, and then the encoder is turned until it
> generates the index pulse, the position count will jump to
> zero at that instant.  Also, at that instant, the index
> enable pin will be set back to false.
> 
> Jon

Interesting topic. 

I take it then that you can't actually move the spindle to the index position 
unless you have some sort of control beyond velocity?  

I'm currently using PWM on mine but once I redo some wiring I can run it with 
step/dir.  So theoretically it should be possible to move to a 'home' or 
'0.000' position.  But how is that even done if the spindle is controlled with 
M3,M4 and Sxxx?

John Dammeyer

> 
> ___
> 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] Spindle rps and index

2021-03-18 Thread Jon Elson

On 03/18/2021 05:18 PM, Nicklas SB Karlsson wrote:
Need to orient spindle. Using a quadrature encoder spindle 
need to be "homed" by rotating up to one revolution to 
find index pulse but there is no homing for spindle. Know 
what index pulse is in encoder but what does the index 
enable signal for spindle do? or how is it used?



On most encoder counters, if one component sets 
encoder.xx.index-en (or whatever it is called in that 
rendition) to true, and then the encoder is turned until it 
generates the index pulse, the position count will jump to 
zero at that instant.  Also, at that instant, the index 
enable pin will be set back to false.


Jon


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


[Emc-users] Spindle rps and index

2021-03-18 Thread Nicklas SB Karlsson
Need to orient spindle. Using a quadrature encoder spindle need to be 
"homed" by rotating up to one revolution to find index pulse but there 
is no homing for spindle. Know what index pulse is in encoder but what 
does the index enable signal for spindle do? or how is it used?


There is a float input spindle.n.ref for spindle position or revs but as 
spindle rotate number of decimal points decrease then decimal point over 
time is moved. Uncertain how the pos signal is used internally.


There is orient.n.position input from encoder and orient.n.position 
output in orient module, simple to convert integer value to float in 
whatever unit is required which I am also not totally sure about but 
then spindle rotate decimal points will decrease, or what happen? It 
count only one turn?



Regards Nicklas Karlsson



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