Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-15 Thread Matthew Herd
Also, after analyzing the code a bit further, it seems gearchange also has an 
error.  The scale value (for gear 2, the "high" gear) is used to divide the 
speed in.  This means that gear 2 is a lower gear, not a higher gear as the 
documentation indicates.  I.e. gear 2 would be divided by the back gear ratio 
of 8.3 in my example to yield speed-in/8.3 = speed-out.  That may explain the 
issues you’ve had with your rewrite.  In other words, it does indeed work for a 
Bridgeport type machine or any other machine utilizing backgears as "gear 2" 
but the documentation indicates the reverse of the actual arrangement.  I hope 
that makes sense.

> On Dec 15, 2020, at 9:16 AM, Matthew Herd  wrote:
> 
> Ahh, very interesting.  For the time being I’ll work on my own component and 
> see what I find.  Thanks Andy!
> 
>> On Dec 15, 2020, at 9:12 AM, andy pugh  wrote:
>> 
>> On Tue, 15 Dec 2020 at 13:57, Matthew Herd  wrote:
>>> 
>>> https://github.com/LinuxCNC/linuxcnc/commit/0b113e98a1621d3e8aa6467eb535b514f0da3d5b#diff-667b45662b7da3b4712ad1ead290305621b11f4d0e9569f095879d1c9eff5525
>>>  
>>> 
>> 
>> It was a long time ago, so I am fuzzy on the details (it dates back to
>> before I had push rights to LinuxCNC, so the commits were made by
>> others)
>> 
>> Looking at the history it seems that my changes altered the way that
>> the ratios were calculated, and that broke the backwards compatibility
>> that I was aiming for.
>> https://github.com/LinuxCNC/linuxcnc/commits/master/src/hal/components/gearchange.comp
>> 
>> -- 
>> 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
> 



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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-15 Thread Matthew Herd
Ahh, very interesting.  For the time being I’ll work on my own component and 
see what I find.  Thanks Andy!

> On Dec 15, 2020, at 9:12 AM, andy pugh  wrote:
> 
> On Tue, 15 Dec 2020 at 13:57, Matthew Herd  wrote:
>> 
>> https://github.com/LinuxCNC/linuxcnc/commit/0b113e98a1621d3e8aa6467eb535b514f0da3d5b#diff-667b45662b7da3b4712ad1ead290305621b11f4d0e9569f095879d1c9eff5525
>>  
>> 
> 
> It was a long time ago, so I am fuzzy on the details (it dates back to
> before I had push rights to LinuxCNC, so the commits were made by
> others)
> 
> Looking at the history it seems that my changes altered the way that
> the ratios were calculated, and that broke the backwards compatibility
> that I was aiming for.
> https://github.com/LinuxCNC/linuxcnc/commits/master/src/hal/components/gearchange.comp
> 
> -- 
> 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



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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 13:57, Matthew Herd  wrote:
>
> https://github.com/LinuxCNC/linuxcnc/commit/0b113e98a1621d3e8aa6467eb535b514f0da3d5b#diff-667b45662b7da3b4712ad1ead290305621b11f4d0e9569f095879d1c9eff5525
>  
> 

It was a long time ago, so I am fuzzy on the details (it dates back to
before I had push rights to LinuxCNC, so the commits were made by
others)

Looking at the history it seems that my changes altered the way that
the ratios were calculated, and that broke the backwards compatibility
that I was aiming for.
https://github.com/LinuxCNC/linuxcnc/commits/master/src/hal/components/gearchange.comp

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-15 Thread Matthew Herd
https://github.com/LinuxCNC/linuxcnc/commit/0b113e98a1621d3e8aa6467eb535b514f0da3d5b#diff-667b45662b7da3b4712ad1ead290305621b11f4d0e9569f095879d1c9eff5525
 


I was browsing Git.

> On Dec 15, 2020, at 8:50 AM, andy pugh  wrote:
> 
> On Tue, 15 Dec 2020 at 13:47, Matthew Herd  wrote:
>> 
>> I see gearchange was rewritten but then the rewrite wasn’t put into the 
>> final release.
> 
> Where are you looking?
> 
> -- 
> 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


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 13:47, Matthew Herd  wrote:
>
> I see gearchange was rewritten but then the rewrite wasn’t put into the final 
> release.

Where are you looking?

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-15 Thread Matthew Herd
Thanks again Andy, you answered my next questions.  One final question.  I see 
gearchange was rewritten but then the rewrite wasn’t put into the final 
release.  I was studying the code revisions, which appear to solve some of my 
issues.  Is this something that needs bug fixes and testing that just hasn’t 
happened yet?

Matt

