Hello Guest it is March 28, 2024, 10:02:50 AM

Author Topic: mach4 probe operation  (Read 1482 times)

0 Members and 1 Guest are viewing this topic.

mach4 probe operation
« on: November 24, 2018, 02:02:23 AM »
Hi
I have a XHC motion controller and using the probe function on the Z axis it will approach the switch stop when touched but will not retract and gets a error
I set up a led to see when the switch was on or off and this does not work it will work on any other input  just fine but on the probe input does not work if I go into control panel and inputs and where the probe is mapped and switch input active  over the led lights up so I am sure mach4 is reading the probe input

is probe  just a standard input could I use another input that is working and change the screen script to accept it as a probe or it the probe some thing different and I am missing some thing
Regards Ray

Offline Stuart

*
  •  311 311
    • View Profile
Re: mach4 probe operation
« Reply #1 on: November 24, 2018, 02:45:57 AM »
Yes it’s the XHC controller

I had a leafboy and it was just the same
Re: mach4 probe operation
« Reply #2 on: November 25, 2018, 04:56:06 PM »
Hi Raymondno,
regrettably a lot of Chinese manufactured controllers do not handle probing (and other features) in a way that Mach expects.

I have copied this extract from the API.chm document which is intended to give plugin writers (manufacturers) exactly
what their controller/plugin is expected to do in order for probing to be successful:

--------------------------------------------------------------------------------

Probing
Motion plugin probing procedure.
The probe moves are really just G01 moves in exeact stop mode with the addition of being marked as EX_PROBE in the execution_t struct from mcMotionCyclePlannerEx().

When executing a G31, the core considers the move as an exact stop move and therefore will request a motor stop report. It waits on one of two conditions:

A probe strike condition where the motion plugin calls mcMotionSetProbeComplete().
An end of move condition where the motion plugin reports the motors as being still.
Until either of these conditions are satisfied, the core will generate no more moves after the EX_PROBE marked moves. In other words, all you will get out of mcMotionCyclePlannerEx() will be EX_NONE type data. In the event of a probe strike, this makes it safe to clear the planner and be sure that future moves are not removed by accident.

A motion plugin should implement probing in the following way:

Upon seeing the first move marked as EX_PROBE, the plugin should arm position latches on the hardware.
Then consume the EX_PROBE marked moves as normal.
If the probe stikes, the plugin should:
Cancel any MSG_REPORT_MOTOR_STOP requests. (see g. VERY important!)
Report the latched positions via mcMotionSetProbePos() for each motor.
Clear the hardware of any additional moves.
Call mcMotionClearPlanner() to clear the Mach planner of any unretrieved EX_PROBE moves.
Update Mach with the hardware's current position via mcMotionSetPos().
Call mcMotionSetProbeComplete().
If a MSG_REPORT_MOTOR_STOP has been received, do not acknowledge it. mcMotionSetProbeComplete() does this for you and a position sync as well.
If no probe strike, then the move continues to it's end point as if it is a regular move.
The plugin should ack the MSG_REPORT_MOTOR_STOP messages with mcMotionSetStill().
The positions latches should be disarmed (if needed) when a MSG_PROBE_DONE is seen.
In the event that the probe move is aborted, the plugin should:
Call mcMotionClearPlanner() to clear the Mach planner of any unretrieved EX_PROBE moves.
Call mcMotorSetPos() for each controlled motor.
Call mcMotionSync.
Call mcMotionSetStill() for each controlled motor.
Probe Operation Overview.
Upon executing G31, the core will mark those moves as EX_PROBE in the data stream.
If the probe strikes before the end of the G31 move, the plugin aborts the rest of the probe moves as described above. If a probe data file has been opened via mcCntlProbeFileOpen(), then the positions recorded by the motion plugin are inserted into the probe data file in the specified format.
If the probe doesn't strike and the G31 move reaches its end point and a probe data file has been opened via mcCntlProbeFileOpen(), then the end point positions are inserted into the probe data file in the specified format.
Using the probe data file routines.
int mcCntlProbeFileOpen(MINSTANCE inst, const char *filename, const char *format);
The format argument is a printf style format with expanding macros for the axis values. AXIS_X, AXIS_Y, AXIS_Z, AXIS_A, AXIS_B, AXIS_C. It is used in the following manner:


