Hello Guest it is March 29, 2024, 09:45:09 AM

Author Topic: Mach 3: Programmatic change to config  (Read 5136 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach 3: Programmatic change to config
« Reply #20 on: May 10, 2021, 10:18:29 AM »
test it vb script editor

Yes you are right! I made 2 macros through VB editor and indeed works. I do not know why did not work with buttons. Anyhow macros are good too! Thanks a lot

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach 3: Programmatic change to config
« Reply #21 on: May 10, 2021, 12:22:21 PM »
so if the instruction itselv is running in VB Script Editor, it must also run in button script.

just make sure that you have pressed ENTER after the instruction to have a empty line
under the code.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach 3: Programmatic change to config
« Reply #22 on: May 10, 2021, 01:03:35 PM »
so if the instruction itselv is running in VB Script Editor, it must also run in button script.

just make sure that you have pressed ENTER after the instruction to have a empty line
under the code.

Yes I believe that too. I must have overlooked something when I tried with the buttons. Was late at night so everything is possible :-). I will give it another try and see.

Thanks!
Re: Mach 3: Programmatic change to config
« Reply #23 on: May 10, 2021, 03:54:24 PM »
Hi,
the ESS has a larger and more powerful FPGA and so has a few features that the USS misses on.

You mention encoder threading and the ESS does that, but to my knowledge is supported in Mach4 only. You can use encoder
threading in Mach3 but it treats the encoder channel as a single pulse per rev input, that is to say, encoder threading offers no advantage
over index threading, at least in Mach3.

Related to encoder threading is spindle PID. When using an encoder and a conventional PWM spindle the PWM is adjusted to control
spindle speed with a PID loop. The loop has a low bandwidth velocity loop so cannot be used as a servo controller, but is quite an
improvement over the open loop situation. Note  this is a  feature that occurs in the Mach4 plugin only and to my knowledge there is
no plan by Warp9 to extend the Mach3 plugin to support spindle PID.

The USS does not have the noise immunity to do plasma, whereas the ESS supports hardware THC in both Mach3 and Mach4 plugins.

I have an AC servo as a spindle motor, and I can use it as a conventional PWM spindle OR a step/direction C axis for rigid tapping. I can
change back and forth programmatically with Mach4, whether the same programmatic switch can happen in Mach3  is doubtful, rather like
this multi-probe problem.

Overall I think the ESS is an advantage over the USS but you will not get the true benefits until you step up to Mach4.

The only feature that the UC300, aside from compatibility with UCCNC, is an analogue input that the ESS lacks.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach 3: Programmatic change to config
« Reply #24 on: May 10, 2021, 05:10:36 PM »
Hi,
the ESS has a larger and more powerful FPGA and so has a few features that the USS misses on.

You mention encoder threading and the ESS does that, but to my knowledge is supported in Mach4 only. You can use encoder
threading in Mach3 but it treats the encoder channel as a single pulse per rev input, that is to say, encoder threading offers no advantage
over index threading, at least in Mach3.

Related to encoder threading is spindle PID. When using an encoder and a conventional PWM spindle the PWM is adjusted to control
spindle speed with a PID loop. The loop has a low bandwidth velocity loop so cannot be used as a servo controller, but is quite an
improvement over the open loop situation. Note  this is a  feature that occurs in the Mach4 plugin only and to my knowledge there is
no plan by Warp9 to extend the Mach3 plugin to support spindle PID.

The USS does not have the noise immunity to do plasma, whereas the ESS supports hardware THC in both Mach3 and Mach4 plugins.

I have an AC servo as a spindle motor, and I can use it as a conventional PWM spindle OR a step/direction C axis for rigid tapping. I can
change back and forth programmatically with Mach4, whether the same programmatic switch can happen in Mach3  is doubtful, rather like
this multi-probe problem.

Overall I think the ESS is an advantage over the USS but you will not get the true benefits until you step up to Mach4.

The only feature that the UC300, aside from compatibility with UCCNC, is an analogue input that the ESS lacks.

Craig

Thanks a lot for the thoughtful answer. Appreciate.
yes, I know Mach4 offers better features, but I have done so much in Mach3 to make it like I wanted that makes me worry to move to Mach4 if I do not really need it.
Regarding the AC servo as spindle motor. I thought to drive it as step/dir all the time in the "step-less" that Mach3 offers. Would that be a problem and is it better to drive it as PWM? My current DC motor is driven in PWM so won't be too difficult to use the same for the AC. I just thought speed is better control in step/dir and indeed I have seen video of people rigid tapping by swapping the Spindle motor to C axis, just by using an Index input (1 per rev), but in that case I believe you trust on the inbuilt encoder spindle and it's power to don't slow down while threading or bye bye, something bad will happen since there is no real feedback on the spindle. Is this the case?

Regarding the UC300ETH, I have seen it has an analog port but does it mean that for instance it can create the 0-10V signal to drive a VFD without an additional board?
Re: Mach 3: Programmatic change to config
« Reply #25 on: May 10, 2021, 05:17:14 PM »
so if the instruction itselv is running in VB Script Editor, it must also run in button script.

just make sure that you have pressed ENTER after the instruction to have a empty line
under the code.

Hi,
So I have tried and indeed button works too, but in both of the cases the changes are applied to the probe input only after you access the ports and pins window and close it. Then a Estop is automatically triggered and the changes are applied. I have also tried to trigger the Estop manually but that doesn't help, so there is some kind of refresh cycle that it's automatically elicited when you close the ports and pins tab. Do you know if it's possible to trigger the same refresh cycle with a VB command? Thanks
Re: Mach 3: Programmatic change to config
« Reply #26 on: May 10, 2021, 08:58:55 PM »
Hi,
yes you can drive an AC servo with either step/direction OR PWM. In most circumstances there is little in it.