> On Dec 15, 2020, at 8:18 AM, andy pugh  wrote:
> 
> On Tue, 15 Dec 2020 at 11:47, Matthew Herd  wrote:
> 
>> I might take a look at modifying the component.  I’m comfortable with C, so 
>> perhaps I can work it out pretty quickly.
> 
> .comp is C with some headers to create HAL pins.
> 
> You should be able to just edit the gearchange.comp file (probably
> best to rename the file and set the "component" line in the header to
> match the new name) and then:
> 
> sudo halcompile --install path/to/flle.comp
> 
> Will compile and install it on your system.
> 
> Reference docs:
> http://linuxcnc.org/docs/2.8/html/hal/comp.html
> 
> Custom .comps really unlock the power of 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



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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 11:47, Matthew Herd  wrote:

> I might take a look at modifying the component.  I’m comfortable with C, so 
> perhaps I can work it out pretty quickly.

.comp is C with some headers to create HAL pins.

You should be able to just edit the gearchange.comp file (probably
best to rename the file and set the "component" line in the header to
match the new name) and then:

sudo halcompile --install path/to/flle.comp

Will compile and install it on your system.

Reference docs:
http://linuxcnc.org/docs/2.8/html/hal/comp.html

Custom .comps really unlock the power of 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] Question Regarding Selective Assignments in HAL

2020-12-15 Thread Matthew Herd
Hi Andy,

I might take a look at modifying the component.  I’m comfortable with C, so 
perhaps I can work it out pretty quickly.  I do like the spindle component’s 
concept, but it seems there are some issues.  Nonetheless, fixing those issues 
might be a bigger project than I can handle when the primary goal is getting 
the machine running again.

Matt

> On Dec 15, 2020, at 6:23 AM, andy pugh  wrote:
> 
> On Tue, 15 Dec 2020 at 01:42, Matthew Herd  wrote:
>> 
>> I’ve spent some time playing with the spindle component.  It seems to have a 
>> number of bugs, beyond the issue with the documentation.  Somehow a negative 
>> speed command multiplied by a negative gear ratio yields a negative speed.  
>> And the forward and reverse pins track the commanded speed, not the gear 
>> ratio, despite what the documentation indicates.  It has promise, but seems 
>> to have quite a few things that need to be worked out.
> 
> I think that "gearchange" was written for a Bridgeport, is that any
> better for you?
> 
> http://linuxcnc.org/docs/2.8/html/man/man9/gearchange.9.html
> 
> It might not handle the fwd-rev commands quite as you want, but it's a
> fairly simple HAL component and they are easy to modify. (Especially
> if you know C already, or are prepared to learn it)
> 
> https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/gearchange.comp
> 
> -- 
> 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



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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 01:42, Matthew Herd  wrote:
>
> I’ve spent some time playing with the spindle component.  It seems to have a 
> number of bugs, beyond the issue with the documentation.  Somehow a negative 
> speed command multiplied by a negative gear ratio yields a negative speed.  
> And the forward and reverse pins track the commanded speed, not the gear 
> ratio, despite what the documentation indicates.  It has promise, but seems 
> to have quite a few things that need to be worked out.

I think that "gearchange" was written for a Bridgeport, is that any
better for you?

http://linuxcnc.org/docs/2.8/html/man/man9/gearchange.9.html

It might not handle the fwd-rev commands quite as you want, but it's a
fairly simple HAL component and they are easy to modify. (Especially
if you know C already, or are prepared to learn it)

https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/gearchange.comp

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-14 Thread Matthew Herd
I’ve spent some time playing with the spindle component.  It seems to have a 
number of bugs, beyond the issue with the documentation.  Somehow a negative 
speed command multiplied by a negative gear ratio yields a negative speed.  And 
the forward and reverse pins track the commanded speed, not the gear ratio, 
despite what the documentation indicates.  It has promise, but seems to have 
quite a few things that need to be worked out.  At the moment I’d declare it 
unusable for any reversal of speed due to gearing, despite the documentation 
indicating it should work.  However, it does properly handle the forward and 
reverse pins for positive and negative commanded speeds, so it should work for 
more conventional gearing.  It seems I’ll be going with Andy’s solution and 
scaling the speed in a mult component for now.

> On Dec 14, 2020, at 11:00 AM, andy pugh  wrote:
> 
> I suggest playing with it in an interactive hal session. See if the
> inputs and outputs do what you want.
> 
> Open a terminal, and with linuxcnc not running:
> 
> halrun
> loadrt spindle names=spindlegear numgears=2
> loadrt threads
> addf spindlegear.0 thread1
> start
> 
> {You now have a very basic HAL system running realtime, and containing
> only the spindle component.
> Now you can experiment with the behaviour}
> 
> show pin
> {Will show all the pins)
> 
> {Let's load a halmeter to look at the output}
> loadusr halmeter pin spindlegear.0.output
> 
> {Now fiddle with inputs and outputs to see what happens. You can use
> tab-completion to save typing}
> setp spindlegear.0.scale.01
> setp spindlegear.0.scale.18.3
> setp spindlegear.0.select.1  1
> setp spindlegear.0.commanded-speed 100
> show pin spindlegear.0.forward
> {and so on}
> 
> {when finished, or to start again}
> exit


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-14 Thread andy pugh
On Mon, 14 Dec 2020 at 17:10, Jon Elson  wrote:

> So, does every configs file set now need to loadrt spindle?

No, the (normal) spindle pins are created when you loadrt motmod. But
they have changed names.

The conversion script should change the pin names in most circumstances.

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-14 Thread Jon Elson

On 12/14/2020 10:37 AM, Matthew Herd wrote:

Thanks Andy, I’ll play with HAL today and see what happens.

Jon, you’re using the motion pins (spindle.0.x) while the "Spindle" 
component also has the same naming format and some of the same names.  It took me awhile 
to sort it out.
Depends on the version of the configs file set!  Yes, older 
versions have motion.spindle.xxx

but the newer versions have just spindle.0.xx

See this forum thread for clarification:  
https://forum.linuxcnc.org/32-documents/40798-spindle-on-pin 


Nonetheless, I’m a little confused on whether the motion spindle speed output 
can be manipulated without the forward and reverse SSR’s being reversed.  
Ignoring the spindle component for a moment, how would motion know you’ve 
modified a speed output to alter the spindle.0.forward and spindle.0.reverse 
outputs?  At any rate, hopefully I can experiment today as suggested by Andy.

These outputs are recomputed at the servo rate, at least on 
my ppmc systems.


Jon


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-14 Thread Jon Elson

On 12/14/2020 10:19 AM, andy pugh wrote:

On Mon, 14 Dec 2020 at 16:15, Jon Elson  wrote:


Well, interesting.  Now, where does spindle come from?  In
my configs, I have signals like :
spindle.0.forward
and
spindle.0.speed-out

But, there is no loadrt spindle command anywhere.

This is rather unfortunate, and I am trying to decide what to do about it.

When I introduced the multispindle patch I moved the spindle pins out
of motion.spindle. to plain spindle to match the ways that
axis and joint pins are not prefixed by motion.
OK, this change makes a lot of sense.  But, it affects a lot 
of stuff.  I have some people who have been trying to get my 
spindle DAC to work on recent builds.  I think this may be 
why it isn't working.
So, does every configs file set now need to loadrt spindle?  
Because none of my sample configs have that.

Then, as part of the 2.8 integration I merged some old, forgotten,
pull requests from Les Newel, not realising that this would
potentially create a namespace clash.


Jon


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-14 Thread Matthew Herd
Thanks Andy, I’ll play with HAL today and see what happens.

Jon, you’re using the motion pins (spindle.0.x) while the "Spindle" 
component also has the same naming format and some of the same names.  It took 
me awhile to sort it out.

See this forum thread for clarification:  
https://forum.linuxcnc.org/32-documents/40798-spindle-on-pin 


Nonetheless, I’m a little confused on whether the motion spindle speed output 
can be manipulated without the forward and reverse SSR’s being reversed.  
Ignoring the spindle component for a moment, how would motion know you’ve 
modified a speed output to alter the spindle.0.forward and spindle.0.reverse 
outputs?  At any rate, hopefully I can experiment today as suggested by Andy.

> On Dec 14, 2020, at 11:19 AM, andy pugh  wrote:
> 
> On Mon, 14 Dec 2020 at 16:15, Jon Elson  wrote:
> 
>> Well, interesting.  Now, where does spindle come from?  In
>> my configs, I have signals like :
>> spindle.0.forward
>> and
>> spindle.0.speed-out
>> 
>> But, there is no loadrt spindle command anywhere.
> 
> This is rather unfortunate, and I am trying to decide what to do about it.
> 
> When I introduced the multispindle patch I moved the spindle pins out
> of motion.spindle. to plain spindle to match the ways that
> axis and joint pins are not prefixed by motion.
> 
> Then, as part of the 2.8 integration I merged some old, forgotten,
> pull requests from Les Newel, not realising that this would
> potentially create a namespace clash.
> 
> -- 
> 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


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-14 Thread andy pugh
On Mon, 14 Dec 2020 at 16:15, Jon Elson  wrote:

> Well, interesting.  Now, where does spindle come from?  In
> my configs, I have signals like :
> spindle.0.forward
> and
> spindle.0.speed-out
>
> But, there is no loadrt spindle command anywhere.

This is rather unfortunate, and I am trying to decide what to do about it.

When I introduced the multispindle patch I moved the spindle pins out
of motion.spindle. to plain spindle to match the ways that
axis and joint pins are not prefixed by motion.

Then, as part of the 2.8 integration I merged some old, forgotten,
pull requests from Les Newel, not realising that this would
potentially create a namespace clash.

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-14 Thread Jon Elson

On 12/14/2020 09:03 AM, Matthew Herd wrote:

I’ve had a chance to do some reading.  In particular, I’ve been contemplating 
Jon’s approach and the spindle component.  The manual is very interesting 
because the spindle component seems to include most of the functionality I 
need.  I was wondering if anyone has an example where they utilize the gears 
parameter.  It seems that it allows negative gear ratios and scaling the 
spindle.N.output by the selected gear ratio.  This would most likely solve the 
forward/reverse problem as well as scaling for backgear without the need for a 
mult or mux component to reverse the SSR’s for direction.  Manual link below 
for reference:

http://linuxcnc.org/docs/devel/html/man/man9/spindle.9.html 



Well, interesting.  Now, where does spindle come from?  In 
my configs, I have signals like :

spindle.0.forward
and
spindle.0.speed-out

But, there is no loadrt spindle command anywhere.  Has 
spindle been broken out of one of the other catch-all 
components in the latest builds?  It looks like some of the 
signal names are different, too.


Thanks,

Jon


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-14 Thread andy pugh
On Mon, 14 Dec 2020 at 15:06, Matthew Herd  wrote:

> I’ve had a chance to do some reading.  In particular, I’ve been contemplating 
> Jon’s approach and the spindle component.  The manual is very interesting 
> because the spindle component seems to include most of the functionality I 
> need.

I have found that the "Spindle" manpage is wrong in some details, I
will attempt to fix it.
Also there is a real risk of a namespace clash with motion hal pins
since the 2.8 update, so it is probably worth using the "names"
parameter to rename the comp pins.


I suggest playing with it in an interactive hal session. See if the
inputs and outputs do what you want.

Open a terminal, and with linuxcnc not running:

halrun
loadrt spindle names=spindlegear numgears=2
loadrt threads
addf spindlegear.0 thread1
start

{You now have a very basic HAL system running realtime, and containing
only the spindle component.
Now you can experiment with the behaviour}

show pin
{Will show all the pins)

{Let's load a halmeter to look at the output}
loadusr halmeter pin spindlegear.0.output

{Now fiddle with inputs and outputs to see what happens. You can use
tab-completion to save typing}
setp spindlegear.0.scale.01
setp spindlegear.0.scale.18.3
setp spindlegear.0.select.1  1
setp spindlegear.0.commanded-speed 100
show pin spindlegear.0.forward
{and so on}

{when finished, or to start again}
exit

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-14 Thread Matthew Herd
I’ve had a chance to do some reading.  In particular, I’ve been contemplating 
Jon’s approach and the spindle component.  The manual is very interesting 
because the spindle component seems to include most of the functionality I 
need.  I was wondering if anyone has an example where they utilize the gears 
parameter.  It seems that it allows negative gear ratios and scaling the 
spindle.N.output by the selected gear ratio.  This would most likely solve the 
forward/reverse problem as well as scaling for backgear without the need for a 
mult or mux component to reverse the SSR’s for direction.  Manual link below 
for reference:

http://linuxcnc.org/docs/devel/html/man/man9/spindle.9.html 


Matt

> On Dec 12, 2020, at 9:55 PM, Jon Elson  wrote:
> 
> On 12/12/2020 08:12 PM, Matthew Herd wrote:
>>   Which raises the question of how the inputs and outputs will be enumerated 
>> for the second board.  Will the second board inputs enumerate as 
>> ppmc.00.din.16.in through ppmc.din.31.in and the outputs as 
>> ppmc.00.dout.08.out through ppmc.00.dout.15.out?  I haven’t yet installed 
>> the second USC so I haven’t been able to test both on the same parallel port 
>> bus.
> Yes, the above is correct.
> 
> 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] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Jon Elson

On 12/12/2020 08:12 PM, Matthew Herd wrote:

   Which raises the question of how the inputs and outputs will be enumerated 
for the second board.  Will the second board inputs enumerate as 
ppmc.00.din.16.in through ppmc.din.31.in and the outputs as ppmc.00.dout.08.out 
through ppmc.00.dout.15.out?  I haven’t yet installed the second USC so I 
haven’t been able to test both on the same parallel port bus.

Yes, the above is correct.

Jon


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Gene Heskett
On Saturday 12 December 2020 21:12:08 Matthew Herd wrote:

> Thanks all for the answers on this.
>
> Andy, I’ll give your and Jon’s solutions some thought and try one of
> them.  Thank you!
>
> Gene, it’s a Bridgeport BOSS 5, which is a factory CNC knee mill
> heavily based on the standard Series 1.  The head is virtually
> identical to a manual Series 1 machine except for the motor and quill
> arrangement.  So all Bridgeports will reverse spindle speed on
> backgear.  I understand the ratio is approximately 8.3:1, but I
> haven’t been able to verify that.
>
> Jon, I have two USC boards on the same parallel port.  I think there
> is a bit of a clarity issue in the documentation here: 
> http://www.linuxcnc.org/docs/html/drivers/pico-ppmc.html
> .  The
> loadrt command references parallel port addresses.  Then the
> extradac=0xnn explanation indicates that a second board on the same
> parallel port should be referenced as 0x02.  Then later, the pins
> enumerate as ppmc.…. with  being the parallel port, not
> the board ID on the bus.  I understood port to refer to the ID on the
> bus, so I assumed the second board would be ppmc.02…. instead of
> ppmc.00… with the channel or pin number enumerating consecutively. 
> Which raises the question of how the inputs and outputs will be
> enumerated for the second board.  Will the second board inputs
> enumerate as ppmc.00.din.16.in through ppmc.din.31.in and the outputs
> as ppmc.00.dout.08.out through ppmc.00.dout.15.out?  I haven’t yet
> installed the second USC so I haven’t been able to test both on the
> same parallel port bus.
>
> Secondly, I had a few questions about your -1/+1 multiplication for
> the spindle speed.  I just want to confirm that if I command an M3
> S-1000 (assuming a plain configuration as shown in my current config),
> the spindle will run in reverse without any other input.
>
> > On Dec 12, 2020, at 11:53 AM, Jon Elson 
> > wrote:
> >
> > On 12/12/2020 08:12 AM, Matthew Herd wrote:
> >> Hi All,
> >>
> >> I’m sure there’s a simple answer for my question, but I haven’t
> >> been able to figure it out.  Currently the configuration for the
> >> spindle forward and reverse outputs is as follows:
> >>
> >> # connect spindle fwd/rev to I/O controller
> >> net SpindleFwd <= ppmc.2.dout.00.out
> >> net SpindleFwd => spindle.0.forward
> >> net SpindleRev <= ppmc.2.dout.01.out
> >> net SpindleRev => spindle.0.reverse
> >
> > ppmc.2 ???  You have THREE parallel ports with ppmc devices
> > connected?  Generally, you set the I/O port address in the line that
> > loads the ppmc driver in the univ_load.hal file, and it comes
> > out as ppmc.0.x
> >
> >> I would like to selectively reverse direction depending on whether
> >> a backgear input switch is triggered.  I see there is a gearchange
> >> component but I’m not clear on how to utilize it.
> >
> > No, don't use gearchange.  Use mux2 to select either -1.0 or +1.0 to
> > a signal depending on the backgear selector.  Then, feed that to
> > mult2 and multiply that by the spindle speed command
> > (motion.spindle-speed-out) to feed the spindle-speed signal.  If you
> > already have a mult2 in there with some value to scale the speed of
> > the spindle, then just use the mux2 to select between a positive and
> > a negative of that value.
> >
> > I think this is the simplest way to do it, rather than reversing the
> > way TWO different outputs work.
> >
It might, never tested it as the std reverse is to issue an M4, usuall on 
the same line as the S1500.

> > Jon

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Jon Elson

On 12/12/2020 08:12 PM, Matthew Herd wrote:

Jon, I have two USC boards on the same parallel port.  I think there is a bit of a 
clarity issue in the documentation here:  
http://www.linuxcnc.org/docs/html/drivers/pico-ppmc.html 
.  The loadrt command 
references parallel port addresses.  Then the extradac=0xnn explanation indicates 
that a second board on the same parallel port should be referenced as 0x02.
Nope.  The ppmc.n. references the parallel port, starting at 
0. Then, functions on the various devices are just 
enumerated from 0. So, if you have two PWM controllers, they 
will enumerate (normally)
as ppmc.0.pwm.00 through ppmc.0.pwm.03 and the second board 
will be ppmc.0.pwm.04 through pwm.07.  The first board's 
encoders will be encoder.00 through encoder.03 and the 2nd 
board will be encoder.04 through encoder.07.



Since multiple boards exchange sync signals on the parallel 
cable, it is best to have all boards on the same parallel 
port.  I'm guessing what you have done is to assign the I/O 
port address of your parallel port to the 3rd possible 
parport in the loadrt command line.  I guess there's no 
reason that this is in any way "wrong", it just surprised 
me, as I've never used the additional parallel port "slots" 
on the command line.


Secondly, I had a few questions about your -1/+1 multiplication for the spindle 
speed.  I just want to confirm that if I command an M3 S-1000 (assuming a plain 
configuration as shown in my current config), the spindle will run in reverse 
without any other input.

No, I don't think that will work, but it might.  generally, 
you use M03 for "forward" spindle, and M04 for "reverse".  
The way this works is the spindle speed is fed to the 
spindle DAC as a positive number (absolute value), and the 
direction is commanded by the SSR1 (forward) or SSR2 (reverse).
spindle.0.forward and spindle.0.reverse are brought out from 
inside LinuxCNC when the spindle speed is non-zero in that 
direction. univpwm_io.hal just routes those to the first two 
solid state relays.



Jon


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Matthew Herd
Thanks all for the answers on this.

Andy, I’ll give your and Jon’s solutions some thought and try one of them.  
Thank you!

Gene, it’s a Bridgeport BOSS 5, which is a factory CNC knee mill heavily based 
on the standard Series 1.  The head is virtually identical to a manual Series 1 
machine except for the motor and quill arrangement.  So all Bridgeports will 
reverse spindle speed on backgear.  I understand the ratio is approximately 
8.3:1, but I haven’t been able to verify that.

Jon, I have two USC boards on the same parallel port.  I think there is a bit 
of a clarity issue in the documentation here:  
http://www.linuxcnc.org/docs/html/drivers/pico-ppmc.html 
.  The loadrt command 
references parallel port addresses.  Then the extradac=0xnn explanation 
indicates that a second board on the same parallel port should be referenced as 
0x02.  Then later, the pins enumerate as ppmc.…. with  being the 
parallel port, not the board ID on the bus.  I understood port to refer to the 
ID on the bus, so I assumed the second board would be ppmc.02…. instead of 
ppmc.00… with the channel or pin number enumerating consecutively.  Which 
raises the question of how the inputs and outputs will be enumerated for the 
second board.  Will the second board inputs enumerate as ppmc.00.din.16.in 
through ppmc.din.31.in and the outputs as ppmc.00.dout.08.out through 
ppmc.00.dout.15.out?  I haven’t yet installed the second USC so I haven’t been 
able to test both on the same parallel port bus.

Secondly, I had a few questions about your -1/+1 multiplication for the spindle 
speed.  I just want to confirm that if I command an M3 S-1000 (assuming a plain 
configuration as shown in my current config), the spindle will run in reverse 
without any other input.


> On Dec 12, 2020, at 11:53 AM, Jon Elson  wrote:
> 
> On 12/12/2020 08:12 AM, Matthew Herd wrote:
>> Hi All,
>> 
>> I’m sure there’s a simple answer for my question, but I haven’t been able to 
>> figure it out.  Currently the configuration for the spindle forward and 
>> reverse outputs is as follows:
>> 
>> # connect spindle fwd/rev to I/O controller
>> net SpindleFwd <= ppmc.2.dout.00.out
>> net SpindleFwd => spindle.0.forward
>> net SpindleRev <= ppmc.2.dout.01.out
>> net SpindleRev => spindle.0.reverse
> ppmc.2 ???  You have THREE parallel ports with ppmc devices connected?  
> Generally, you set the I/O port address in the line that loads the ppmc 
> driver in the univ_load.hal file, and it comes out as
> ppmc.0.x
>> I would like to selectively reverse direction depending on whether a 
>> backgear input switch is triggered.  I see there is a gearchange component 
>> but I’m not clear on how to utilize it.
> No, don't use gearchange.  Use mux2 to select either -1.0 or +1.0 to a signal 
> depending on the backgear selector.  Then, feed that to mult2 and multiply 
> that by the spindle speed command
> (motion.spindle-speed-out) to feed the spindle-speed signal.  If you already 
> have a mult2 in there with some value to scale the speed of the spindle, then 
> just use the mux2 to select between a positive and a negative of that value.
> 
> I think this is the simplest way to do it, rather than reversing the way TWO 
> different outputs work.
> 
> 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] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Jon Elson

