Hello Guest it is November 18, 2019, 03:09:22 PM

Author Topic: Help controlling a stepper motor as a lowRPM spindle  (Read 17065 times)

0 Members and 1 Guest are viewing this topic.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #10 on: August 14, 2012, 04:58:41 PM »
Yes thats correct, well almost anyway. The almost is because your computer may call it LPT3 or LPT 10 or whatever Windows decides but that doesnt matter as all Mach is concerned about is the address of the port. As long as you enter the correct address it doesnt matter what Windows calls it :)
Hood
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #11 on: August 15, 2012, 08:10:12 AM »
Thanks Hood.
I am used to programming articulated arm industrial robots (ABB, Fanuc, Kawasaki), and when each point is taught, you get the option of how accurate you want to be at that point before moving to the next point. This can vary from exact position to up to 10mm, exact point is usually when the robot needs to do something (pick up a part, start a weld, etc.). You can open the accuracy of a position to allow continuous flow in the path moving from one position to another. I was writing some G code to give me a decreasing spiral path (0.25 per rotation) using the following lines (X starting at 0).

G2 X2 R1 F2
G2 X0.25 R0.75
G2 X1.75 R0.75
G2 X0.5 R0.5
G2 X1.5 R0.5
G2 X.75 R0.25

I'll stop here as you know I had a wierd looking spiral, but I can work on the positions. When I ran my wierd path, I noticed that it stopped at the end of every line, not for long, but as I am lasing a part, I do not want the laser to stop at one point for even that short time. Is there a function that allows the path to flow from one line to the next without a pause?

Barry.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #12 on: August 15, 2012, 08:36:00 AM »
You want to make sure you are in constant Velocity mode (G64)

The circular pocket wizard can be used to make spirals with a bit of trickery of stepover and cutter dia versus real cutter dia etc.
Hood
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #13 on: August 24, 2012, 02:14:15 PM »
Hi Hood,
I want to add an axis to position a rotary table, where a robot starts to laser harden a part. When the robot gives a 'Laser Complete' Input to the Mach 3, the table will rotate 60 degrees from '0', send a 'Table In Position' Output to the robot, and waits to rotate to the next position (120 degrees from '0') until the robot 'Laser Complete' input is given. Is there a macro that can have the program wait for the input? I have read up on some websites that say M66 is a macro to do this. My Mach 3 has a macro M66, but when I looked at it it has something to do with axis. Is there some code I can write for this?

Barry.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #14 on: August 24, 2012, 03:19:05 PM »
I presume you will have code with other motion and you are wanting to have a M code within that code to do as you say above. If that is the case then it would be easy enough to do, you would just open notepad and type in the script then save to your profiles macro folder. You would save it as something like m101.m1s so when you called M101 in your code that macro would be executed.
I am not the best at VB but something like  this may do


 Do
  ActivateSignal (OutPut1)
 If IsActive (Input1) Then Exit  Do
  Loop
  DeActivateSignal(OutPut1)
   Code "G91G0A60"
  While IsMoving()
  Wend
 Code"G90"
End

You would need to change the output and input numbers above if you were using different ones. Also you may already be working in incremental mode so if you were you wouldnt be wanting the G0 line at the end as that changes it to Absolute mode.

Hood

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #15 on: August 24, 2012, 03:19:58 PM »
Oh BTW any custom macros you do should be above 100 in number as numbers below 100 are reserved for Machs internal functions.

Hood
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #16 on: August 25, 2012, 09:48:28 AM »
Thanks Hood, I did know about the M numbering, I am using M101 - M106 to turn on outputs 1 thru 6, and M201 - M 206 to turn them off. I also use M200 to turn all outputs off together.
I hope you don't mind me picking your brain about all this, but I have had this unit for a month or so now and realising what a clever/powerful system this is. I have another question.

We want to have an additional axis (A), a future axis (B). I set up a motor/drive I had to axis A. I want it to act like one of my linear slides (inches), but when I jog it, the readout gives the position in degrees. Is there a way I can change it to a linear reading?

Barry.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #17 on: August 25, 2012, 10:45:48 AM »
Config menu then General Config and take the tick out of the A axis is angular.
Hood
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #18 on: August 25, 2012, 11:14:59 AM »
Thanks Hood, I guess I should have looked closer. I can jog it +/- of '0', but when I go to zero from a minus position it goes to zero, and if I am in a plus position and go to zero, it moves in plus and the speed increases to maximum. Any ideas? If you were located closer, I'd buy you a pint for all your help ;D

Barry.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #19 on: August 25, 2012, 11:24:58 AM »
Are you still talking about the A axis?
Attach your xml and I will have a look.
Hood