mcCntlProbeFileOpen(inst, "myProbeFile.csv", "%.4AXIS_X, %.4AXIS_Y, %.4AXIS_Z");
This will produce a probe file in CSV format like so:



1.0000, 2.0000, -1.4356
1.0100, 2.0000, -1.4343
1.0200, 2.0000, -1.4324
...

A format of "X%.4AXIS_X, Y%.4AXIS_Y, Z%.4AXIS_Z" would yield:



X1.0000, Y2.0000, Z-1.4356
X1.0100, Y2.0000, Z-1.4343
X1.0200, Y2.0000, Z-1.4324
...

A format of "X%.4AXIS_X\tY%.4AXIS_Y\tZ%.4AXIS_Z" would yield a tab delimited file:



X1.0000 Y2.0000 Z-1.4356
X1.0100 Y2.0000 Z-1.4343
X1.0200 Y2.0000 Z-1.4324
...

int mcCntlProbeFileClose(MINSTANCE inst); Closes the probe data file.


Clearly the XHC controller does not do this despite this document being openly published and no doubt NFS have this information
and would assist any manufacturer wanting to produce Mach4 ready hardware.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: mach4 probe operation
« Reply #3 on: November 25, 2018, 06:20:17 PM »
Hi Craig
Thanks for the reply  it is a shame I will see if XHC is willing to fix the problem it really is a great controller 
I want to retro fit some machines and they all use 24 volt relays and inputs so it just works really well as XHC is all 24 volt inputs and outputs and make life easy and the motion part seem to work really well and no problems there ay all so far

I have not got the spindle running yet it is a VFD and uses 0 to 10 volt  and a switching output I hope XHC has that part working   I will have that part working in the next few days if it does actually work
XHC is a very compact well packaged box if they refined the software it a bit more  it would be a huge success

regards Ray
P.S

I did look at all the model controlers you suggested in another post  and may have to go that way but they all are not a single package but have boards plugged into boards and all 0 to 5 volt an seem much more untidy and messy compared to XHC when doing a conversion it is nice to have single simple package and not bunches of cables  plugged inot a bunch of seperate boards each of which has to maounted seperatly as well


Re: mach4 probe operation
« Reply #4 on: November 25, 2018, 06:29:55 PM »
Hi,

Quote
I did look at all the model controlers you suggested in another post  and may have to go that way but they all are not a single package but have boards plugged into boards and all 0 to 5 volt an seem much more untidy and messy compared to XHC when doing a conversion it is nice to have single simple package and not bunches of cables  plugged inot a bunch of seperate boards each of which has to maounted seperatly as well

The HiCon is 24V but is of course quite expensive. The others require a breakout board of some description, that's true, but they have one advantage over
XHC products.....THEY WORK!.

Various customers have been hammering at XHC for months to get their act together and fix their plugin and have been offered technical support from NFS to secure
useable hardware....to no avail. On this evidence XHC don't care.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: mach4 probe operation
« Reply #5 on: November 25, 2018, 10:28:35 PM »
Hi
more issues  the outputs seems to  be I turn one output on and cant turn it of in the mach4 software until a second output it turned on then the first output that was commanded of will then turn of
Time to cut my losses I could have lived with out the probing but  need outputs that turn on and off when commanded
I think i read of some one else had this problem as well with the XHC

The forum also has a problem where i still can't search  for other problems people have had and this would be very convent at the moment so i can tell what other people problems are and more importantly what answers they got

Still i always say people who do not play with CNC  and computers  do not know what frustration is
Regards Ray
Re: mach4 probe operation
« Reply #6 on: November 26, 2018, 12:08:01 AM »
Hi,
while the Artsoft website is being remodeled the search function is on the blink.

I have stated on a number of occasions that XHC is rubbish for Mach4, unless XHC change the then comment
remains valid.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'