Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Bazzer on August 14, 2012, 09:14:55 AM

Title: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 14, 2012, 09:14:55 AM
Hi, I have been using what used to be a CNC Router, and am using it to hold a Laser head to do some marking. I needed to add a spindle (chuck) as I have some parts that I need to spin at no more than 30 RPM. Rather than going out and purchasing a VFC/Motor to drive the spindle, I started experimenting by temporarily using my Y axis motor (disconnected from the axis itself). I set up the parameters for the spindle according to the instruction manual, but so far have ended up with the motor running too fast, too slow, too hot. I just can't seem to get the right parameters to make it run the speed I need. Here is what I have.

Stepper Motor - 4 wire, 2 phase, 1.8 degree step angle, 3 amp, 3.6v
Motor Drive = 2 Phase, 2000 pulse/rev, 3 amp current set, half current mode set.
Pulley ratio, 2 motor rev = 1 spindle rev

I would be so grateful if someone could suggest the base parameters for the Motor Tuning and the Spindle Pulley settings, as I have tried so many combinations, I don't know what to adjust any more.

Cheers.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 14, 2012, 09:52:11 AM
From the above it would seem your stepper drive is set to 10 microsteps thus the 2000 steps per rev, as you have it geared 2:1 then the steps per unit for the spindle would be 4000. Your Velocity would be what you want the max rpm to be (maybe 50?). Acceleration will be lowish try 1 and see how it goes, setting to that would mean the spindle would take 1/2 second to get to your 30rpm.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 14, 2012, 10:46:00 AM
Thanks Hood, I tried all combinations of steps per rev EXCEPT 4000. I tried that and it seems to work nicely. The motor is still a little warm, but that could be because of the crazy values I have been entering trying to get my result.

Thanks again (not Scottish by any chance?)
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 14, 2012, 10:48:24 AM
Sorry, I now see you are from Canoustie... definitely Scottish  ;D
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 14, 2012, 11:00:46 AM
Thanks again (not Scottish by any chance?)

Yes I certainly was the last time I looked ;D

Steppers  get hot, just as long as they dont burn you when you touch them they should be fine.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 14, 2012, 11:28:40 AM
I think it was hot from the previous test(s) I had made. I shut it down for a while and ran the new settings and it has maintained a 'warm' temperature.
While I am on the subject of now adding this spindle and ordering a Drive and Motor for my Y axis, I have another question if you don't mind. The 25 pin Breakout Board I have left me with enough pins to control 5 outputs (no inputs) I need. Now that I need 2 pins to control the spindle, this leaves me 1 short of available pins. I looked everywhere on the web to look at the 9 pin (port 2) pin out, but can't find one. I (think) I am using all of my available pins on the 25 pin when I have the following assignments:

X axis - 2, 3
Y axis - 4, 5
Z axis - 6, 7
Emergency Stop -10
O/P 1 - 1
O/P 2 - 8
O/P 3 - 9
O/P 4 - 14
O/P 5 - 16
O/P 6 - 17
Ground 18 - 25

What about pins 11, 12 and 13?

Cheers.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 14, 2012, 01:16:35 PM
1-9, 14,16, 17 are outputs
10,11, 12, 13 and 15 are inputs.
If you require more then you could add a second parallel port and you can either have it set the same as port 1 or you could have pins 2-9 configured as inputs. That would mean 2-13 and 15 would be inputs and 1, 14, 16 and 17 outputs.

What are you using all the ouptuts (1-6) for?


Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 14, 2012, 02:21:23 PM
When I said in my original mail it was for Laser Marking, I did not explain that is also used for Laser Cladding. The Laser System we have for Cladding requires 5 outputs for 'Laser Ready', 'Laser On', 'Shield Gas On', 'Powder #1 On', and 'Powder #2 On'. I need these 5 outputs for the system leaving me Output 6 as spare, but I am contemplating joining 'Laser Ready' and 'Laser On' as they can come on at the same time. I don't like the idea of having no spare outputs for future use which is why I asked about Port 2. I don't quite understand when you talk about a second 25 pin port and configuring the I/O the way you say, I doubt whether I will ever use inputs, for now anyway.

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 14, 2012, 02:55:17 PM
It is an option for port 2 that you can either have it the same as port 1 (12 Outputs, 5 Inputs) or if you require more inputs it can be configured so pins 2-9 become inputs, that would mean you have 4 Outputs and 13 Inputs.
As you are requiring more outputs than you will need in inputs then leaving it as standard would be the best way.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 14, 2012, 03:42:42 PM
Thanks Hood, now I understand. Port 2 will be Port LPT2 on my computer, another 25 pin port that I can use like Port 1, but addressing the outputs as pin # and port #2.