On 12/12/2020 08:12 AM, Matthew Herd wrote:

Hi All,

I’m sure there’s a simple answer for my question, but I haven’t been able to 
figure it out.  Currently the configuration for the spindle forward and reverse 
outputs is as follows:

# connect spindle fwd/rev to I/O controller
net SpindleFwd <= ppmc.2.dout.00.out
net SpindleFwd => spindle.0.forward
net SpindleRev <= ppmc.2.dout.01.out
net SpindleRev => spindle.0.reverse
ppmc.2 ???  You have THREE parallel ports with ppmc devices 
connected?  Generally, you set the I/O port address in the 
line that loads the ppmc driver in the univ_load.hal 
file, and it comes out as

ppmc.0.x

I would like to selectively reverse direction depending on whether a backgear 
input switch is triggered.  I see there is a gearchange component but I’m not 
clear on how to utilize it.
No, don't use gearchange.  Use mux2 to select either -1.0 or 
+1.0 to a signal depending on the backgear selector.  Then, 
feed that to mult2 and multiply that by the spindle speed 
command
(motion.spindle-speed-out) to feed the spindle-speed 
signal.  If you already have a mult2 in there with some 
value to scale the speed of the spindle, then just use the 
mux2 to select between a positive and a negative of that value.


I think this is the simplest way to do it, rather than 
reversing the way TWO different outputs work.


