586,094 active members*
3,993 visitors online*
Register for free
Login
Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2009
    Posts
    14

    Turning on an Axis motor via gcode

    I want to experiment with treating my 4th axis as a rough lathe. I realize that the stepper motor is not designed to do this, but I read that it is possible (although there won't be a lot of RPMs or torque.) In doing so, I don't care what the coordinate is - i just want to turn the Z-axis on.

    Because gcode executes sequentially, it's not like I can tell it to rotate 10,000 times and then try to move the spindle in; it would do those two moves in order. So I need a way to turn on the Z motor, then ignore how many times the motor has spun (or moved, if you think about it as a wrapped X-Y item.)

    I know I can do this by modifying the wiring on the Z axis motor and putting a stepper driver in place, but that seems like overkill, since the PlanetCNC controller can already perform the electrical functions needed.

    Is there a code or a software switch that can just turn the motor on?

    Thanks in advance!

  2. #2
    Join Date
    Aug 2011
    Posts
    252

    Re: Turning on an Axis motor via gcode

    Quote Originally Posted by gnurph69 View Post
    Is there a code or a software switch that can just turn the motor on?
    How it can be? Your rotary axis is set in steps/degree.
    Also your driver that drive your stepper is in pulse/direction.

    If you want to behave as a lathe you need to think that axis will be your spindle, not rotary axis, and control the speed as a lathe spindle.

  3. #3
    Join Date
    Nov 2009
    Posts
    14

    Re: Turning on an Axis motor via gcode

    Easily - it already turns in 360 degree increments. I just want it to continue turning that direction until I tell it to stop. It can be done by putting a driver attached to the wiring to go one direction. I just don't want to have to do that if I don't have to.

  4. #4
    Join Date
    Aug 2011
    Posts
    252

    Re: Turning on an Axis motor via gcode

    You can read this to have an idea.
    https://forum.linuxcnc.org/10-advanc...on-about-index

  5. #5
    Join Date
    Mar 2017
    Posts
    1312

    Re: Turning on an Axis motor via gcode

    Spindle speed pin can generate steps. This is often used when servo motor is used for spindle. Some servo drivers also provide "virtual" encoder signal which is then used for synchronization.
    But this does not support positioning. If this is needed then you need to switch where step pin is connected and use script to toggle between "position" and "speed" state.

  6. #6
    Join Date
    Nov 2009
    Posts
    14

    Re: Turning on an Axis motor via gcode

    Positioning is not required, so no hardware change or script required, I believe. If I understand correctly, I need to identify the spindle speed pin and determine how to turn it on / off / control it, correct?

  7. #7
    Join Date
    Nov 2009
    Posts
    14

    Re: Turning on an Axis motor via gcode

    Positioning is not required, so no hardware change or script required, I believe. If I understand correctly, I need to identify the spindle speed pin and determine how to turn it on / off / control it, correct?

  8. #8
    Join Date
    Aug 2011
    Posts
    252

    Re: Turning on an Axis motor via gcode

    Quote Originally Posted by PlanetCNC View Post
    Spindle speed pin can generate steps. This is often used when servo motor is used for spindle. Some servo drivers also provide "virtual" encoder signal which is then used for synchronization.
    But this does not support positioning. If this is needed then you need to switch where step pin is connected and use script to toggle between "position" and "speed" state.
    It would be nice to have multiple spindles and then this can apply for all. Example turn with two spindles, mill-turn capabilities for 4 and 5 axis and so on. It is hard to accomplish such a thing?
    Like X and Y axis to have corresponding spindles S1 and S2 like Z have the spindle on it?

  9. #9
    Join Date
    Mar 2017
    Posts
    1312

    Re: Turning on an Axis motor via gcode


  10. #10
    Join Date
    Aug 2011
    Posts
    252

    Re: Turning on an Axis motor via gcode

    I meant 3 different ones, not on the z-axis all at once that do the same thing. As I said earlier, how is the one on the Z axis to be an option in PlanetCNC of 3 different spindles with 3 different outputs for the X axis and the Y axis independent of each other and with the option of having different names for programming like S for Z, S1 for X and S3 for Y, to be controlled individually.
    I'm not sure if I was explicit.

  11. #11
    Join Date
    Apr 2004
    Posts
    5737

    Re: Turning on an Axis motor via gcode

    If you're not trying to position the 4th axis, but just want it to spin constantly while the tool cuts it, you can set up a relay controlled by M-codes to turn it on and off. Don't think of it as a spindle or Z axis, but as an accessory, like a dust collector.
    Andrew Werby
    Website

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •