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

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

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-

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

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

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

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

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

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.

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

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

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

[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

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

[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

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

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

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

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

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

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

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

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,

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

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

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

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

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

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