Page 1 of 1

Using a DC motor with encoder to drive a fixture (4th axis)

PostPosted: Wed Oct 20, 2021 1:29 pm
by DavidT
Hi everyone,

What I'd like to do seems simple enough but I'm missing at least one piece of the puzzle, plus I don't know if UCCNC will allow me to do what I want as I'd like.

What I'm trying to do is pretty much like adding a 4th axis (spindle type).

I wish to be able to set a fixture zero position and then be able to rotate it (tilt its nose down) by X degree (max 15). During a job, the machine would go back and forth between the zero and the defined angular position.

I have a 24V DC motor equipped with a encoder that I would like to use. This is where it gets unfamiliar to me. I mean it looks fairly simple because the motor will rotate in one direction when I apply 24V and rotate the other way if I invert the polarity. Also I'm able to set and read the encoder position in the AUX. ENCODER table.

I don't know what to do next.
Can I use a driver that would be able to read the encoder position and drive the motor according to a position request? If so, please suggest driver models because all I can seem to find are made to work with Arduino or are closed loop stepper drivers (which I could guess how they work but honestly don't know much about).

The other solution I thought is to use limit switches to cut the power to the motor when a position is reached. The zero limit switch would be in a fix position and the angular would have to be move manually... maybe by using a sliding block along a radius & locked by a screw or some kind of index plate & lock pin setup to get easier/faster setup and repeatability. I would use relay to control the power supply and polarity and the limit switches would define the positions.

But being able to specify the angle directly in the code instead of adding a manual operation seems simpler... and cooler. 8-)

Thank you

Re: Using a DC motor with encoder to drive a fixture (4th ax

PostPosted: Wed Oct 20, 2021 11:16 pm
by eabrust
you'll likely want to use something like a CNCDrive driver (http://www.shop.cncdrive.com/index.php?productID=509) or a geckodrive g320x, or similar. Set it up as a step/dir axis w/ steps per unit calibrated to angular degrees, and control it precisely w/ code.

You probably would not be happy doing full on/off control w/ relays.

regards
Eric

Re: Using a DC motor with encoder to drive a fixture (4th ax

PostPosted: Thu Oct 21, 2021 10:34 pm
by DavidT
Eric, this is fantastic!
Thank you very much!
While it may seem too simple/obvious to some I just couldn't find the piece I needed and this is it.

And you're right, I didn't really wanted to go the relay/stop switches route but it was (until now) the only option I could use without the driver.

Thanks again, you made my day. :D

Re: Using a DC motor with encoder to drive a fixture (4th ax

PostPosted: Thu Oct 21, 2021 10:54 pm
by DavidT
By the way... this should be the only piece I'm missing right?
I mean, we will be able to set this up directly in UCCNC... all I need is free inputs and outputs on the mainboard?
Thank you