Axis tuning

Moderators: TomKerekes, dynomotion

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Axis tuning

Post by RogerFroud » Mon Jun 28, 2021 10:15 pm

I'm finally back to tuning the machine after a complete strip down to beef up the base casting of the machine with some massive 20mm thick plates, welded into a frame and bolted to the column and leadscrew areas. I was getting a deflection of 40microns each time the knee moved up, and next to nothing on the way down. That's because there's no counterbalance on the knee.

I thought that would make tuning more difficult, and it's not good for it to be that flexible. There's no perceptible deflection any more, so that's two weeks work well spent. I've attached a couple of pictures in case anyone else needs to do something similar.

I've attached the step response data and a screen shot if anyone wants to see what I'm describing.

So to recap... the system is using step & direction outputs to drive a SureServo AC Servo that has its own position control loop with the motor's encoder. The servo drives the knee leadscrew through a 2:1 toothed belt reduction which is pretty rigid.
There's a linear scale that has a 1 micron resolution.

So I have the following questions...

1) I presume it's usual to have a gain of 1 for the output channel and then adapt the Input channel to give a matching resolution?
2) I've had to massively increase the allowable limits for the Output and Integrator else there was a huge offset during the motion. I've experimented with various values for the Accel and Jerk and also the Integrator, and this is the best response I can get while maintaining a snappy response. How can I reduce the huge error spikes at the start and end of the motions without ending up with a sluggish response?

I haven't experimented with the filters, I don't know what to try or whether that will help or make things worse.

Some guidance on how to proceed would be much appreciated.
Attachments
Z-axis error response.jpg
20210626_104551.jpg
20210612_120418.jpg

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Axis tuning

Post by TomKerekes » Tue Jun 29, 2021 2:32 am

the system is using step & direction outputs to drive a SureServo AC Servo that has its own position control loop with the motor's encoder. The servo drives the knee leadscrew through a 2:1 toothed belt reduction which is pretty rigid.
So what is the overall resolution?

I presume it's usual to have a gain of 1 for the output channel and then adapt the Input channel to give a matching resolution?
That's my normal recommendation. What is the Input Channel Gain currently set at?

I've had to massively increase the allowable limits for the Output and Integrator else there was a huge offset during the motion.
Although I don't know your step resolution I wouldn't expect the closed loop to need to make 2000 step corrections as shown in the plot. The closed loop corrections should be due to small mechanical errors like backlash, leadscrew errors, compliance errors, etc. As we asked previously start in open loop (Step Dir Mode) and get the system to move in a reasonable manner before attempting to go closed loop.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Axis tuning

Post by RogerFroud » Tue Jun 29, 2021 10:08 pm

Thanks for that.

The overall resolution is 0.00025mm per step, so I've got a gain of 1 for the Output and -4 for the input.

I've done a lot of mechanical checks for lost motion, and I've got about 60microns in total. That lead me to look again at the AC Servo tuning, and I've discovered that there's a huge following error on the angular position control loop which is the source of the apparent lost motion.

I'll sort out the tuning on that, and go back to the open loop tuning when that error is small.

Obviously with this kind of system, it doesn't stall like a Stepper Motor solution would. I presume that you just keep increasing the Open Loop Accel and Jerk parameters until the following error on the AC Servo control loop starts to become large, indicating that it can't keep up?

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Axis tuning

Post by TomKerekes » Tue Jun 29, 2021 10:48 pm

Obviously with this kind of system, it doesn't stall like a Stepper Motor solution would. I presume that you just keep increasing the Open Loop Accel and Jerk parameters until the following error on the AC Servo control loop starts to become large, indicating that it can't keep up?
Yes. Velocity as well.

You might read this.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Axis tuning

Post by RogerFroud » Tue Jul 06, 2021 6:53 pm

It's time for another round of tuning questions I'm afraid, but it's almost good enough so I'm heartened by the progress.

I've attached the data and screen shots of the setup for each axis. The X and Y axes have 0.0005mm resolution and the Z is 0.00025 because of the 2:1 belt drive reduction. The linear scales are all 1 micron, but for these tests, the PID values are all zero, so it's open loop.

I've spent a lot of time tuning the SureServo AC Servos to give the smallest possible following error. That's what was causing the huge error on the Z-axis. The error tops out at 20 steps on all axes during the step move, so that's probably as good as it's going to get.

So the first obvious question is this...

1) Since the output is open loop, why is there so much oscillation? Where does that come from? Surely it ought to be very smooth since it's just doing a ramp?
2) Do these plots look like you would expect, or is there something funamentally wrong with my setup?
3) When I introduce a little integral value, the closed loop performance seems good to me, but when running it on the machine, it seems uncertain at the target point. It just seems to wander back and forth, really slowly, but way more than the resolution of the system. I don't understand why this isn't more aggressively pulling in to a stable closed loop position. What can I do to improve that?

The machine moves very smoothly using the jog buttons without any signs of harshness. I wonder if there's just not enough gain to keep it close to the target position??
Attachments
Z-axis step response data.txt
(996.09 KiB) Downloaded 50 times
Z-axis screen shot.jpg
Y-axis screen shot.jpg
X-axis screen shot.jpg

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Axis tuning

Post by TomKerekes » Tue Jul 06, 2021 7:38 pm

Hi Roger,
1) Since the output is open loop, why is there so much oscillation? Where does that come from? Surely it ought to be very smooth since it's just doing a ramp?
I'm guessing the "oscillations" are lead screw errors/wobble. You're moving 100000 counts. For X that would be 50mm. If your lead screw is 5mm pitch then that would be 10 revs which is how many oscillations I count. Z moves half the distance and has half the number of oscillations so that correlates. Peak-peak Amplitude of ~25 counts or 12um.

2) Do these plots look like you would expect, or is there something funamentally wrong with my setup?
They look reasonable to me. Somewhat large lag while moving of ~ 25um. It might be worth while determining whether that is lag caused by the SureServos or is manual compliance somewhere. Can't you see what the errors are in the SureServos while it is moving? Backlash seems to be about 10um. That will make holding position below that difficult.

3) When I introduce a little integral value, the closed loop performance seems good to me, but when running it on the machine, it seems uncertain at the target point. It just seems to wander back and forth, really slowly, but way more than the resolution of the system. I don't understand why this isn't more aggressively pulling in to a stable closed loop position. What can I do to improve that?

The machine moves very smoothly using the jog buttons without any signs of harshness. I wonder if there's just not enough gain to keep it close to the target position??
If you make a "Move" of size zero you can plot and observe the servo dither while still. Servo dither is very complex. You might read this.

Any I gain at all will always move it to the target position as any error will cause the output to continuously ramp up (move towards target) until there is zero error. The problem is usually that the motors keep building up torque until the torque overcomes friction and breaks free, accelerates through backlash, finally the linear scales show movement, but that's too late to avoid overshooting. With compliance and backlash the capability of the servos at the motors to move in a precisely controlled manner is critical.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Axis tuning

Post by RogerFroud » Tue Jul 06, 2021 10:03 pm

Hi Tom,
That makes sense, the leadscrews are indeed 5mm pitch. I'm just surprised that the amplitude is so large. I guess there's nothing that can be done about that.

I suspect that the lag is partly in the SureServo, I can see it momentarily jump to 20 counts before settling down. There's a live display on the drive that can show following error. Adjusting the SureServo is tricky, I've spent hours gradually driving down the following error. However, there may still be a little more I can get out of it.

The amount of mechanical lost motion is almost certainly around 10microns, that's the conclusion I came to when running Mach4. The machine has dovetail slides, so there's a lot of friction compared to machines with rolling elements for the slideways. The leadscrews are pretty massive, but inevitably there's elasticity in everything. For this type of machine, I reckon it's as good as you're going to get.

For a zero move, I presume would you just reduce the step size to zero. I'll take a look.

I've had a play with adding a small deadband of 2 to the X&Y, and that certainly helps it stay still. However, when I jog one micron at a time, and reverse direction, it's very slow to take up the backlash, say 0.5-1.0 second and it doesn't look like overshooting is going to be a problem. I put in a little P of 0.2 and that seemed to slightly speed it up, but it seems to me that it ought to respond quicker. Is there anything else I can try?

