step direction spindle also functions as C axis

More
20 Jul 2012 00:24 #22231 by stevestice
Hi sorry I am not very good at explaining myself. I am going with steppers at this time and planning on an encoder for the spindle and c axis. I guess what I was trying to say was that as long as my step dir config works with my steppers now I can switch to my servos and gecko drives when I build a mill later on. I have been working on the hal file I have part of the a axis/spindle figured out I think but still not sure what commands to link m3,m4 and m5 to the step and dir. I will attach my hal file and go back to the manuals Thanks Steve

File Attachment:

File Name: gang_stepper.hal
File Size:4 KB
Attachments:

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

More
21 Jul 2012 00:20 #22257 by andypugh
I am working on it.

The INI file would be convenient to have too.

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

More
21 Jul 2012 11:38 #22265 by stevestice
Hi Thanks for the help. Here is the ini file. Steve

File Attachment:

File Name: steve_gang_turn.ini
File Size:9 KB
Attachments:

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

More
21 Jul 2012 20:33 - 21 Jul 2012 23:57 #22297 by andypugh
This is certainly something that makes more sense as a custom component, but this way is at least more portable.
The way it works is to use a velocity-mode stepgen like you already had, and a PID component to use the velocity-mode stepper for positioning.
When you stop the spindle the HAL components wait for the spindle to stop (using ddt and near) and sets an enable flag. This triggers the storage of a rounded-down version of the current stepgen position (using a mux2, conv_float_s32 and conv_s32_float)
The commanded A-axis position is then added to the rounded stepgen position, and becomes the target for the PID control loop that moves the stepper in angular position mode.

You need to tune the stepgen.3.maxaccel and pid.0.Pgain to work together. If the Pgain is high relative to the maxaccel and maxvelocty then the spindle will oscillate wildy when coming to rest.


Note that in this config the A axis controls spindle angle, and is set so that positions are from 0 to 1 for a full revolution. A scale component with a gain of 1/360 could change this.

In "spindle mode" it is controlled by the usual M3 M4 M5 and S commands.

File Attachment:

File Name: gang_stepp...c047.hal
File Size:6 KB

Attachment gang_stepper.ini not found

Attachments:
Last edit: 21 Jul 2012 23:57 by andypugh.

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

More
21 Jul 2012 23:41 #22304 by stevestice
Hi Thanks again for the help. I will set it up later tonight. Steve

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

More
21 Jul 2012 23:50 #22305 by stevestice
Hi I am unable to download the files steve

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

More
21 Jul 2012 23:58 #22307 by andypugh
stevestice wrote:

Hi I am unable to download the files steve


I tried to be too clever.

Try again? I changed the links to point to uploaded files.

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

More
22 Jul 2012 00:07 #22309 by stevestice
Hi got the hal file get a not found error on the ini steve

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

More
22 Jul 2012 09:43 #22314 by andypugh
stevestice wrote:

Hi got the hal file get a not found error on the ini steve


Strange.

OK, just add PGAIN, IGAIN and DGAIN to the [AXIS_3] section of your existing INI.

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

More
22 Jul 2012 13:03 #22317 by stevestice
Hi I should have said when I downloaded the files I got the hal but get a 404 not found error on the ini file Thanks Steve

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

Time to create page: 0.146 seconds
Powered by Kunena Forum