Hello Guest it is March 28, 2024, 10:20:40 PM

Author Topic: need help with a axis control as both a spindle and an axis  (Read 725 times)

0 Members and 1 Guest are viewing this topic.

need help with a axis control as both a spindle and an axis
« on: February 22, 2021, 10:48:05 AM »
I am having a really hard time getting smooth motion control out of my a axis, and I think that I should probably use it as a spindle for part of the operation. However, I need to keep track of its absolute position, and be able to return to zero after running it as a spindle.
Using it as an OB axis may be a possibility, but I need to be able to continuously control its speed during other axis moves.
 
I don't need to know its exact position during the operation, but after each cycle it has to be able to return to its original position.

Is swapaxis still a thing with Mach4? I couldn't find it in the CoreAPI file.

Any ideas?
Thanks!
Re: need help with a axis control as both a spindle and an axis
« Reply #1 on: February 24, 2021, 11:41:25 AM »
I decided that my post might be unnecessarily confusing, so maybe I'll just explain my application:
I have a motor that winds and unwinds a spool of sandpaper. I need to keep the speed of the sandpaper constant, so I need to:
1 Accelerate to the sanding speed.
2 Begin the sanding routine with the y and z axes
3 Gradually decelerate the spool as it fills up while the y and z axes are doing their thing. (to maintain constant sandpaper speed)
4 Decelerate the spool to stop and rewind to its starting point.

I have it all working ok using xyz and a as coordinated axes, but it is far from an ideal solution.
« Last Edit: February 24, 2021, 11:43:05 AM by dbt3000files »
Re: need help with a axis control as both a spindle and an axis
« Reply #2 on: February 26, 2021, 12:43:51 AM »
who knows if it will work but you can try:

Code: [Select]
mc.mcAxisUnmapMotor(inst, mc.A_AXIS, 3)
mc.mcAxisMapMotor(inst, mc.OB1_AXIS, 3)

but then maybe Mach4 needs a motor mapped beforehands judging by the menu option in pic?

So then, just map it and enable it arbitrarily and then play with the unmap/map API calls.
« Last Edit: February 26, 2021, 12:45:50 AM by compewter_numerical »
Re: need help with a axis control as both a spindle and an axis
« Reply #3 on: February 26, 2021, 11:43:29 AM »
Ok, that's pretty interesting. That gives me a lot of things to experiment with at least. Thanks!