From an Englishman in Canada to a Scotsman, I thank you for your help.

Cheers.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood 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
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer 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.

Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood 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
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer 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.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood 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
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood 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
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer 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.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood 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
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer 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.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood 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
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 25, 2012, 11:34:21 AM
Yes it is the A axis.
Not sure how to get the xml file, I will have to do it on Monday as I am only working until 11:30 (16:30 your time). I will grab what I can and send it then.

Thanks Hood, Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 25, 2012, 01:34:34 PM
Open Mach and lower right you should see the name of the profile you are using.
Go to your Mach3 folder and find a file of that name with a xml extension. Copy it to your desktop and rename it to Bazzer.xml then use the additional options button on the reply page to attach it.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 26, 2012, 03:41:26 AM
Was messing with something else for myself and thought about this post. The macro I posted earlier wouldnt work properly, code wouldnt wait until it was finished but this should work, the trigger for the macro doing what you want would be the Cycle Start Led, also the sleep dropped my CPU % from 40% down to 0-1%. (I thought the sleeps were automatic now but not in the version I am using iot would seem)

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

Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 27, 2012, 07:45:01 AM
Hi Hood, thanks for that macro. I have attached the xml file for my laser.
Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 27, 2012, 08:35:43 AM
Are you using the parallel port or an external controller?
If you are using the parallel port then your motors are tuned to fast for the kernel, you will have to increase the kernel. Do that and restart Mach and see if you still have the issue.
BTW you have the A set as rotational.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 27, 2012, 09:47:45 AM
After a little playing around (still not right) I found the following.

When I am using axis A as linear:
Plus and minus positions are displayed when I jog plus and minus (correct).
From a minus position it moves positive to 0 when I send it to zero (correct).
From a positive position, it moves positive, gaining speed, and stops at +360 (not correct)

When I am using axis A as Angular:
From 0 position the count goes positive when I jog plus (correct).
From 0 position the count starts from positive 360 counting down.

Something I notice on the screen is that the box to the right of the position display never moves from 'RADIUS CORRECT'. Should it change to 'SCALE +1.000' like the other axis XYZ?
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 27, 2012, 10:46:38 AM
Trying again with the right xml file.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 27, 2012, 01:54:40 PM
Seems to be working fine here with your xml
I opened the jog screen (tab key) and jogged 4th and it acted like it should, constant speed and went past 360.

Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 27, 2012, 02:24:59 PM
I used my hotkeys to jog, fine in both directions. It's when I send the axis to zero I hit the problems, from a minus position it goes to zero fine. From a plus position it wants to run away at speed to plus 360  ???

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 27, 2012, 03:04:27 PM
Ok go to General Config and uncheck Rotational Rollover.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 27, 2012, 03:20:15 PM
Works nicely, thanks Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 27, 2012, 03:23:13 PM
No probs.
Not sure why it affects things as really it shouldnt if the axis is set as linear but.... well it seems to ;D
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 28, 2012, 09:45:27 AM
Was messing with something else for myself and thought about this post. The macro I posted earlier wouldnt work properly, code wouldnt wait until it was finished but this should work, the trigger for the macro doing what you want would be the Cycle Start Led, also the sleep dropped my CPU % from 40% down to 0-1%. (I thought the sleeps were automatic now but not in the version I am using iot would seem)

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

Hood

Hood, is this the only code/macro I need to run for the following process?

1. Axis A at 0, robot starts to lase part 1.
2. Robot finishes lasing part 1, moves to Clear Position, send input to Mach3 to move axis A 60 degrees.
3. When at 60 degrees, Mach3 sends input to robot Move Complete
4. Robot starts to lase part 2.
5. Robot finishes lasing part 2, moves to Clear Position, send input to Mach3 to move axis A 60 degrees (now 120 degrees from 0) to position3.

Steps 3, 4 and 5 are repeated 3 more times to Part 4 (180 degrees from 0), Part 5 (240 degrees), part 6 (300 degrees).

The robot will stop at the end of part 6, and the A axis will be returned to 0 for the next batch.