I did spot that dither example and wondered if that might help. I'm not sure how you integrate that into the system though. Is that cut and pasted into the Init.c file in the loop at the end? I'd certainly be interested in experimenting with that.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Axis tuning

Post by TomKerekes » Wed Jul 07, 2021 1:16 am

Hi Roger,
I've had a play with adding a small deadband of 2 to the X&Y, and that certainly helps it stay still. However, when I jog one micron at a time, and reverse direction, it's very slow to take up the backlash, say 0.5-1.0 second and it doesn't look like overshooting is going to be a problem. I put in a little P of 0.2 and that seemed to slightly speed it up, but it seems to me that it ought to respond quicker. Is there anything else I can try?
You haven't explained what you've tried so far or what happened or any plots on the response. What are your filters set at? 1 second to correct seems slow. Not sure why you think overshooting wont be a problem. The basic problem is usually to get the system to correct quickly without overshooting.
I did spot that dither example and wondered if that might help. I'm not sure how you integrate that into the system though. Is that cut and pasted into the Init.c file in the loop at the end? I'd certainly be interested in experimenting with that.
I'd wait to look into that until after the system is fully tuned and as a last resort. But yes it would be put into the forever loop in your Init program.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Axis tuning

Post by RogerFroud » Sun Jul 11, 2021 8:53 pm

Before I forget to mention it, all of the filters are cleared.

Before getting back into the tuning question, it does seem to me that there's a fundamental problem with a classical control solution. That's because it's not only non-linear near the stationary point due to stiction, but it's also assymetric due to lost motion.

It seems to me that unless you configure the control system to behave differently when it needs to change direction and take up the lost motion, you will never get the best performance. I see that there's provision for setting the backlash, presumably for Open Loop operation. However, it seems to me that the system could be told the expected backlash in a Closed Loop system with Linear Encoders like mine, so it could respond differently in each direction. This must surely be an issue on every system, since there's always some lost motion?

Anyway, those are just my initial thoughts. Continuing on from the plots and configuration I last posted...

1) I've included the Step Response for the large move as a reference

2) The closed loop zero response shows a small amount of dithering that's almost unmeasurable on the 1uM Dial Clock that I use. It amounts to about 20 counts which is around the right figure for the backlash. The cycle takes about 1 second or so.

3) The closed loop standing still response when running the same parameters transferred to the init.c file is very different though. The count does a similar back and forth dithering, with there being about 20 counts as before. However, it drifts slowly further out of position with each cycle, so that after say 10 seconds, it's say 20-30microns out of position. I've managed to tie this additional wandering behaviour to the SureServo system. I'm sure that's causing the problem now because I can see the count going to it isn't changing but it's still hunting. I'll have to dig deeper to see what that's all about.
Attachments
Y-axis zero Step response.jpg

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Axis tuning

Post by TomKerekes » Mon Jul 12, 2021 3:33 pm

Before getting back into the tuning question, it does seem to me that there's a fundamental problem with a classical control solution. That's because it's not only non-linear near the stationary point due to stiction, but it's also assymetric due to lost motion.

It seems to me that unless you configure the control system to behave differently when it needs to change direction and take up the lost motion, you will never get the best performance. I see that there's provision for setting the backlash, presumably for Open Loop operation. However, it seems to me that the system could be told the expected backlash in a Closed Loop system with Linear Encoders like mine, so it could respond differently in each direction. This must surely be an issue on every system, since there's always some lost motion?
You should try that :)
1) I've included the Step Response for the large move as a reference
1 encoder count of dither as expected.
3) The closed loop standing still response when running the same parameters transferred to the init.c file is very different though. The count does a similar back and forth dithering, with there being about 20 counts as before. However, it drifts slowly further out of position with each cycle, so that after say 10 seconds, it's say 20-30microns out of position. I've managed to tie this additional wandering behaviour to the SureServo system. I'm sure that's causing the problem now because I can see the count going to it isn't changing but it's still hunting. I'll have to dig deeper to see what that's all about.
It doesn't make sense there would be any difference depending on how the parameters are set.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply