Hello Guest it is April 25, 2024, 01:29:42 PM

Author Topic: (Screen editing) How to link a gauge widget to an INPUT?  (Read 1138 times)

0 Members and 1 Guest are viewing this topic.

(Screen editing) How to link a gauge widget to an INPUT?
« on: April 13, 2022, 12:16:57 PM »
Clearpath servos provide a 0-5v output that is a measurement of how hard they are working, so I have 3 inputs assigned to them, and have created 3 gauge widgets on my screenset that I want to use to provide visual indications of axis load.

It isn't clear to me though how to assign a gauge to an input value.

Clicking on various widget properties, I found a drop-down list of ESS control lines, but that seems too low-level - I should be able to link to a Mach signal/value, one abstraction layer away.

So how is this done?

Offline jbuehn

*
  •  101 101
    • View Profile
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #1 on: April 13, 2022, 03:50:29 PM »
Never done this, but you can assign a register for the gauge value (in the screen editor).

Is your 0-5V from the servo connected to an analog input that is then mapped to a Mach4 analog input? In this post Steve talks a bit about the Mach4 analog inputs.

https://www.machsupport.com/forum/index.php?topic=43006.msg278800#msg278800
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #2 on: September 26, 2022, 06:49:21 PM »
OK, this turns out to be not quite right:

The output from the servo is a PWM value, where:

0% = 100% Torque LEFT
50% = no load
100% = 100% Torque RIGHT

So what I want is a 0-100 gauge that is torque in either direction.

First, that means reading a PWM signal on an input.

So how does one do that?
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #3 on: September 26, 2022, 09:38:43 PM »
Hi,
the output from the Clearpath is a PWM signal, which if filtered (resistor/capacitor) would be an analogue voltage from 0 to 5V.
The problem is now to turn that into a value that Mach can use as an input. You are thinking of digital inputs, ie on or off or equivalently 0V or 5V.....
not some in between voltage. Thus you will need a device like A PLC or similar that can convert that analogue voltage into a number, and that number
be recorded in one of Machs registers, and then Mach can use the register to drive the bar gauge.

May I suggest that you just use a cheap analog voltmeter and a resistor/capacitor filter to monitor the output voltage corresponding to the servo load just as a temporary experiment.
You'll find that the voltage is nearly 0V all the time, and only once in a while will it jump up to anything like full output. I suspect you'll come to the same conclusion
I did.....that servos just loaf along doing virtually nothing for hours on end with just the occasional blip.....so who bloody cares? There are things to worry about
but servo load is not one of them. Does it make sense to spend time and money (on ADC's in a PLC) to monitor something which is of very minor use?

Craig
« Last Edit: September 26, 2022, 09:40:30 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #4 on: September 26, 2022, 10:07:45 PM »
Hi,
the ESS does not have a, or in fact any, analogue inputs.

A 57CNC by PoKeys does however, about four analogue inputs.It is possible to have the ESS as your primary motion controller but use a second board like a PoKeys as a data input board.
In fact PoKeys made their name in data-input boards....and only later did they use then for CNC purposes.

Were you to use a PoKeys board it would be a secondary data input board, ie it would not be in realtime control of the axis motors. For example a home switch is and needs
to be hooked to the motion controller in realtime so it can respond instantly to a home event. The home switch must therefore be an ESS input because the axis motors
are controlled by the ESS. If you used a PoKeys input, PoKeys would detect the input, report back to Mach and then Mach would signal the ESS via the motion buffer to the axis motors.
The delays would be hundreds of milliseconds....way WAY WAY too slow to be a proper home switch.

Given that you just want a load monitor then using a PoKeys 57E for its ADC inputs would be worthwhile.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #5 on: September 28, 2022, 11:44:46 AM »
Hi,
the output from the Clearpath is a PWM signal, which if filtered (resistor/capacitor) would be an analogue voltage from 0 to 5V.

But if not filtered, is a PWM digital signal at either 45Hz or 482 Hz (user selectable).

The ESS can read a fast pulsed digital signal; it reads spindle speed/position triggers, rotary encoders, etc all the time. So it should be possible to read the current "speed" (in pulses per second, or pulses per time window if it is being polled at a known interval) and, knowing the PWM frequency, do a little math to convert that into a 0-100% value.

No ADC required.

 
Quote
You'll find that the voltage is nearly 0V all the time, and only once in a while will it jump up to anything like full output. I suspect you'll come to the same conclusion
I did.....that servos just loaf along doing virtually nothing for hours on end with just the occasional blip.....so who bloody cares?

Well in this case, because ClearPath is clever and encodes the left/right load into the single PWM signal, most of the time it should be at 50% PWM with blips towards either 0 or 100 depending on if the load is left/right.

But what I want to do is be able to monitor load on an axis, like this:

https://www.haascnc.com/content/dam/haascnc/service/guides/online-operators-manuals/mill-operators/mill_position_axis_display.png/jcr:content/renditions/original.original/image.png

Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #6 on: September 28, 2022, 04:09:06 PM »
Hi,

Quote
The ESS can read a fast pulsed digital signal; it reads spindle speed/position triggers, rotary encoders, etc all the time. So it should be possible to read the current "speed" (in pulses per second, or pulses per time window if it is being polled at a known interval) and, knowing the PWM frequency, do a little math to convert that into a 0-100% value.

No ADC required.

Good trick if you can pull it off. Remember that and ESS encoder or MPG input measures input pulse frequency, not duty cycle. Its not clear to me how you would contort the ESS
to measure duty cycle.

I had another idea as a workaround....an ESS can very happily produce an analogue voltage from a PWM input from Mach. If that voltage is in a closed loop
with an external comparator you could get a low bandwidth ( sub 1Hz) approximation of the Clearpath analog voltage.

Even if either of these techniques could be used to 'push' an ESS to a quasi analog input capability....is it really worth it? A PoKeys 57E is about 60GBP, if you want analog inputs
that would be cost effective, and so so much easier. Note that the 57E is the plain 'vanilla' PoKeys data input board and the 57CNC is an extension of the core 57E.

Quote
Well in this case, because ClearPath is clever and encodes the left/right load into the single PWM signal, most of the time it should be at 50% PWM with blips towards either 0 or 100 depending on if the load is left/right.

Well spotted, you are correct, the voltage will be 50% normally and only deviate from that at times of peak load. My Delta servo drives have two (programmable) analog outputs.
As a matter of interest I hooked a simple moving coil voltmeter to each output just to monitor servo load. It was as boring as hell, the servos operate at near 0% load for 99.99% of the time
and only occasionally blip up to a few %. I came to the conclusion that it was a wasted effort, I was not learning anything particularly useful about my machine. It was for this reason that
I suggested OP try hooking a simple voltmeter and filter to the Clearpath out just to see what happens. He may well come to the conclusion I did, ie that its just not that bloody
interesting.

It might be if you had a large highspeed production machine where you might expect moderately high and near continuous servo load would such metering be useful. With my hobby machine
my 750W servos operate at 50W or less, on average, for hours at a time.

That is not to say however that I could not or would not be interested in extending my machine to have several analog inputs. Monitoring spindle load, especially my high torque/low speed spindle I
use for steel and stainless, I can draw 1kW to 1.5kW for long periods of time, and that's with a servo based spindle motor rated at 1.8kW.
Another place I would like to monitor motor load would be my coolant pump. If the load drops really low, that would suggest the coolant is running low and the pump is cavitating and a high
load indicates that the coolant delivery pipe is getting blocked with micro-swarf. I seem to suffer both problem on a regular basis, and any system that would help me automate the response
would save me headaches. It would be quite nice to have a slider or two for FeedRate Override etc as well.

None of these reasons is compelling.....what I really want is another 750W Delta B2 servo for my fourth axis. The stepper with which it is equipped now works but is a slow as a wet
week. I want another servo...they kick arse. The problem is that while the servo kit is (or rather was....has the price gone up?) $438USD, plus DHL shipping, say $100USD for a total
of $540USD. The New Zealand dollar has slipped to just 57cents relative to the USD so the servo would cost me something like $950NZD, and then I should allow another 15%
for GST, the local NZ tax for a total of $1090.00NZD. I have the annual rates bill due in a couple of weeks......a man should probably pay the city rates bill BEFORE he spends money on his
hobby obsession!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #7 on: September 29, 2022, 09:49:05 PM »
Hi,
as far as I know Clearpath only have one output signal called HLFB. If that is the case are you using it to monitor servo load?

That I think is a mistake. One of the most important features of a servo is that it 'knows' if it gets to far behind its commanded position, called 'Following Error '.
If it does it will automatically shutdown.....but it needs to tell Mach that its done so so that Mach can Estop the machine so that all the servos stop. The last thing you want is
for the X axis to fault 'following error' and stop while the Y and Z axes carry on as if nothing happened.....CRASH!!!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #8 on: September 30, 2022, 01:45:05 AM »
i suggest you first connect yours servo by yours laptop with yours servo application( each servo have there application to remote the servo directly)
just to learn yours servo behavior
i tell this because when you will connect, you will see that the range that yours servo work its almost cant be monitor as you ask
for example we use 1000W servo and also we added external brake resistor ,even that you will see that yours servo load will jump from
0%  to 120% immediately while accl  and then another jump while deccl ...its not like you think some everange range working , if you  want follow yours servo load
2 options ,if to stop the machine as craig said by overload estop,if to follow yours motor or learn it better use yours servo software,or build rs485 application but only read the PWM by simple guge i think ...waste of time

Re: (Screen editing) How to link a gauge widget to an INPUT?
« Reply #9 on: September 30, 2022, 12:42:57 PM »
but it needs to tell Mach that its done so so that Mach can Estop the machine so that all the servos stop.

So... there is a certain wisdom in this recommendation; my lathe, which has closed-loop steppers, has the ALARM line from the stepper controllers wired to the ESS and code set up to do just this: ALARM goes high, machine ESTOP().

And I will probably - in fact, almost certainly - do just that.

But as the motors can be reconfigured between different HLFB behaviours fairly trivially, and code is just code, there's no reason why I cannot program a "change HLFB behaviour" button in Mach, and select between "HLFB = ALARM" and "HLFB = Torque load" modes, especially when testing new feeds/speeds/cutters and my hand can be near the estop mushroom.

(Yes, that HLFB mode button would not change the ClearPaths; I'd have to use the ClearPath USB app to change the mode on each motor as well)

So can we move on from the question of "IF it SHOULD be done", and get to the "HOW it CAN be done"?