Ideally all I want the Mach3 to do is move to a position and sit idol waiting for the input to go to the next position. I dont mind writing a small macro to wait for the input, and then use code to send it to the next position.

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 28, 2012, 10:22:50 AM
That macro was simply to send a signal to the laser to start and wait for a signal from the laser to say its done then rotate the A 60 degrees and then hand things back to Mach.
So basically you could have the initial A0 in code then run the macro then again then again.....
You could also I suppose just add to the macro by repeating the code as many times as you wanted.
The A Axis move in the macro is an incremental move so it will move 60 degrees from wherever it is so if at 0 will go to 60, if run again it would go another 60 so 120, if run again 180 etc etc.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 28, 2012, 10:43:34 AM
Thanks Hood, my reasoning for the posts over the past couple of days are because all of a sudden my simple 3 axis machine went to:

A 3 axis with spindle (speed but no position control)
A 3 axis with A axis (rotating acting like linear with position control)
A 3 axis with A axis and B axis (angular)
And now a 3 axis with A, B, and C (angular) with a possible spindle :o

I have been asking the questions to cover all my bases for when we decide which way we want to go.

Thanks again, Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 28, 2012, 11:15:27 AM
Sounds like you are having fun :)
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 28, 2012, 03:29:16 PM
I was having fun up to now Hood. So I get my axis A working from the jog and go to zero buttons, so now I go to calibrate it. I can go into the teach mode and type in

G0A50F10

And away she goes. I go into the Settings screen and calibrate the axis A. I tell it to go 1, enter, it doesn't move. Then asks me how far it went, I say 0, and it tells me I cant have 0. I tried all my other axis XYZ as I have before, now they won't go either. Ideas
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 28, 2012, 04:35:58 PM
If its just jogging then it could be the Jog Control switched off.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 07:15:18 AM
Good morning Hood, would the jogging being turned off stop the axis calibration? I can't remember turning it off anywhere, where do I turn it on?
Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Overloaded on August 29, 2012, 07:30:11 AM
Hi Barry, till Hood gets back to ya, are any of the Axis Inhibits selected on the Settings screen ?
Russ
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 07:36:14 AM
Hi Russ,
Only axis B & C are green. Now I have lost the ability to jog XYZ or A from my keypad. I have never had that problem before.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 08:31:23 AM
Hi Guys, I loaded up another Machmill job, and when I tried to jog the axis, the axis never physically moved, but the display increased and decreased in value for the axis I was jogging. I have gone back to my job and still have a problem with not being able to jog. I ran a G code program I have used previously and it ran fine. Just no jogging from the keypad.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 29, 2012, 08:52:17 AM
Jog control as in pic needs to be active (green LED round it like below)
Hoo
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 09:18:56 AM
Hi guys, sorry to mess you around, but I see the jog on/off in the Tool Information screen, I turned it on, now it is OK for jogging and axis calibration. I have a situation with my Z axis calibration though. I am driving the axis through a 10:1 gearbox, which put my pulses/unit to around 109,000. When I jog the axis an inch, it moves an inch and the display says 1 inch. If I try to calibrate it and I send it 1 inch, the motor sounds high pitch, the axis barely moves, yet the display reads 1 inch. I put in a code to send the Z axis to 5 inches at F10, again the motor went high pitch, the axis hardly moved, and the display read a move of 5 inches. Any ideas?
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 11:00:23 AM
Hi Hood. I can jog the Z axis at quite a decent speed .05 inch/sec when my low jog speed id set at 75%. Any higher and it acts the same as when I try to make a commanded move. The motor seems to stall but the positional counts increment. I was think that the rpm of the motor was too fast for these moves, but it does the same when I put my speed at 0.02. When I jog on the keyboard, the speed is faster than I will ever need, so I don't understand about the F0.02 giving me a problem.

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 12:00:20 PM
Hi Hood,
I was testing the Z axis position from code with the code I got from the wizard for the spiral I wanted to do. I decided to do another code I had been working with earlier and move the Z axis in that. It worked fine unless I put the Feedrate greater than 10 IPM. I will never need the Z axis to go faster than that so it should not be an issue.

The code from the wizard included the lines before the Z move:
G0 G49 G40 G17 G80 G50 G90
G64
G20
G0Z1F0.2
M30

Is there anything in that code that would have affected it?

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 29, 2012, 01:15:14 PM
G0Z1F0.2 is not a valid command really as G0 is rapid speed so no matter what the F word is it will not take any notice of it.
Sounds like you just have your Velocity in Motor Tuning set too high.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 29, 2012, 01:36:25 PM
Thanks Hood, I thought G0 and G1 were the robot equivalents of Robot moves and Linear moves. A Robot move moves all 6 axis from one position to the next at the same time and the speed that they move can be set (how fast you want to get from one position to the next). In Linear move it keeps the Tool Centre Point along a straight path at a set speed of travel. I didn't know (now I do) that G0 moved all axis at maximum speed.

Thanks again.
Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 31, 2012, 02:44:15 PM
Hi Hood,
I am using a rotary positioner like a linear axis, I wait for robot complete, Mach 3 rotates to 0.03" (60 degrees) waits for robot complete, moves 0.06" (120 degrees) etc for the next moves to 300 degrees. Other than sending my axis back to 0 to start over, is there a code to set any individual or all axis to 0?

Thanks, Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 31, 2012, 02:53:25 PM
Is there a reason you are setting it linear rather than rotary?

You can set the machine coords to zero by homing and as long as you do not have a home switch it will zero wherever you call the home from.You can do that by button or macro by calling
DoOemButton (1025)

Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on August 31, 2012, 03:22:49 PM
I wrote that line of code DoOemButton (1025) in VB and saved it in my Macro file as M210. Is there something else I need to do in the software to define the OEM's?

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on August 31, 2012, 04:03:51 PM
Sorry not sure what you are asking.
Is it not zeroing the machine coords for A when you call M210?
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 04, 2012, 07:23:09 AM
Good morning Hood,
Maybe I forgot to mention it was the Z axis I was using. I am expecting the motor/drive for my A axis later today, I was using my Z axis for testing purposes. I guess that there is a different number than 1025 for the Z axis zero then?

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 04, 2012, 07:26:22 AM
Yes 1024 is Z
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 04, 2012, 07:52:31 AM
I tried 1024, but it still doesn't zero out when I run M210  ???
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 04, 2012, 08:39:16 AM
Hi Hood,
Sorry, I see I didn't answer your earlier question as to why I am using it linear instead of rotary.
I am using my current Z axis because I wanted to make sure I have the available Horse Power to drive my positioner. I have a 10:1 gearbox on my Z axis, and am putting the same on my positioner. I just kept it as my Z axis so I don't have to change the settings when I put it back. I am expecting the new motor/gearbox/drive sometime today and will make that my A axis. I am still having a problem with referencing my Z axis from my M210 macro though (DoOEMButton (1024) ).

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 04, 2012, 11:41:09 AM
Hi Hood, all is working fine. It turns out I was putting it into the Macro file of my backup XML file  ::)
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 04, 2012, 02:24:14 PM
Hi Hood,
Now that I have my Macro working, I notice that when I run it, the DRO for the Z axis displays 0.0057. I put the Y axis zero 1023 in the same macro, and the DRO displays 0.0000. Any idea why my Z axis won't do the same? I need to reference my axis at 0 at its last position. The 0.0057 multiplies and puts my positions out every time I run my M210 macro.

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 04, 2012, 02:29:56 PM
Is this machine coords? Maybe you are looking at work coords and have an offset set. If you are run the macro and then press the zero button and it should be fine after that, If not and it is machine coords you are looking at then maybe you have a Home Off value set for Z in the Homing setup page.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 04, 2012, 03:55:19 PM
Yes you are correct Hood, I was looking in the wrong coordinates. Thanks.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 10, 2012, 01:54:45 PM
Hi Hood,
Hoping you could help me with a little problem I am having with a bit of code I wrote. Up to now I have not bothered with the switching of Output #7 as I have only wired it in today. The code I did was to set the output #7, wait for input #1, reset output #7, then move 60 degrees at a feedrate of 10000, and call it Macro M211. When I have been running the program, it runs fine and waits for input #1. Now that I have the output #7 configured (port 2 pin 1) and wired, I don't see it turning on and off. If I go into my Ports and Pins Output config, I can set it by making it low active, so I know it is configured and wired OK.

My M211 Macro looks like this:

ActivateSignal (OUTPUT7)
SystemWaitFor (INPUT1)
DeactivateSignal (OUTPUT7)
Code "G91G1A60F10000"

My program code is:

M211
G4P2
M211
G4P2
M211
G4P2
M211
G4P2
M211
G4P2
M211
G4P2
M30

This rotates my fixture a total of 360 degrees (6 x 60 degrees)

