Re: [Emc-users] Python question

2020-12-15 Thread John Dammeyer
Ah.
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/usr_intf/emcrsh.cc
It uses sockets in that file which implies this is how communications is done.  

But as usual, the code is quite vague.  For example there's this function.
static cmdResponseType setSpindle(char *s, connectionRecType *context) {

And inside the function 
switch (checkSpindleStr(s)) {
 case -1: return rtStandardError;
 case 0: sendSpindleForward(spindle); break;

and a few more cases.
So where is sendSpindleForward(spindle) ?

Is there a way to search for "sendSpindleForward" to find out if it's a MACRO 
or a function that formats the message to go to the socket?

Thanks
John



> -Original Message-
> From: Frank Tkalcevic [mailto:fr...@franksworkshop.com.au]
> Sent: December-15-20 9:48 PM
> To: 'Enhanced Machine Controller (EMC)'
> Subject: Re: [Emc-users] Python question
> 
> If you look at the axis source code, to increment the spindle you call...
> 
> c.spindle(linuxcnc.SPINDLE_INCREASE)
> 
> where
> 
> c = linuxcnc.command()
> 
> 
> linuxcnc.command() comes from halui.cc (I think), which sends a message...
> 
> static int sendSpindleIncrease(int spindle)
> {
> EMC_SPINDLE_INCREASE emc_spindle_increase_msg;
> emc_spindle_increase_msg.spindle = spindle;
> return emcCommandSend(emc_spindle_increase_msg);
> }
> 
> So, to invoke an action, you are actually sending a message to linuxcnc, not 
> just settings  a pin.  Status information, like spindle speed,
> for example, come from the status message, which is also exposed via halui 
> for python.
> 
> There are examples, like linuxcnc/src/emc/usr_intf/emcrsh.cc, which do this 
> in C++.
> 
> 
> 
> -Original Message-
> From: John Dammeyer [mailto:jo...@autoartisans.com]
> Sent: Wednesday, 16 December 2020 3:59 PM
> To: 'Enhanced Machine Controller (EMC)'
> Subject: Re: [Emc-users] Python question
> 
> Let's say you wanted to access the hal pins and essentially run the machine 
> using a different programming language like C instead of
> python.
> 
> How's the linkage done from say the Axis GUI to the rest of the system?  Like 
> Spindle ON button and then Spindle +
> 
> John
> 
> 
> > -Original Message-
> > From: andy pugh [mailto:bodge...@gmail.com]
> > Sent: December-15-20 5:15 PM
> > To: Enhanced Machine Controller (EMC)
> > Subject: Re: [Emc-users] Python question
> >
> > On Wed, 16 Dec 2020 at 01:10,  wrote:
> > >
> > > Are the necessary environment variables document somewhere?
> >
> > I think you just need to "import linuxcnc" to get access to linuxcnc
> > command and state.
> >
> > But you would probably still need to create and net hal pins to get
> > values from 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
> 
> 
> 
> ___
> 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] Python question

2020-12-15 Thread Frank Tkalcevic
If you look at the axis source code, to increment the spindle you call...

c.spindle(linuxcnc.SPINDLE_INCREASE)

where 

c = linuxcnc.command()


linuxcnc.command() comes from halui.cc (I think), which sends a message...

static int sendSpindleIncrease(int spindle)
{
EMC_SPINDLE_INCREASE emc_spindle_increase_msg;
emc_spindle_increase_msg.spindle = spindle;
return emcCommandSend(emc_spindle_increase_msg);
}

So, to invoke an action, you are actually sending a message to linuxcnc, not 
just settings  a pin.  Status information, like spindle speed, for example, 
come from the status message, which is also exposed via halui for python.

There are examples, like linuxcnc/src/emc/usr_intf/emcrsh.cc, which do this in 
C++.



-Original Message-
From: John Dammeyer [mailto:jo...@autoartisans.com] 
Sent: Wednesday, 16 December 2020 3:59 PM
To: 'Enhanced Machine Controller (EMC)'
Subject: Re: [Emc-users] Python question

Let's say you wanted to access the hal pins and essentially run the machine 
using a different programming language like C instead of python.  

How's the linkage done from say the Axis GUI to the rest of the system?  Like 
Spindle ON button and then Spindle +

John


> -Original Message-
> From: andy pugh [mailto:bodge...@gmail.com]
> Sent: December-15-20 5:15 PM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Python question
> 
> On Wed, 16 Dec 2020 at 01:10,  wrote:
> >
> > Are the necessary environment variables document somewhere?
> 
> I think you just need to "import linuxcnc" to get access to linuxcnc
> command and state.
> 
> But you would probably still need to create and net hal pins to get
> values from 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



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


Re: [Emc-users] Python question

2020-12-15 Thread John Dammeyer
Let's say you wanted to access the hal pins and essentially run the machine 
using a different programming language like C instead of python.  

How's the linkage done from say the Axis GUI to the rest of the system?  Like 
Spindle ON button and then Spindle +

John


> -Original Message-
> From: andy pugh [mailto:bodge...@gmail.com]
> Sent: December-15-20 5:15 PM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Python question
> 
> On Wed, 16 Dec 2020 at 01:10,  wrote:
> >
> > Are the necessary environment variables document somewhere?
> 
> I think you just need to "import linuxcnc" to get access to linuxcnc
> command and state.
> 
> But you would probably still need to create and net hal pins to get
> values from 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] Python question