If your controller is providing an analogue voltage , ie PMW output, the servo drive closes its speed loop on that input voltage, thus any
speed reduction by virtue of changing load will be corrected by the servo drive feedback.

If your controller is outputting step/direction then the drive, using the servo encoder, closes the feedback loop.

Both methods result in the speed being controlled by a feedback loop....ergo no difference. Given that the spindle in Mach3, and incidentally Mach4,
is natively PWM it is easier to apply PWM than step/direction, although either is possible.

Step/Direction input allows you to have position control for an indexing spindle for instance, or C axis control for rigid tapping. Quite frankly I think
trying to get Mach3 to do a Caxis properly is going to be trouble.

Quote
Spindle motor to C axis, just by using an Index input (1 per rev), but in that case I believe you trust on the inbuilt encoder spindle and it's power to don't slow down while threading or bye bye, something bad will happen since there is no real feedback on the spindle. Is this the case?

That is a misunderstanding, the servo encoder is an INPUT into the servo drive and it is COMPARED to the step/direction input and the drive attempts to reduce the
error. That IS FEEDBACK, and its fundemental to the way AC servos operate. Thus an AC servo is in feedback control at all times, its just that you, or rather Mach,
does not control the feedback loop, it is enacted entirely by the servo drive. Should the load be such that the servo cannot keep up then the drive will alarm out
and stop. The feedback enacted by a modern servo drive on a matching servo is superb, better I would say, than any general purpose feedback controller can ever
manage. The manufacturer of a servo knows EXACTLY the best way to control it and makes their drives to PERFECTLY match the servo. If you think you can program
a PID loop better than a servo manufacturer then this is the wrong place for you!

Quote
Regarding the UC300ETH, I have seen it has an analog port but does it mean that for instance it can create the 0-10V signal to drive a VFD without an additional board?

This is a misunderstanding also. A controller, be it an ESS OR a UC300 can produce a PWM output signal which is filtered by an A-to-D converter on the BoB to produce an
analogue 0-10V signal. What a UC300 has is an analog input channel. The UC300 measures an analog input, say a voltage from a potentiometer say, and convert that into
a digital number which can be read and manipulated by Mach.

Quote
. Then a Estop is automatically triggered and the changes are applied. I have also tried to trigger the Estop manually but that doesn't help, so there is some kind of refresh cycle that it's automatically elicited when you close the ports and pins tab. Do you know if it's possible to trigger the same refresh cycle with a VB command? Thanks

This is part of the way Mach3 works, any change to the profile results in an Estop and must be manually restarted. Mach4 on the other hand can programmatically change settings in the
profile, with or without a save cycle, and carry on running. Mach4  and its Lua coding language is VASTLY superior when it comes to doing this sort of tricky-dicky  customisations.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach 3: Programmatic change to config
« Reply #27 on: May 11, 2021, 06:33:12 AM »
Quote
That is a misunderstanding, the servo encoder is an INPUT into the servo drive and it is COMPARED to the step/direction input and the drive attempts to reduce the
error. That IS FEEDBACK, and its fundemental to the way AC servos operate. Thus an AC servo is in feedback control at all times, its just that you, or rather Mach,
does not control the feedback loop, it is enacted entirely by the servo drive. Should the load be such that the servo cannot keep up then the drive will alarm out
and stop. The feedback enacted by a modern servo drive on a matching servo is superb, better I would say, than any general purpose feedback controller can ever
manage. The manufacturer of a servo knows EXACTLY the best way to control it and makes their drives to PERFECTLY match the servo. If you think you can program
a PID loop better than a servo manufacturer then this is the wrong place for you!

What I meant with "Spindle motor to C axis, just by using an Index input (1 per rev)" I was talking about the index input for the spindle revolution. I guess although you have a closed loop AC servo as spindle motor you still need at least an index input on the spindle itself to  try to rigid tapping and in that case you trust the good closed loop system from the servo to don't keep up with Z and do not loose power. Is it correct?


Quote
This is a misunderstanding also. A controller, be it an ESS OR a UC300 can produce a PWM output signal which is filtered by an A-to-D converter on the BoB to produce an
analogue 0-10V signal. What a UC300 has is an analog input channel. The UC300 measures an analog input, say a voltage from a potentiometer say, and convert that into
a digital number which can be read and manipulated by Mach.

Ok, thanks for the explanation. Had no idea this was possible.



Quote
This is part of the way Mach3 works, any change to the profile results in an Estop and must be manually restarted. Mach4 on the other hand can programmatically change settings in the
profile, with or without a save cycle, and carry on running. Mach4  and its Lua coding language is VASTLY superior when it comes to doing this sort of tricky-dicky  customisations.

That won't be a problem since I would switch the Active low probe input before start a probing operation. Anyhow I guess it's not possible to trigger the same "refresh" cycle by VB script. Not big of a deal. Was worth it a try.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach 3: Programmatic change to config
« Reply #28 on: May 11, 2021, 07:02:09 AM »
never tryed the  SetProbeState() in reality only found it in the attached file.

i do it with a Little Piece of Hardware.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach 3: Programmatic change to config
« Reply #29 on: May 11, 2021, 07:19:43 AM »
never tryed the  SetProbeState() in reality only found it in the attached file.

i do it with a Little Piece of Hardware.

No problem and thanks for the help.
The word files is really useful, thanks! I will have to start makikng a M6 macro for ATC carousel I am making. That will be quite a challenge  ;D