Hello Guest it is June 15, 2025, 08:45:07 PM

Author Topic: Mach4/ESS spindle/idexed c axis setup  (Read 5451 times)

0 Members and 1 Guest are viewing this topic.

Mach4/ESS spindle/idexed c axis setup
« on: January 02, 2025, 08:04:37 AM »
hello everyone. I'm having a lot of trouble finishing my project. as the title says, I work on Mach4 and ESS Smoothstepper. I managed to connect a servo motor to the spindle and now I have both the spindle and the indexed C axis on one motor. I am able to switch between them using a command


mc.mcAxisMapMotor

and it works perfectly. but the problem is that I need different motor settings (steps per unit, acceleration, etc.) for both. when I set the correct settings for the spindle, the C axis has the incorrect ones. Changing the engine parameters with a code 
 
 mc.mcMotorSetCountsPerUnit

would solve the problem after the

 mc.mcAxisMapMotor

command but it only works once and you cannot return to the previous settings. I also cannot assign the same pins to 2 motors and assign them to specific axes interchangeably. then everyone would have their own settings and that would solve the problem

Offline smurph

*
  • *
  •  1,574 1,574
  • "That there... that's an RV."
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #1 on: January 08, 2025, 06:04:06 PM »
Simply save the spindle motor parameters first, say in the screen startup script.  mc.mcMotorGetCountsPerUnit(), etc...  Then you can do the mcAxisMapMotor() and mcMotorSetCountsPerUnit when you want to use C.  Then swap back to the spindle settings when you are done with C. 

Steve
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #2 on: January 08, 2025, 06:15:19 PM »
Simply save the spindle motor parameters first, say in the screen startup script.  mc.mcMotorGetCountsPerUnit(), etc...  Then you can do the mcAxisMapMotor() and mcMotorSetCountsPerUnit when you want to use C.  Then swap back to the spindle settings when you are done with C. 

Steve

You're right. I tried this before. and it actually works, but only once when I change the steps per unit. another change is only possible after restarting the program.

Offline smurph

*
  • *
  •  1,574 1,574
  • "That there... that's an RV."
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #3 on: January 09, 2025, 02:06:45 AM »
If you change the counts per unit back they don't stick?  Are you running a step/direction controlled spindle?  And what do you mean by "pins" when you said "I also cannot assign the same pins to 2 motors and assign them to specific axes interchangeably. then everyone would have their own settings and that would solve the problem" ?

Do you have script examples?  What build of Mach? 

Steve
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #4 on: January 09, 2025, 03:54:36 AM »
If you change the counts per unit back they don't stick?  Are you running a step/direction controlled spindle?  And what do you mean by "pins" when you said "I also cannot assign the same pins to 2 motors and assign them to specific axes interchangeably. then everyone would have their own settings and that would solve the problem" ?

Do you have script examples?  What build of Mach? 

Steve

I using AC servo moror as spindle.(Step/dir). It has 10000/rev encoder. When using as spindle everything is ok. Max rpm 3000 ( 1:1 pulleys). When using as CAxis must set 27.777 counts/rev. (10000/360°). I cant use electronic gear ratio in servo controller. I attach spindle motor as motor 5 with 10000counts/ rev settings as spindle motor, and motor 2 with 27.777 counts as C axis motor. To control them i cange motors by using m.mcAxisMapMotor command and mannualy assign output pins(step/dir signal) in ESS controller output tab to the specific motor. (Dont must restart mach4) When i change counts per unit by script it changing once and cant change back to the native settings. Until restart mach4. Mach4 ver 4809 and ess plugin 285. I want to change settings by using screen button settings. I know how to do this but i cant find solution to the motor settings.
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #6 on: January 09, 2025, 07:09:58 AM »
You may want to check this setup:
https://www.cnc4pc.com/blog/post/mach4-lathe-using-the-ethernet-smooth-stepper-and-the-c82-breakout-board
https://www.cnc4pc.com/blog/post/configure-an-step-and-direction-servo-as-spindle-on-mach4-using-the-ethernet-smooth-stepper-and-c82

Arturo Duncan
https://cnc4pc.com

That is hardwate solution of this problem. Im looking for software solution. I hope that is any way to do this by using script. I dont want to rebuild driver and connections.

Offline smurph

*
  • *
  •  1,574 1,574
  • "That there... that's an RV."
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #7 on: January 14, 2025, 05:47:12 PM »
If you change the counts per unit back they don't stick?  Are you running a step/direction controlled spindle?  And what do you mean by "pins" when you said "I also cannot assign the same pins to 2 motors and assign them to specific axes interchangeably. then everyone would have their own settings and that would solve the problem" ?

Do you have script examples?  What build of Mach? 

Steve

I using AC servo moror as spindle.(Step/dir). It has 10000/rev encoder. When using as spindle everything is ok. Max rpm 3000 ( 1:1 pulleys). When using as CAxis must set 27.777 counts/rev. (10000/360°). I cant use electronic gear ratio in servo controller. I attach spindle motor as motor 5 with 10000counts/ rev settings as spindle motor, and motor 2 with 27.777 counts as C axis motor. To control them i cange motors by using m.mcAxisMapMotor command and mannualy assign output pins(step/dir signal) in ESS controller output tab to the specific motor. (Dont must restart mach4) When i change counts per unit by script it changing once and cant change back to the native settings. Until restart mach4. Mach4 ver 4809 and ess plugin 285. I want to change settings by using screen button settings. I know how to do this but i cant find solution to the motor settings.

I'm trying to figure how you are driving your spindle with step/dir.  Are you setting the "Sep/Dir Spindle Axis" setting to OB1-OB6? 

Steve
Re: Mach4/ESS spindle/idexed c axis setup
« Reply #8 on: January 14, 2025, 06:28:19 PM »
If you change the counts per unit back they don't stick?  Are you running a step/direction controlled spindle?  And what do you mean by "pins" when you said "I also cannot assign the same pins to 2 motors and assign them to specific axes interchangeably. then everyone would have their own settings and that would solve the problem" ?

Do you have script examples?  What build of Mach? 

Steve

I using AC servo moror as spindle.(Step/dir). It has 10000/rev encoder. When using as spindle everything is ok. Max rpm 3000 ( 1:1 pulleys). When using as CAxis must set 27.777 counts/rev. (10000/360°). I cant use electronic gear ratio in servo controller. I attach spindle motor as motor 5 with 10000counts/ rev settings as spindle motor, and motor 2 with 27.777 counts as C axis motor. To control them i cange motors by using m.mcAxisMapMotor command and mannualy assign output pins(step/dir signal) in ESS controller output tab to the specific motor. (Dont must restart mach4) When i change counts per unit by script it changing once and cant change back to the native settings. Until restart mach4. Mach4 ver 4809 and ess plugin 285. I want to change settings by using screen button settings. I know how to do this but i cant find solution to the motor settings.

I'm trying to figure how you are driving your spindle with step/dir.  Are you setting the "Sep/Dir Spindle Axis" setting to OB1-OB6? 

Steve
exactly. servo motor with 17-bit absolute encoder. connected and described as motor5 and assigned to the OB1 axis.