2020-12-15 Thread ken.strauss
Tormach installs their stuff into a directory named for the current version
of Pathpilot and then creates a link to it from ~/tmc  With help from a very
knowledgeable Tormach user I learned that if you enter:

cd ~/tmc
source ./scripts/rip-environment.sh

you can then run halcmd in a terminal window

Thanks for the hint!

-Original Message-
From: Frank Tkalcevic  
Sent: December 15, 2020 8:46 PM
To: 'Enhanced Machine Controller (EMC)' 
Subject: Re: [Emc-users] Python question

I run in-place, so I run...

. $EMC_HOME/scripts/rip-environment

Before each run.

If you are running PathPilot, I'm guessing your distribution is from
Tormach, so the environment variables may already be set up.  

Just try it.  If it doesn't work, you should get error messages.



-Original Message-
From: ken.stra...@gmail.com [mailto:ken.stra...@gmail.com]
Sent: Wednesday, 16 December 2020 12:08 PM
To: 'Enhanced Machine Controller (EMC)'
Subject: Re: [Emc-users] Python question

Are the necessary environment variables document somewhere?

-Original Message-
From: Frank Tkalcevic 
Sent: December 15, 2020 6:51 PM
To: 'Enhanced Machine Controller (EMC)' 
Subject: Re: [Emc-users] Python question

As long as the environment variables are set up correctly, you should just
be able to run the python app from the command line without "halcmd
loadusr".


-Original Message-
From: ken.stra...@gmail.com [mailto:ken.stra...@gmail.com]
Sent: Wednesday, 16 December 2020 7:54 AM
To: 'Enhanced Machine Controller (EMC)'
Subject: [Emc-users] Python question

I somewhat understand writing a Python program that reads/writes HAL pins
and starting it with halcmd loadusr. Is it possible to start a Python
program from a terminal window and access HAL pins without using halcmd? If
yes, what is the magic incantation? I ask because PathPilot does not appear
to include halcmd.



___
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 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 mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Python question

2020-12-15 Thread Frank Tkalcevic
I run in-place, so I run...

. $EMC_HOME/scripts/rip-environment

Before each run.

If you are running PathPilot, I'm guessing your distribution is from
Tormach, so the environment variables may already be set up.  

Just try it.  If it doesn't work, you should get error messages.



-Original Message-
From: ken.stra...@gmail.com [mailto:ken.stra...@gmail.com] 
Sent: Wednesday, 16 December 2020 12:08 PM
To: 'Enhanced Machine Controller (EMC)'
Subject: Re: [Emc-users] Python question

Are the necessary environment variables document somewhere?

-Original Message-
From: Frank Tkalcevic  
Sent: December 15, 2020 6:51 PM
To: 'Enhanced Machine Controller (EMC)' 
Subject: Re: [Emc-users] Python question

As long as the environment variables are set up correctly, you should just
be able to run the python app from the command line without "halcmd
loadusr".


-Original Message-
From: ken.stra...@gmail.com [mailto:ken.stra...@gmail.com]
Sent: Wednesday, 16 December 2020 7:54 AM
To: 'Enhanced Machine Controller (EMC)'
Subject: [Emc-users] Python question

I somewhat understand writing a Python program that reads/writes HAL pins
and starting it with halcmd loadusr. Is it possible to start a Python
program from a terminal window and access HAL pins without using halcmd? If
yes, what is the magic incantation? I ask because PathPilot does not appear
to include halcmd.



___
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 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] Python question

