- Posts: 1317
- Thank you received: 454
Stepper motors and linear scale closed loop setup?
8 years 4 months ago #112501
by Hakan
Stepper motors and linear scale closed loop setup? was created by Hakan
Hi guys,
I have a fairly standard three-axis milling machine with stepper motors. I have an idea of adding linear scales. I know it has been done before but can't figure out how to do that in terms of hal and ini file modifications. There is a 7i76E, three stepper motors + spindle encoder so running out of encoder possibilities. I would appreciate if someone told me which daugthercard to use to add three+ encoders.
The linear scales I have in mind are SINO KA300 with 1µm resolution, If the 5µm resolution works I can use that, but have read somewhere that smaller resolution is better.
From what I have understood from another post here, the way to give the feedback to the pid is as below
Of course adjusted for the actual encoder naming.
Is there anything more that is needed?
I have a fairly standard three-axis milling machine with stepper motors. I have an idea of adding linear scales. I know it has been done before but can't figure out how to do that in terms of hal and ini file modifications. There is a 7i76E, three stepper motors + spindle encoder so running out of encoder possibilities. I would appreciate if someone told me which daugthercard to use to add three+ encoders.
The linear scales I have in mind are SINO KA300 with 1µm resolution, If the 5µm resolution works I can use that, but have read somewhere that smaller resolution is better.
From what I have understood from another post here, the way to give the feedback to the pid is as below
Code:
net x-pos-fb <= hm2_5i25.0.encoder.03.position
net x-vel-fb <= hm2_5i25.0.encoder.03.velocity
net x-pos-fb => joint.0.motor-pos-fb
net x-index-enable joint.0.index-enable <=> hm2_5i25.0.encoder.03.index-enable
net x-pos-rawcounts <= hm2_5i25.0.encoder.03.rawcounts
Is there anything more that is needed?
Please Log in or Create an account to join the conversation.
8 years 4 months ago #112502
by tecno
Replied by tecno on topic Stepper motors and linear scale closed loop setup?
I use 7i76e with 7i85s for that.
Please Log in or Create an account to join the conversation.
8 years 4 months ago #112503
by Hakan
Replied by Hakan on topic Stepper motors and linear scale closed loop setup?
I see, makes sense. So I can select from the DB25 daugthercards and the one you have seem to be a perfect fit.
Please Log in or Create an account to join the conversation.
8 years 4 months ago #112573
by Hakan
Replied by Hakan on topic Stepper motors and linear scale closed loop setup?
Please Log in or Create an account to join the conversation.
8 years 4 months ago - 8 years 4 months ago #112886
by andypugh
Replied by andypugh on topic Stepper motors and linear scale closed loop setup?
You probably want two PID controllers:
PID1 uses the stepgen position for feedback and PID of 1000. This compensates for servo thread timestamp dither.
PID2 uses the linear scales for feedback and (probably) only I gain with no P or D. This adds a correction term to the output of the first PID.
I think that you can feed the output of one PID into the "bias" pin of the other PID to sum them together.
PID1 uses the stepgen position for feedback and PID of 1000. This compensates for servo thread timestamp dither.
PID2 uses the linear scales for feedback and (probably) only I gain with no P or D. This adds a correction term to the output of the first PID.
I think that you can feed the output of one PID into the "bias" pin of the other PID to sum them together.
Last edit: 8 years 4 months ago by andypugh.
Please Log in or Create an account to join the conversation.
8 years 3 months ago #115077
by Hakan
Replied by Hakan on topic Stepper motors and linear scale closed loop setup?
Hi Andy, I missed your reply. But it is not too late.
I just started to work on this. I am not sure where it will end up, if it will be useful or not. I will learn a lot, and that can be good enough for me.
I am documenting what I do in Youtube videos. I am about to add encoder feedback.
Mounting and connecting.
Looking at following errors.
So the f-error I see come from timestamp dither? It is basically removed by PID P=1000.
In the tests I made I see the commanded_pos - encoder_pos is in the order or 20-30 µm while joint.0.pos-fb is not above 1.3 µm. I could think that the larger value is the one to focus on.
The idea I had was to just replace joint.0.pos-fb with encoder.position (and velocities if applicable).
I just started to work on this. I am not sure where it will end up, if it will be useful or not. I will learn a lot, and that can be good enough for me.
I am documenting what I do in Youtube videos. I am about to add encoder feedback.
Mounting and connecting.
Looking at following errors.
So the f-error I see come from timestamp dither? It is basically removed by PID P=1000.
In the tests I made I see the commanded_pos - encoder_pos is in the order or 20-30 µm while joint.0.pos-fb is not above 1.3 µm. I could think that the larger value is the one to focus on.
The idea I had was to just replace joint.0.pos-fb with encoder.position (and velocities if applicable).
The following user(s) said Thank You: Mara2000
Please Log in or Create an account to join the conversation.
Time to create page: 0.196 seconds