Jon


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Gene Heskett
On Saturday 12 December 2020 09:53:33 andy pugh wrote:

> On Sat, 12 Dec 2020 at 14:47, John Figie  wrote:
> > I think a multiplexer will do what you want.
> > http://linuxcnc.org/docs/2.8/html/man/man9/mux2.9.html
>
> mux2 only multiplexes floats. See my reply for how to use mux_generic
> to make bitwise muxes.

I'd forgotten the float limitation, you are correct as usual. 

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Gene Heskett
On Saturday 12 December 2020 09:12:47 Matthew Herd wrote:

> Hi All,
>
> I’m sure there’s a simple answer for my question, but I haven’t been
> able to figure it out.  Currently the configuration for the spindle
> forward and reverse outputs is as follows:
>
> # connect spindle fwd/rev to I/O controller
> net SpindleFwd <= ppmc.2.dout.00.out
> net SpindleFwd => spindle.0.forward
> net SpindleRev <= ppmc.2.dout.01.out
> net SpindleRev => spindle.0.reverse
>
> I would like to selectively reverse direction depending on whether a
> backgear input switch is triggered.  I see there is a gearchange
> component but I’m not clear on how to utilize it.  Does the gearchange
> component translate to the pin assignments for spindle.0.forward and
> spindle.0.reverse?  Don’t I need some additional logic?  The goal is
> to have logic like so:
>
> if (backgear == TRUE) {
>   net SpindleFwd <= ppmc.2.dout.00.out
>   net SpindleFwd => spindle.0.forward
>   net SpindleRev <= ppmc.2.dout.01.out
>   net SpindleRev => spindle.0.reverse
> } else {
>   net SpindleFwd <= ppmc.2.dout.01.out
>   net SpindleFwd => spindle.0.forward
>   net SpindleRev <= ppmc.2.dout.00.out
>   net SpindleRev => spindle.0.reverse
> }
>
> As you can see, the only change is that I’m swapping which output is
> assigned to spindle.0.forward and spindle.0.reverse.
>
Hal doesn't have an IF/ELSE/ENDIF function that I know of. So you'll have 
to use a pair of mux2's to steer the signal according to the status 
of "backgear", easy enough to do. Drive the mux2's sel pin 
with "backgear", but interchange the inputs of the two modules. The 
biggest problem is speed as the update is limited by servo loop, 
generally 1 kilohertz, timing, so you can't steer a 10 kilohertz 
pwmgen's output that way. Even a 100 hz pwm would become badly damaged 
by that sort of a switch.