2020-12-15 Thread andy pugh
On Wed, 16 Dec 2020 at 01:10,  wrote:
>
> Are the necessary environment variables document somewhere?

I think you just need to "import linuxcnc" to get access to linuxcnc
command and state.

But you would probably still need to create and net hal pins to get
values from 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] Python question

2020-12-15 Thread ken.strauss
Are the necessary environment variables document somewhere?

-Original Message-
From: Frank Tkalcevic  
Sent: December 15, 2020 6:51 PM
To: 'Enhanced Machine Controller (EMC)' 
Subject: Re: [Emc-users] Python question

As long as the environment variables are set up correctly, you should just
be able to run the python app from the command line without "halcmd
loadusr".


-Original Message-
From: ken.stra...@gmail.com [mailto:ken.stra...@gmail.com]
Sent: Wednesday, 16 December 2020 7:54 AM
To: 'Enhanced Machine Controller (EMC)'
Subject: [Emc-users] Python question

I somewhat understand writing a Python program that reads/writes HAL pins
and starting it with halcmd loadusr. Is it possible to start a Python
program from a terminal window and access HAL pins without using halcmd? If
yes, what is the magic incantation? I ask because PathPilot does not appear
to include halcmd.



___
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 mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Python question

2020-12-15 Thread Frank Tkalcevic
As long as the environment variables are set up correctly, you should just
be able to run the python app from the command line without "halcmd
loadusr".


-Original Message-
From: ken.stra...@gmail.com [mailto:ken.stra...@gmail.com] 
Sent: Wednesday, 16 December 2020 7:54 AM
To: 'Enhanced Machine Controller (EMC)'
Subject: [Emc-users] Python question

I somewhat understand writing a Python program that reads/writes HAL pins
and starting it with halcmd loadusr. Is it possible to start a Python
program from a terminal window and access HAL pins without using halcmd? If
yes, what is the magic incantation? I ask because PathPilot does not appear
to include halcmd.



___
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 + MDI (Was: I wonder...)

2020-12-15 Thread Jon Elson

On 12/15/2020 03:43 PM, andy pugh wrote:
The first time I tried it, I got what I expected, then I 
tried again and now it gives the wrong behaviour every 
time. So at least I have a system to try debugging on.

BTW, using a PC and Axis 2.7.14 (still with the MESA) it exhibits the same 
issue.

Which suggests that it isn't related to the mult-spindle changes, as I assumed.
No, I think this behavior has been there for QUITE some 
time. Normally, I start and stop the spindle
with G-code, when running an actual program.  But, when 
manual machining, I use MDI to start the spindle with M03 
S###.  Any time the spindle has been stopped by command or 
program end (M02) or F9, then you need both the command 
(M03) and set the speed S###.  It's been like that since 
Axis was created, I think.


Jon


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


Re: [Emc-users] Spindle + MDI (Was: I wonder...)

2020-12-15 Thread John Dammeyer
I see what you mean now.  The two paths to the same action are not well 
connected.

S0 and M3 in the MDI screen shows up on the list of settings.
S100 then starts the motor turning.  S0 stops it but the M3 and S0 are still 
there.
An M5 then replaces the M3 with the M5.

Now flip over to the other screen and click on the CW button and then back to 
the MDI screen.  The M5 is still there.  Should really be an M3 at this point 
with S set to 0 since we haven't clicked on an +/- button.
Theoretically then on the user screen clicking on the +/- button should have 
increased S by 100.  But it doesn't.
So now stop the motor and back to the MDI screen.
Send an M3 with S0.
Back to the user screen.  The CW button shows pressed.
Click on +/- and nothing happens.
So either the CW shouldn't respond to an M3 or
The M3 should show the CW button pressed and the RPM display should show the 
RPM etc.
At this point, it should be possible to click on the +/- buttons which should 
show a corresponding change in the MDI parameters window of S100, S200 etc.
Clicking on the STOP button should remove the M3 and replace it with an M5.

The only potential interaction I can see is that what should be done with the 
S?  From the user screen pressing the STOP issues that M5 and also sets S to 0 
while doing that from an MDI screen only issues the M5 since they are 
disconnected commands.

I'd say that from a user perspective what's under the covers (M3 S100) isn't 
important.  The default with the button is CW with S0.  Then press the +/- 
buttons to adjust the speed.  That this becomes an M3 S0, M3 S100, M3 S200, M3 
S100 is really not all that important.

So using top down design techniques that's what we should see.  And the bottom 
up implementation should change things so the MDI page shows what the buttons 
have done.  As in M3 state and S400 state.  In the MDI page sending those 
changes the buttons on the user screen.

