Hello Guest it is March 28, 2024, 01:43:44 PM

Author Topic: Mach3 macropump for spindlemotor  (Read 2021 times)

0 Members and 1 Guest are viewing this topic.

Mach3 macropump for spindlemotor
« on: October 08, 2020, 05:33:27 PM »
I use mach3 in combination with a Pokeys57CNC board. I want to control my spindlemotor with the PWM output of the Pokeys57CNC board.
I use a aircoled HF spidle which has a minimum speed of 8000 rpm.
I set up the VFD to start at 8000 rpm with a max. at 24000 rpm.
The VFD now want to have 0V for 8000 epm and 5V for 24000 rpm.
Mach3 with Pokeys57CNC give me 0 to 5V where 0V equals 0 rpm and 5V equals 24000 rpm.
To correct this I need to make a macropump which hold the output at 0V till 8000 rpm.
The DRO for the spindel speed is DRO 817, the corrected value can be any unused DRO, let's say DRO 500.
In my opinion the program has to copy the DRO 817 value and hold that to 0V until the speed goes over the 8000 rpm, from that moment upt to 24000 rpm 8000 has to be substracted from that value. The output then must be written into DRO 500.
Since I am absolutely not a software guy I don't know how to do this, can someone help me here?

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macropump for spindlemotor
« Reply #1 on: October 09, 2020, 06:23:30 AM »
i have no Experience with Pokeys.
is there a possibilty to map the PWM Signal to a DRO in the plugin Setup.
could not find a good Manual about pwm Setup in the plugin.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 macropump for spindlemotor
« Reply #2 on: October 09, 2020, 11:17:32 AM »
The PWM is already working, that is not the problem, just the output of Mach3 is, now it goes from 0V at 0 rpm up to 10V at 24000 rpm, I need to have it from 8000 rpm up to 24000. So 8000 rpm equals 0V and 24000 equals 10V. And I think it will be practical to save the rcalculated DRO somewhere else, I suggested DRO 500, but any unused DRO wil be OK.
Re: Mach3 macropump for spindlemotor
« Reply #3 on: October 09, 2020, 12:13:15 PM »
Where DRO817 is 8000 or less the new DRO should be 0, from 8000 and up to 24000 it must go linear to the max. If the max is 16000 I have no problem, Pokeys has a potentiometer to scale the output. So If DRO 817 is less than 8000 the output should stay at 0, from there on the new DRO should be DRO 817 - 8000.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macropump for spindlemotor
« Reply #4 on: October 09, 2020, 03:22:52 PM »
that is all clear, the entire question is, is it possible to map the analog Output to a "free" "custom" DRO, witch can be manipulated?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 macropump for spindlemotor
« Reply #5 on: October 09, 2020, 05:08:09 PM »
Yea, why not? Within Pokeys57CNC I can chose any DRO as input variable. In Mach3 it does not see to be a problem, at least not from my opinion. But be aware, me and sofware is not a good combination.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macropump for spindlemotor
« Reply #6 on: October 10, 2020, 02:56:20 AM »
so if you are able to set PWM Output to OEMDRO(1200) code for macropump would be:

Code: [Select]
If GetOEMDRO(817) <= 8000 then
   SetOEMDro(1200,0)
Else
   SetOEMDro(1200,GetOEMDro(817)-8000)
End If
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Mach3 macropump for spindlemotor
« Reply #7 on: October 10, 2020, 09:50:13 AM »
Thanks, from here on i hope to get it working.
Now i know how to do it in global way, for me it is just how to start.
Re: Mach3 macropump for spindlemotor
« Reply #8 on: October 11, 2020, 01:11:53 PM »
I tested it in real life, i changed DRO817 to DRO 202 in order to have spindel speed override working but in general, exept of a minor problem, it worked immediate.The small problem was that this line: SetOEMDro(1200,GetOEMDro(817)-8000) must be changed to SetOEMDro(1200,(GetOEMDro(817)-8000)) in order t get it working. The complete working code now is:

If GetOEMDRO(202) <= 8000 Then
   SetOEMDro(1200,0)
Else
   SetOEMDro(1200,(GetOEMDro(202)-8000))
End If

Thanks for the good help. This never had came to a good end without your help.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Mach3 macropump for spindlemotor
« Reply #9 on: October 12, 2020, 12:58:15 AM »
glad to hear, yout got it working. ;D
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.