Hello Guest it is November 21, 2019, 06:30:11 PM

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

0 Members and 1 Guest are viewing this topic.

Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #30 on: August 27, 2012, 03:20:15 PM »
Works nicely, thanks Hood

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #31 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
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #32 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.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #33 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
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #34 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.

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #35 on: August 28, 2012, 11:15:27 AM »
Sounds like you are having fun :)
Hood
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #36 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

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #37 on: August 28, 2012, 04:35:58 PM »
If its just jogging then it could be the Jog Control switched off.
Hood
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #38 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.
Re: Help controlling a stepper motor as a lowRPM spindle
« Reply #39 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