John


> -Original Message-
> From: andy pugh [mailto:bodge...@gmail.com]
> Sent: December-15-20 1:56 PM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Spindle + MDI (Was: I wonder...)
> 
> On Tue, 15 Dec 2020 at 21:43, andy pugh  wrote:
> >
> > I don't think that I have seen this with Touchy
> 
> OK, you can't see this in Touchy as the MDI interface needs you to
> press M3 to get an S to fill out.
> 
> But Gmoccapy is the same.
> 
> --
> 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] Spindle + MDI (Was: I wonder...)

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 21:43, andy pugh  wrote:
>
> I don't think that I have seen this with Touchy

OK, you can't see this in Touchy as the MDI interface needs you to
press M3 to get an S to fill out.

But Gmoccapy is the same.

-- 
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 + MDI (Was: I wonder...)

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 19:04, John Dammeyer  wrote:

> Enter instead G01 X1.0 F4 M3 S1000 and spindle doesn't stop but accelerates 
> up to 1000 RPM.

The first time I tried it, I got what I expected, then I tried again
and now it gives the wrong behaviour every time.
So at least I have a system to try debugging on.

> BTW, using a PC and Axis 2.7.14 (still with the MESA) it exhibits the same 
> issue.

Which suggests that it isn't related to the mult-spindle changes, as I assumed.

> So it looks like although the AXIS Spindle ON should also set the M3 it 
> doesn't?

I am not sure. You will note that the axis spindle-on button stays
depressed, and you need to stop to get Axis back in synch.

You don't need the move. If you set the spindle to 500 in the GUI then
issue "S1000" in the MDI window the spindle stops.

I don't think that I have seen this with Touchy (the other UII use)
but I need to check.

-- 
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] Python question

2020-12-15 Thread ken.strauss
I somewhat understand writing a Python program that reads/writes HAL pins and 
starting it with halcmd loadusr. Is it possible to start a Python program from 
a terminal window and access HAL pins without using halcmd? If yes, what is the 
magic incantation? I ask because PathPilot does not appear to include halcmd.



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


Re: [Emc-users] Spindle + MDI (Was: I wonder...)

2020-12-15 Thread John Dammeyer
Hi Andy,
Pretty straight forward. 
Original Raspberry Pi4 2.8.0 Linux CNC distribution with MESA 7i92H.  AXIS 
screen reporting 2.8.0
1. Power system up.
2. Home all.
3. Move axis so knee and XY are in mid range and touch of each axis so 
co-ordinates  are 0,0,0.
4. Click on Spindle forward and increment to 500 RPM.
5. Change to MDO screen
6. Enter in G01 X1.0 F4 S1000
7. Spindle stops.  X moves to 1.0.

Enter instead G01 X1.0 F4 M3 S1000 and spindle doesn't stop but accelerates up 
to 1000 RPM.

BTW, using a PC and Axis 2.7.14 (still with the MESA) it exhibits the same 
issue.

So it looks like although the AXIS Spindle ON should also set the M3 it doesn't?

John

> -Original Message-
> From: andy pugh [mailto:bodge...@gmail.com]
> Sent: December-15-20 8:14 AM
> To: Enhanced Machine Controller (EMC)
> Subject: [Emc-users] Spindle + MDI (Was: I wonder...)
> 
> On Fri, 11 Dec 2020 at 23:53, John Dammeyer  wrote:
> 
> > It�s the little things tha trip me up.  Like setting the spindle to 1000 
> > RPM.  Doing some cutting and > then sending an MDI command
> like G01 X0.0 S500. And the spindle stopped.  Seems once
> > issued from the MDI it doesn't know that there was an M3 kind of there from 
> > the user interface
> > speed setting.  So it stopped.  Had to hit estop before the cutter hit the 
> > work.
> 
> Can you say how to reproduce this, step by step? I tried and failed.
> Also, which GUI?
> 
> --
> 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


[Emc-users] Spindle + MDI (Was: I wonder...)

2020-12-15 Thread andy pugh
On Fri, 11 Dec 2020 at 23:53, John Dammeyer  wrote:

> It’s the little things tha trip me up.  Like setting the spindle to 1000 RPM. 
>  Doing some cutting and > then sending an MDI command like G01 X0.0 S500. And 
> the spindle stopped.  Seems once
> issued from the MDI it doesn't know that there was an M3 kind of there from 
> the user interface
> speed setting.  So it stopped.  Had to hit estop before the cutter hit the 
> work.

