Hello Guest it is March 29, 2024, 09:25:12 AM

Author Topic: Motor tuning  (Read 3078 times)

0 Members and 1 Guest are viewing this topic.

Motor tuning
« on: June 11, 2015, 03:03:18 PM »
I am trying to set up my machine so that there is very little to no user interaction within MACH4. The machine is a plasma tube cutter and I am treating the rotation about the tube as the Y axis and the length of the tube as the X axis. If a different type or size of material is loaded into the machine, I need to change the velocity and acceleration of the Y axis to match the proper material. I have a document that is being read in by MACH that contains the tube diameter and material type along with the proper motor tuning settings, but I need to be able to change the motor tuning programmatically (with lua or such). I dont want the user to have to go into the configuration or any additional settings. It all needs to be stupid simple. If there is a way to do it now, any help would be appreciated. If an SDK is required, please have any of the MACH 4 dev team pm me. My company really would like this feature with in our machine or something of similar nature.
Re: Motor tuning
« Reply #1 on: June 11, 2015, 03:17:21 PM »
Normally the maximum velocity and acceleration are configured based on the
capabilities of the machine, not the job at hand. Process variations such as you
describe are normally handled by feedrate (F word) commands in the G code
itself.
Steve Stallings
www.PMDX.com
Re: Motor tuning
« Reply #2 on: June 11, 2015, 03:21:23 PM »
I understand that the feedrate can be adjusted via GCode, however that adjusts for both X and Y axis, I need an adjustment for just the Y axis. The rotational speed of the material increases as the diameter of the material increases. The plasma torch requires a specific speed to perform a proper cut. I currently have the X axis tuned to the proper speed with feedrate and velocity and acceleration. I need a method to adjust the Y axis as needed per material. Any suggestions?

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Motor tuning
« Reply #3 on: June 11, 2015, 06:35:39 PM »
Sure, use CSS and Mach 4 Lathe instead.
fun times
Re: Motor tuning
« Reply #4 on: June 12, 2015, 12:26:32 AM »
I haven't done this in Mach4 yet.. But I have used this on pipe coping machines before and it shouldn't be hard to rewrite for mach4.  All the API calls should be straight forward to do this.


Code: [Select]
Diam = Param1() * 3.14159265358

'Position ' Heigth ' W ' H
Begin Dialog Dialog1 120,96,"Set Part Diameter"
OKButton 15,75,40,14
CancelButton 65,75,40,14
GroupBox 12,8,97,62,"Change Part Diameter",.GroupBox1
Text 32,24,70,12,"Current Part Diameter:"
Text 28,55,80,12,"Press OK to continue."
TextBox 30,35,60,12,.Width
End Dialog

StepsPerAxisY = 1960000 'Steps per rotary turn
KernalSpeed = 400000 'Mach3 Kernal Speed in ports and pins

CurStepsPer = GetParam("StepsPerAxisY")


If Diam < 0 Then
   Dim Dlg1 As Dialog1
   Dlg1.Width = Round(StepsPerAxisY / CurStepsPer/3.14159265358,8)
   Button = Dialog (Dlg1)
   Diam = Dlg1.Width*3.14159265358
End If

'If Button = 0 Then
'   DoOEMButton(1003)
'   Exit Sub
'Else

   NewPPR = StepsPerAxisY / Diam ' New Steps per for motor tuning
   NewVel = (KernalSpeed / NewPPR) * 60

   Call SetParam("VelocitiesY", (NewVel / 60))
   Call SetParam("StepsPerAxisY", NewPPR)

   'Message("Part width set... Scaling set to: " & Round(StepsPerAxisX / CurStepsPer,4))
'End If

'Must Reset To Update Mach Settings
If Not GetOEMLED(800) Then
   DoButton(21)
   Sleep(250)
End If

If GetOEMLED(800) Then
   DoButton(21)
End If
 
         

Andrew with MachMotion
Andrew
MachMotion

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Motor tuning
« Reply #5 on: June 12, 2015, 09:08:02 AM »
Here is a "Mach3" screen set that Terry did to map an "A" axis to "Y" for milling on a cylinder.

You could also probably convert that to Mach4 Lua script.

Scott
fun times
Re: Motor tuning
« Reply #6 on: June 12, 2015, 09:44:59 AM »
Awesome. Ill be giving a few of these things a try today. Thanks for the help everyone. Ill let you know how it turns out ^_^