I'm not well versed in all the machines ever made, but I've never heard 
of a backgear, or spindle gearshift that reversed the spindles direction 
of rotation.  Not saying that is impossible but it sure seems odd.

> Thanks,
> Matt

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread andy pugh
On Sat, 12 Dec 2020 at 14:47, John Figie  wrote:
>
> I think a multiplexer will do what you want.
> http://linuxcnc.org/docs/2.8/html/man/man9/mux2.9.html

mux2 only multiplexes floats. See my reply for how to use mux_generic
to make bitwise muxes.

-- 
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] Question Regarding Selective Assignments in HAL

2020-12-12 Thread andy pugh
On Sat, 12 Dec 2020 at 14:15, Matthew Herd  wrote:

> I would like to selectively reverse direction depending on whether a backgear 
> input switch is triggered.  I see there is a gearchange component but I’m not 
> clear on how to utilize it.  Does the gearchange component translate to the 
> pin assignments for spindle.0.forward and spindle.0.reverse?

No, it handles the ratio change, so that the correct motor speed is
sent to the drive for the selected spindle speed.

> if (backgear == TRUE) {
> net SpindleFwd <= ppmc.2.dout.00.out
> net SpindleFwd => spindle.0.forward
> net SpindleRev <= ppmc.2.dout.01.out
> net SpindleRev => spindle.0.reverse
> } else {
> net SpindleFwd <= ppmc.2.dout.01.out
> net SpindleFwd => spindle.0.forward
> net SpindleRev <= ppmc.2.dout.00.out
> net SpindleRev => spindle.0.reverse
> }

