orient spindle with ethercat EL5101

More
1 year 1 month ago #334397 by laurentl38
I took the PID solution and modified the code a little. I initialized spindle-index-enable to 1 when starting Lcnc.
I also used ABS on spindle-Pos-fb-abs.
The spindle is positioned, but only in certain cases:
- When starting Lcnc, if I've never rotated the spindle at speed and the angular displacement is small (less than 20 degrees).
- If I rotate the spindle first and then try to orient it, almost every time, it will start at maximum speed, without orientation.
- If I rotate the spindle first, and then reposition it slightly by hand with my index finger, I can orient it, but always with small successive angular displacements.

It's progressing little by little, but from my point of view, it's more tinkering than mastery...

 

Attachment not found

Please Log in to join the conversation.

More
1 year 1 month ago #334410 by Hakan
Try a small value for FF1 so it starts to rotate. Then add P so it stops.

Please Log in to join the conversation.

More
1 year 1 month ago #334508 by laurentl38
I'm going to run some tests this weekend.
To be honest, I'm having trouble understanding the purpose of the FF0, FF1, and FF2 terms. Are these offsets of the PID terms?

Please Log in to join the conversation.

More
1 year 1 month ago #334515 by PCW
FF0,FF1,FF2 are feed forward terms

FF0 adds a proportion of the PID command to the PID output
FF1 adds a proportion of the PID commands first derivative to the PID output
FF2 adds a proportion of the PID commands second derivative to the PID output

For a simple example imagine a spindle control PID loop
This would have a PID loop with velocity command and velocity output.
Setting FF0 to 1 means that at a say commanded RPM of 3000,  means
that the PID output would be 3000 without any correction from the PID error
term. You can think of the FF terms as a way of centering the operating
point of the PID loop around the current state (rather than having
feedback have to do all the heavy lifting)

 

Please Log in to join the conversation.

More
1 year 1 month ago #334539 by Hakan
When I think of it, it may not work very well with FF1 in this situation.
I guess orient just gives a position, without any ramping up and down.
Not like a motion profile with acceleration up and down.
My new bet is to set all FFs to zero and slowly increase P.

Please Log in to join the conversation.

More
1 year 3 weeks ago #335906 by laurentl38
hello,

I've spent hours playing with the PID values ​​and still have the same problem...
In the meantime, I've made progress on other points on the machine to take my mind off things.

If I move the spindle to 45 degrees, then 145, 245, and 345, no problem; it positions itself correctly at the value. However, if I move it from 45 to 245, the spindle goes to maximum speed without stopping...

But since yesterday, I've had an interesting lead. When this doesn't work, I realized that the spindle command becomes negative (LCNC, probably choosing the shortest path, by wanting to rotate the spindle in the opposite direction).
And that's the problem: the spindle doesn't change direction, so the PID drifts...

To confirm my idea, I made the same movements, but imposed the rotation direction with an M19 Rx P1.
And then, if I move the spindle from 45 to 145 degrees or from 45 to 345, there's no longer a problem; it positions itself every time.

I've probably found the cause, but how to resolve it, I don't know.

Do I have an error in my HAL or am I missing a line?
Do you have any leads?

Please Log in to join the conversation.

More
1 year 3 weeks ago #335977 by laurentl38
Well, I just found another mistake.
My spindle driver only has two pins: forward and reverse; it doesn't have an enable pin.
And I had wired spindle.0.on to the driver's forward pin instead of spindle.0.forward.
The good news is that the PID speed still works fine.
The bad news is that the orientation doesn't move at all anymore, nothing...

 

Attachment not found

Please Log in to join the conversation.

More
1 year 3 weeks ago #336038 by laurentl38
Victory!! I finally have something working.
The spindle orients normally (all that's left is to set the orientation PID values ​​correctly...) in both directions, without using the M19's P1 or P2 prefixes.

I added an ABS for the analog control voltage of the driver command and
net spindle-fwdd abs.spindle.is-positive => lcec.0.D3.dout-0
net spindle-revv abs.spindle.is-negative => lcec.0.D3.dout-1

It was hard and laborious, but anyway... the rest will seem almost easy to me :-)

Please Log in to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum