Spindle/3rdaxis, on the fly.

More
01 Nov 2011 04:04 #14476 by M4MazakUser
Just a quick question, i just really want a yes/no/you are totally insane answer.

is it possible using a "H-Bridge" driving a dc spindle motor, to change config on the fly from rpm control to servo control.

i imagine that i would set this up to be an "M" code, - i want to make a wood turning lathe for some railings around my house, and would like to be able to engrave as well, (turning tool in front toolpost, engraving tool in rear toolpost).

Please Log in or Create an account to join the conversation.

More
01 Nov 2011 13:23 #14486 by andypugh
M4MazakUser wrote:

just really want a yes/no/you are totally insane answer.
is it possible using a "H-Bridge" driving a dc spindle motor, to change config on the fly from rpm control to servo control.


Yes, it is possible.

You would set up two PID controllers in the HAL file, one working from the encoder position and one from the encoder velocity, then direct the spindle current command through a mux2 block to connect either the speed control or position control signal to the PWM generator.

One issue with this simple scheme is that when you switch to position control the position controller will try to unwind all the previous revolutions. The solution to this is probably to also set the index-enable pin when you switch the modes, so that the encoder zeros itself the next time the encoder index is seen.

Some experimentation might be required.

Please Log in or Create an account to join the conversation.

More
01 Nov 2011 16:58 - 01 Nov 2011 16:59 #14492 by BigJohnT
I found this example in my files when looking for something else, I don't know where I got it from but it might help.

File Attachment:

File Name: Velocity_a...ndle.hal
File Size:4 KB


John
Attachments:
Last edit: 01 Nov 2011 16:59 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
01 Nov 2011 17:31 #14494 by andypugh
BigJohnT wrote:

I found this example in my files when looking for something else, I don't know where I got it from but it might help.

File Attachment:

File Name: Velocity_a...ndle.hal
File Size:4 KB


John


The Servo/H-bridge approach is quite a bit simpler, I think, but similar in essence.

Switching mode with M3/M5 seems a very easy way to do it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum