Position control ignores feedback position

Moderators: TomKerekes, dynomotion

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

Position control ignores feedback position

Post by RogerFroud » Tue Jun 01, 2021 11:13 am

Slow but steady progress with Tom's excellent help.

I'm trying to configure the X-axis to move to a commanded position using the Linear scales as feedback.

I can now do the following using Machine Coordinates...

Open loop first...
I've set the gain to -1 to get the machine to move in the correct direction.
Selecting 10 as the step size, I can jog ten +ve steps and it has moved 100mm, measured with a ruler, so that looks promising.
I can also click zero on the axis and then type G1X-100F100 and get back to zero
The zero and set buttons work how I would expect, ie pressing zero enters zero on the DRO, setting a value results in that value being shown on the DRO.

So far so good... but...

Closed loop...
I've had to set the Input Channel gain to -2 to get it to read the correct distance.
Again, jogging ten +ve steps moves 100mm, measured with a ruler, and the display reads 100mm.
However, typing G1X-100F100 goes in the right direction, but the table just sails past the required position and never stops. Typing in a position in the other direction causes the table to move in the right direction, but it doesn't stop.

So it looks like it can correctly interpret the scales, but it's not using them to close the loop.

I'm clearly missing something that needs to be set to tell KFLOP to use the Linear Encoder.
I've attached a screen shot of the X-axis configuration.




Another thing that I need to change is the behaviour of the zero and set buttons when using G54 offsets. Currently they work as expected if the axis configuration is Open Loop. However, it makes no sense when using Encoder feedback. Pressing zero sets the DRO to the Machine Coordinate position, which makes no sense to me. The same thing goes with the set button, it adds the set value to the Machine Coordinate zero.
How can I change this so pressing zero results in the DRO reading zero, and the set value reading what I've typed in? Maybe this is associated with the other issue, but I'm not sure quite how.
Attachments
X-axis Configuration.jpg

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

Re: Position control ignores feedback position

Post by TomKerekes » Tue Jun 01, 2021 4:47 pm

Hi Roger,
Again, jogging ten +ve steps moves 100mm, measured with a ruler, and the display reads 100mm.
However, typing G1X-100F100 goes in the right direction, but the table just sails past the required position and never stops. Typing in a position in the other direction causes the table to move in the right direction, but it doesn't stop.
Strange that one move would work and a similar not.

What is +ve? The Step Button?

Test the closed loop response in KMotion.exe's Step response screen before running KMotionCNC.

Post all your settings for the axis which is the Configuration Screen, Step Response, and Filters Screens and post a Plot of a 100mm motion.

The configuration posted is an open loop configuration.

Regarding Zero/Set I suspect the issue is related to the axis not working and you are probably displaying the Measured Encoder Positions rather than the Commanded Destinations.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Position control ignores feedback position

Post by RogerFroud » Tue Jun 01, 2021 5:21 pm

Ok, I'll do that. I've got to go out now, but could you tell me how the configuration is set to be closed loop? I've selected the Input encoder, isn't that all I need to do?
It sounds like you have to set some other check box to tell it that it's closed loop...

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

Re: Position control ignores feedback position

Post by TomKerekes » Tue Jun 01, 2021 5:32 pm

See here.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Position control ignores feedback position

Post by RogerFroud » Tue Jun 01, 2021 9:14 pm

Thanks, I'll give that a try tomorrow. I think I'm almost there with the basic motion control. Homing is the next thing on the list.

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

Re: Position control ignores feedback position

Post by RogerFroud » Wed Jun 02, 2021 7:50 pm

Just to recap, I'm using CL Step with 1 micron steps for the Output and Linear encoders with 1 micron resolution for the Input.
I've been experimenting with just the X-axis to get the tuning right, and that is now working with the following results...

1) The axis moves the correct distance within a couple of microns according to the DRO which is perfectly acceptable.
2) The move can be accomplished at the maximum feedrate now I've eased the following error value to 1000. I don't know if that's acceptable, or whether I somehow need to tighten up the servo loop to make that smaller. To me that sounds like a lot, presumably it's 1000microns ie 1mm. If that's what it represents, how should I go about making it better? On other system I've tuned, the following error is very small.
3) The jogs work as expected.

However, I'm finding that the zero button on the DRO doesn't correctly zero the display.

For example, The Orange Machine Coord display currently shows X1.8845mm, while the Blue display shows 51.8845mm. Pressing the zero button results in the Blue display now showing -0.0083mm, not zero.
If I now jog the axis another random amount, I now have the Orange Machine Coordinate display showing X3.6955mm and the Bl;ue display showing X1.8027mm. Clicking the zero button, I get X-0.0178mm which is even further out.

Clearly something is very wrong with this. The display should always read zero after pressing zero. It looks like the calculation for the offset isn't being done to a high enough precision if it's converting from Inch to metric and then back again.

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

Re: Position control ignores feedback position

Post by TomKerekes » Wed Jun 02, 2021 9:32 pm

Please do what I requested in my previous post.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Position control ignores feedback position

Post by RogerFroud » Thu Jun 03, 2021 1:31 pm

I've attached the information I think you asked for. The maximum distance I can output and still see on the graph's 3.5 second period is 100,000 which actually appears to be 50mm of travel when I check it with a ruler. I don't understand why that doesn't travel 100mm since 1 step is 1micron. I also don't understand why I had to change the Input channel gain to -2 to get it to move 100mm when commanded to move that distance.

I haven't changed anything on the Filters page. On the face of it, the response looks ok to me. It's only the following error that seems to be a problem. The Max Following Error was initally at 500, but it wouldn't run past F2500 without coming to a rapid stop with an error. Opening that figure up to 1000 allows me to reach the max F3000 feedrate.

Since the move is a G1, I would have thought the following error would be very small.
Attachments
X-axis Configuration.jpg
Step response.jpg
Filters.jpg

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

Re: Position control ignores feedback position

Post by TomKerekes » Thu Jun 03, 2021 6:16 pm

Hi Roger,

Again please do not run KMotionCNC until after your Axis is setup, tested, and tuned.

I've attached the information I think you asked for.
Yes but a position plot would have been more useful. Not much use for a velocity plot. Actually including the data is a good idea so that we can plot/zoom as desired.

The maximum distance I can output and still see on the graph's 3.5 second period is 100,000 which actually appears to be 50mm of travel when I check it with a ruler. I don't understand why that doesn't travel 100mm since 1 step is 1micron. I also don't understand why I had to change the Input channel gain to -2 to get it to move 100mm when commanded to move that distance.
I can't follow your description. Did it move 50mm or 100mm when that plot was made with those parameters?

With PID all zero the system is open loop not closed loop. The encoder is not being used. So it should have no effect on the distance moved or the motion. So I don't understand on changing it to -2 would change anything other than you wouldn't get a following error fault if a small Max Following Error limit was set.

Acceleration is set crazy high. So motion is entirely Jerk limited.

Set Feed Forwards to zero. 0.01 x 150000 steps/sec = 1500 steps. This is trying to advance 1500 steps ahead based on velocity. But is limited to 200 steps by Max limit Output. Notice how the Output slams to the limit. I'm surprised this doesn't cause a stall.

Please re-post the plot and data without the Feed Forward and explain what it did.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Position control ignores feedback position

Post by RogerFroud » Fri Jun 04, 2021 11:26 am

You didn't specify what plot type you wanted, so I just used the default. I'll use one of the distance plots from now on. It looks like the Step data file was too big, so it wasn't included last time. I've compressed it this time.

The motion was 50mm.

Just to make sure we're on the same page, the SureServo is using its own position feedback on its internal rotary encoder to close the motor position loop.
The SureServo has been tuned so that it has its own Feed Forward Gain set to give <10microns following error while it's performing the Step Response here.
The Step & Direction input it's receiving is just the desired position it's trying to control to. This is a closed loop system in itself, and is probably why the accelleration isn't an issue.

I only changed the input gain to 2 because I was originally running the config with Step & Direction, not CL Step. I had to change it then so it moved the right distance. Maybe that's wrong now it's using CL Step?


Anyway, here is the data with the feed forward set to zero. I don't understand why the output is now a straight line. What does the Output represent? The command and position plots lie directly on top of each other.

It moves very smoothly back and forth 50mm, and I'm seeing a very small following error on my SureServo output, so it looks like it's following what it's commanded to do. I'm using the Move button on the Step Response screen. The Step function doesn't move the axis, so I don't know what that's used for or how to move the axis with that.

I'm afraid I dont understand what the plot is showing, and what's limiting the acceleration. The motion profile acceleration figure doesn't seem to affect the Command curve beyond A=1e6 When I set it above that, the steepness of the Command curve doen't increase. I don't think this is stretching the AC Servo acceleration performance to the limit.

Hopefully this makes sense and that's what you intended me to do.
Attachments
Step response data.zip
(244.85 KiB) Downloaded 49 times
X-axis Configuration.jpg
Step response.jpg
Filters.jpg

Post Reply