caxis.comp - problems

More
21 Jan 2024 23:35 #291291 by spumco
Replied by spumco on topic caxis.comp - problems
[list]
[*][b]Axis/Spindle disable[/b]
[list]
[*]As I've mentioned this is a servo spindle, so I can't manually rotate the spindle without disabling the drive.  Once I disable and rotate the spindle the c-axis f-error goes banannas and errors out when I re-enable the spindle.
[*]The only thing I can think of (right now) is to have the amp-enable de-asserted signal unhome the c-axis, and force a re-home on amp-enable.
[*]I can't imagine a situation where I'd want to manually rotate the spindle in the middle of a program.
[/list]
[/list]


No joy on the unhome-rehome hypothesis.

Have to force a switch to manual mode first, but even if I get it unhomed the c-axis PID still generates a following error while rotating the spindle by hand.  One it hits the ferror limit it trips the machine off even if the drive is disabled.

Really need some way of editing the comp so that the feedback-fandango it's doing to reduce the ferror can be applied while the amp is disabled.

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

More
22 Jan 2024 03:11 - 22 Jan 2024 03:23 #291300 by smc.collins
Replied by smc.collins on topic caxis.comp - problems
pass the encoder through the hal component, then use a switch in the program to send the encoder signal only where it needs to go when running in C or spindle mode.

edit: ion second thought it might be better to actually just fix this problem right at the source. There is no reason the spindle can't output rotational degree and be called as a joint/axis. If someone with a better understanding of the low levels can point me at the relevant code and files I will take a crack at rewriting the spindle, mostly becuase it's thread bare and mishandles a lot of use cases. 
Last edit: 22 Jan 2024 03:23 by smc.collins.
The following user(s) said Thank You: spumco

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

More
22 Jan 2024 03:40 #291301 by spumco
Replied by spumco on topic caxis.comp - problems
What I need is a way to change this:

switch state{
        case 0: // C-axis mode
            if (spindle_on){
                state = 1;
            }
            pid_enable = 1;
            spindle_velocity_out = pid_in;
            // detect index-reset
            if (fabs(position_fb_out - (spindle_revs - offset) * 360) > 180){
                offset = round(spindle_revs);
            }
            position_fb_out = (spindle_revs - offset) * 360;
            break;

To something like this:
        case X: // amp-disable mode
            if (amp-disable){
                state = N;
            }
            pid_enable = 0?
            spindle_velocity_out = 0
            // detect index-reset
            position_fb_out = spindle_revs (maybe?)
            break;

Or something like that.  Some way to let pid.c know that the current position is the commanded position.

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

More
22 Jan 2024 03:51 #291302 by smc.collins
Replied by smc.collins on topic caxis.comp - problems
I need to think about this. The problem as I see it, is that, we should be calling the spindle the C axis, in entirety. Hear me out as to why. Because it is very easy with a non closed loop spindle to set it up to simply ignore the lack of feedback. However it is very difficult to handle the duality of it. Also there is no reason that the Caxis can't take a pure velocity command " like every other joint in the system" and translate that to a rpm. The answer is, is to extend the code in the axis/joint to allow for it to behave as a spindle and then connect the spindle commands to it. I need to think on this more first. There basically needs to be a split in the system, there pure spindle " for lathes without servo or encoder feedback " hobbiest machines with limited functionality" and then there is you and I, I have a large industrial sized machine, and I need this functionality of the spindle and the C axis. I think the answer is to figure out how to use the C axis as a spindle all the time, not the swapping back and forth, or maybe put a way for the c axis to be in charge of the spindle and to choose which amplifier to use base on the setting call from the traj planner. I need to think on this more firs though. My lathe has enough control from the spindle drive " and it's a massive high quality reliance motor" to manage the axis as a joint or a spindle. Are you using 2 seperate motors and drives or just 1 ?

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

More
22 Jan 2024 03:52 #291303 by spumco
Replied by spumco on topic caxis.comp - problems

pass the encoder through the hal component, then use a switch in the program to send the encoder signal only where it needs to go when running in C or spindle mode.

 


Thats what I tried when I attempted to cook up my own system.  I had pid.s, pid.c, and pid.s-orient.  The encoder signal was connected to all three through a combination of mux2's, and other signals like jogging were disabled/enabled through tristate_float and tristate_bit comps.

I'm not explaining well, but if the feedback is disconnected from pid.c, and then re-connected after spindle, orient (or manual) movement there's a huge jump and wants to ferror out.

What needs to happen is:
  • spindle mode
    • disconnect pid.c, and before re-connecting fiddle with the feedback value so there's not a huge jump
    • caxis.comp already does this
  • orient mode
    • not needed if caxis.comp is used, but if desired for some reason same as above
  • manual turning
    • keep pid.c connected, but tell it current position = commanded position

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

More
22 Jan 2024 04:04 #291306 by spumco
Replied by spumco on topic caxis.comp - problems

Are you using 2 seperate motors and drives or just 1 ?
 


One drive, one motor.
~1.44:1 poly-v belt drive (didn't want to listen to a timing belt screaming)
Separate 1:1 GT2 belt driven spindle-mounted encoder

Based on a Dunham 5C spindle, so it's really low inertia and can accel/decel on a dime.

Air collet closer limits me to about 3kRPM at the spindle, but if this works out I can get one good for 4500rpm continuous.

Subspindle will be similar, only step-dir (instead of PWM-velocity), and with a 1kw servo instead of the ~2-3kw main spindle motor.

 
Attachments:

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

More
22 Jan 2024 04:36 #291308 by spumco
Replied by spumco on topic caxis.comp - problems

I think the answer is to figure out how to use the C axis as a spindle all the time, not the swapping back and forth, or maybe put a way for the c axis to be in charge of the spindle and to choose which amplifier to use base on the setting call from the traj planner.
 

The more I think about it, the more I realize Andy's caxis.comp works really, really well.  There's no 'swapping back and forth'.  It's like having a c-axis that you can run like a spindle with no m-codes or other input fiddling.

And because it outputs to two different pid's, it'll control two different amps as it's written now.

I think it just needs some additional features and/or pins to cover various hardware configs and situations.

OUT - caxis.N.mode-is-axis
OUT - caxis.N.mode-is-spindle
IN - caxis.N.spindle-ready
IN - caxis.N.axis-amp-enabled
IN - caxis.N.spindle-amp-enabled

The out pins could be used to turn off/on other components (so you can't jog the axis and change the FB position while in spindle mode).  The in pins could be used to adjust the component state, or delay the spindle output if a separate axis motor needed to be engaged (clutch, air driven swing gears, etc.).
 

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

More
22 Jan 2024 07:22 #291311 by Aciera
Replied by Aciera on topic caxis.comp - problems
Not sure but I just tried it:
loadrt caxis count=2

addf caxis.0 servo-thread
addf caxis.1 servo-thread

and it seems to work fine:
 

 
Attachments:
The following user(s) said Thank You: spumco

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

More
22 Jan 2024 11:35 #291336 by spumco
Replied by spumco on topic caxis.comp - problems
Aciera - which comp did you install?  The one I attached a while ago in this thread, or from some other source?

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

More
22 Jan 2024 12:11 #291338 by Aciera
The following user(s) said Thank You: spumco

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

Time to create page: 0.155 seconds
Powered by Kunena Forum