Can you say how to reproduce this, step by step? I tried and failed.
Also, which GUI?

-- 
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] calibrating the BS-1 battle

2020-12-15 Thread Gene Heskett
On Tuesday 15 December 2020 08:53:46 andy pugh wrote:

> On Tue, 15 Dec 2020 at 13:48, Gene Heskett  
wrote:
> > Extending this same reasoning to that 666.66forever line of
> > thought, and knowing that 1 full turn of the worm is exactly 9
> > degrees since its a 40/1 drive in the BS-1, can we further refine it
> > to an even integer number?
>
> No. Whatever the encoder count is, it will be an integer divided by
> 360, and the recurring 66.. is pretty much baked-in.

I'll take your word for it, thanks Andy.

> But after 10 or so 6es you won't see the error in the life of _this_
> universe.


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-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] calibrating the BS-1 battle

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 13:48, Gene Heskett  wrote:

> Extending this same reasoning to that 666.66forever line of thought,
> and knowing that 1 full turn of the worm is exactly 9 degrees since its
> a 40/1 drive in the BS-1, can we further refine it to an even integer
> number?

No. Whatever the encoder count is, it will be an integer divided by
360, and the recurring 66.. is pretty much baked-in.

But after 10 or so 6es you won't see the error in the life of _this_ universe.

-- 
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 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] calibrating the BS-1 battle

2020-12-15 Thread Gene Heskett
On Tuesday 15 December 2020 05:59:34 andy pugh wrote:

> On Tue, 15 Dec 2020 at 00:36, Gene Heskett  
wrote:
> > So the last attempt was only for ten trips past the home switch.
> > That kept the halmeters out of sci notation. Tracking the encoders
> > rawcounts with two sample-holds, first freezing the rawcount at the
> > first switch passing, the second freezing the raw count at the 10-11
> > transition. Then subtracting the first from he second gave 2400114
> > rawcounts difference.
>
> This is _much_ more likely to be 2,400,000 than 2,400,114. (The answer
> must, at the very least, be divisible by 10)

I wondered about that, but didn't come up with that particular reason, 
and its a good one. Given the contact bounce of a 34 cent microswitch, 
and the latency timing jitter since the switch is moving relatively 
slowly I certainly won't argue the point. The question then becomes "how 
many 6's do I put to the right of the decimal in the ini file 
definition?"

> So your scale is probably 666.66
>
> Not that the difference in the numbers is likely to correspond to any
> significant error in the parts.

Extending this same reasoning to that 666.66forever line of thought, 
and knowing that 1 full turn of the worm is exactly 9 degrees since its 
a 40/1 drive in the BS-1, can we further refine it to an even integer 
number?

Leaving only the mechanical errors in grinding the worms and bull gears 
since they are going to be cyclic AND synchronous averaging to zero 
error at any one point in the 360 degree rotation.  From the variations 
in drag as its turned by hand, there is obviously some eccentricity in 
the BS-1 bull gear and in the BS-1's worm.  And I can also see a cyclic 
variation in the effort the pwm is exerting on a scope watching the pwm 
width and it seems to correspond to the internal gearing of the motor.  
Its encoder HAS to be an integer per its armature turn, but is an 
unknown, not specified, but both the encoder and the motors internal 
worm gear ratio have to be integers. I could fine tune that by running 
it more turns but eventually the halmeters switch to sci notation 
displays so my usual 100 turn measurement isn't possible due to that 
rounding.

20, maybe 30 turns might be possible, but by 50 I'm looking at sci 
notation displays. And the way its mounted on the mill as I am drilling 
and tapping for mounting bolts precludes putting the indexing disk on 
it, so I am totally dependent of the home switch and its vagaries for 
this 1 turn index ATM.

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-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] calibrating the BS-1 battle

2020-12-15 Thread andy pugh
On Tue, 15 Dec 2020 at 00:36, Gene Heskett  wrote:

> So the last attempt was only for ten trips past the home switch. That
> kept the halmeters out of sci notation. Tracking the encoders rawcounts
> with two sample-holds, first freezing the rawcount at the first switch
> passing, the second freezing the raw count at the 10-11 transition. Then
> subtracting the first from he second gave 2400114 rawcounts difference.

This is _much_ more likely to be 2,400,000 than 2,400,114. (The answer
must, at the very least, be divisible by 10)

So your scale is probably 666.66

Not that the difference in the numbers is likely to correspond to any
significant error in the parts.

-- 
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