Thanks, Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 10, 2012, 03:44:32 PM
Try changing the active state of Input 1 and see if it makes a difference.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 11, 2012, 12:57:38 PM
No difference Hood. I separated the 4 lines of code to 4 Macros, put them in sequence in the program, and it works like a charm.

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: BR549 on September 11, 2012, 01:16:33 PM
May want to try it this way to see IF it makes a difference


ActivateSignal (OUTPUT7)
While Ismoving()
Wend
SystemWaitFor (INPUT1)
DeactivateSignal (OUTPUT7)
While Ismoving()
Wend
Code "G91G1A60F10000"
While Ismoving()
Wend

Just a thought, (;-) TP
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 11, 2012, 03:17:29 PM
If Terrys way doesnt work here is how I would do it, I like my Do Loops ;)

If Not IsActive(Input1) Then
 Do                                       
 ActivateSignal(OutPut7)                 
 If IsActive(Input1) Then Exit Do 
 sleep 10         
 Loop
 DeActivateSignal(OutPut7)
 End If
 Code "G91G1A60F10000"

Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 11, 2012, 03:23:58 PM
Thanks Hood and Terry.
I am finishing work now (trying to catch the second half of the England/Ukraine game). I will try those codes tomorrow and let you know how I get on.

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 12, 2012, 10:27:16 AM
I tried both codes, and they both work great  ;D Thanks to both Hood and Terry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 12, 2012, 10:42:59 AM
Ha ha well you now have a choice depending on the mood you are in  ;D
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 12, 2012, 10:54:41 AM
As I have to repeat the code 5 times per cycle,  :-\ out of respect for both you guys my code will now look a little something like this:

M215 (Hood)
M216 (Terry)
M215 (Hood)
M216 (Terry)
M215 (Hood)
M47

Barry  ;D
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 12, 2012, 03:03:45 PM
;D

Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 12, 2012, 03:29:39 PM
And in respect to a certain tennis player:

M215 (Hood)
M216 (Terry)
M215 (Hood)
M216 (Terry)
M215 (Hood)
M47 (Andy Murray return and keep on going)

 :D
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 13, 2012, 03:08:08 AM
Ha ha, he seems to be on top form at the moment for sure, Olympic Gold and now the US Open wonder if he can do Wimbledon next year.
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 24, 2012, 03:48:02 PM
Hood,
I have been reading some comments on the forum about Constant Speed of a Spindle RPM and the feed rate of of an axis. One of the Administrators put up some code that I tried but do not see a difference in the spindle RPM when I run it. The code is basically

G96S20M3
G95
G01X10Z0.5F0.03 (feed 10" @ 0.03"/min)
G97S10M3
G01X0Z0F10
M5
M30

Is there anything you can see that I am doing wrong? I have not touched any settings in my Configuration, is there something I need to set?

Barry.
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Hood on September 24, 2012, 04:15:36 PM
CSS doesnt work correctly and never will iun Mach3, Mach4 I am assured will.
Having said that the spindle should increase/decrease with the dia, it is the feedrate of the axis which is not correct as Mach basically keeps a constant feedrate with respect to time rather than with respect to rpm (When in G95)
Where is your axis starting from when you are in CSS?
Could it be you are at max revs when yu are calling the G96?
Hood
Title: Re: Help controlling a stepper motor as a lowRPM spindle
Post by: Bazzer on September 25, 2012, 08:34:39 AM
Hi Hood,
Here is what I am trying to do.
I have a round bar that I need to put on a bead of weld along the length. The bar can vary in diameter and length (between 0.5" - 1.5" diameter and 3" - 24" in length). Up to now we have never had an issue, as the calculation is based on a surface speed length of 59 ipm. The calculations for the different diameters is relatively easy, and I have created an Excel form that spits out the RPM for the spindle. I now have a part that is tapered, and is 0.5" at  the small end, getting to 1.25" at the large end over a length of 8". I wrote a program that started at 0 at the small end of the part, and made the appropriate moves in the -X and +Z direction to get me to the large diameter end of the part. I then had to split up my G01 moves, and insert a new spindle speed based on the diameter at that point. As I split it up 5 times, there is a noticeable thickness change in the part at each point I changed speed, and I know the more I split it up, the smoother the part.
As my boss wants a completely (or smoother) finish, I looked into the CSS function and have tried a sample I read on the forum. The one I sent you runs at the X-10" at F0.03 without changing the spindle speed. I have deliberately left out the Z moves to avoid confusion, and I did set my G48 max speed to S100 ( I never should have to get to that speed, 30 RPM is usually the fastest). Is there something I'm not doing right?

Thanks, Barry.