One way is with a pair of bitwise mux components.
http://linuxcnc.org/docs/2.8/html/man/man9/mux_generic.9.html

loadrt mux_generic config="bb2,bb2"
...
addf mux-gen.00 servo-thread
addf mux-gen.01 servo-thread
...
net backgear => mux-gen.00.sel-bit-00mux-gen.01.sel-bit-00
net SpindleFwdCmd spindle.0.forward => mux-gen.00.in-bit-00
mux-gen.01.in-bit-01
net SpindleRevCmd spindle.0.reverse => mux-gen.01.in-bit-00
mux-gen.00.in-bit-01
net SpindleFwdPin => mux-gen.00.out-bit => ppmc.2.dout.00.out
net SpindleRevPin => mux-gen.00.out-bit => ppmc.2.dout.01.out


-- 
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] Question Regarding Selective Assignments in HAL

2020-12-12 Thread John Figie
I think a multiplexer will do what you want.
http://linuxcnc.org/docs/2.8/html/man/man9/mux2.9.html



On Sat, Dec 12, 2020, 8:15 AM Matthew Herd  wrote:

> Hi All,
>
> I’m sure there’s a simple answer for my question, but I haven’t been able
> to figure it out.  Currently the configuration for the spindle forward and
> reverse outputs is as follows:
>
> # connect spindle fwd/rev to I/O controller
> net SpindleFwd <= ppmc.2.dout.00.out
> net SpindleFwd => spindle.0.forward
> net SpindleRev <= ppmc.2.dout.01.out
> net SpindleRev => spindle.0.reverse
>
> I would like to selectively reverse direction depending on whether a
> backgear input switch is triggered.  I see there is a gearchange component
> but I’m not clear on how to utilize it.  Does the gearchange component
> translate to the pin assignments for spindle.0.forward and
> spindle.0.reverse?  Don’t I need some additional logic?  The goal is to
> have logic like so:
>
> if (backgear == TRUE) {
> net SpindleFwd <= ppmc.2.dout.00.out
> net SpindleFwd => spindle.0.forward
> net SpindleRev <= ppmc.2.dout.01.out
> net SpindleRev => spindle.0.reverse
> } else {
> net SpindleFwd <= ppmc.2.dout.01.out
> net SpindleFwd => spindle.0.forward
> net SpindleRev <= ppmc.2.dout.00.out
> net SpindleRev => spindle.0.reverse
> }
>
> As you can see, the only change is that I’m swapping which output is
> assigned to spindle.0.forward and spindle.0.reverse.
>
> Thanks,
> Matt
>
> ___
> 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


[Emc-users] Question Regarding Selective Assignments in HAL

2020-12-12 Thread Matthew Herd
Hi All,

I’m sure there’s a simple answer for my question, but I haven’t been able to 
figure it out.  Currently the configuration for the spindle forward and reverse 
outputs is as follows:

# connect spindle fwd/rev to I/O controller
net SpindleFwd <= ppmc.2.dout.00.out
net SpindleFwd => spindle.0.forward
net SpindleRev <= ppmc.2.dout.01.out
net SpindleRev => spindle.0.reverse

I would like to selectively reverse direction depending on whether a backgear 
input switch is triggered.  I see there is a gearchange component but I’m not 
clear on how to utilize it.  Does the gearchange component translate to the pin 
assignments for spindle.0.forward and spindle.0.reverse?  Don’t I need some 
additional logic?  The goal is to have logic like so:

if (backgear == TRUE) {
net SpindleFwd <= ppmc.2.dout.00.out
net SpindleFwd => spindle.0.forward
net SpindleRev <= ppmc.2.dout.01.out
net SpindleRev => spindle.0.reverse
} else {
net SpindleFwd <= ppmc.2.dout.01.out
net SpindleFwd => spindle.0.forward
net SpindleRev <= ppmc.2.dout.00.out
net SpindleRev => spindle.0.reverse
}

As you can see, the only change is that I’m swapping which output is assigned 
to spindle.0.forward and spindle.0.reverse.

Thanks,
Matt

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