Closed Loop

More
12 Jul 2021 23:24 #214453 by andypugh
Replied by andypugh on topic Closed Loop
net z-enable  pid.0.enable <= joint.0.amp-enable-out => stepgen.0.enable
net z-output  pid.0.output 
net z-pos-cmd  joint.0.motor-pos-cmd => pid.0.command => stepgen.0.position-cmd 
net z-vel-fb  encoder.0.velocity => pid.0.feedback-deriv 
net z-pos-fb  joint.0.motor-pos-fb <= encoder.0.position => pid.0.feedback

You have the PID all set up, but it isn't being used.
net ... joint.0.motor-pos-cmd ... stepgen.0.position-cmd
means that the commanded position goes direct to the stepgen with no influence from the PID.

Try, instead:
net z-enable  pid.0.enable <= joint.0.amp-enable-out => stepgen.0.enable
net z-pos-cmd  joint.0.motor-pos-cmd => pid.0.command  
net z-vel-fb  encoder.0.velocity => pid.0.feedback-deriv 
net z-pos-fb  joint.0.motor-pos-fb <= encoder.0.position => pid.0.feedback
net z-output  pid.0.output => stepgen.0.position-cmd

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

More
13 Jul 2021 06:58 #214498 by rohit269
Replied by rohit269 on topic Closed Loop
Many thanks for supporting me,
Sir after making this change in the hal file joint 0 error indicate and I am increase min ferror and ferror than check but after that stepper motor behavior is uncontrolled.
Sir now how solve this stepper motor behavior problem.

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

More
13 Jul 2021 10:00 #214523 by andypugh
Replied by andypugh on topic Closed Loop
You will need to tune the PID.
First set FF0 to 1, FF1, FF2, Pgain, Igain, Dgain to 0.
That should leave you exactly where you were before, but with the PID in the data path.
Then try adding very small amounts of I and (and maybe P). when I say "small" I think I would start at 0.0001 (0.1um / mS) for I.

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

More
16 Jul 2021 13:35 #215052 by rohit269
Replied by rohit269 on topic Closed Loop
Many thanks for supporting me,
sir,
After tuning pid  z axis motor run smoothly but i have new problem e.g. when i run G1 Z100 F300  then axis reach near z100  like 100.3 or 100.2 or 100.4  after that machine reach Z100.0010  very very slowly (Deadbend  is 0.001) and when i increased Pgain  for increasing this speed than z axis motor behave like  jerking.

so please tell us how to solve this problem

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

More
16 Jul 2021 13:39 #215054 by andypugh
Replied by andypugh on topic Closed Loop
Thus sounds like I-term windup. You could try to reduce the maxerrorI setting.

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

More
16 Jul 2021 13:52 #215055 by rohit269
Replied by rohit269 on topic Closed Loop
Many thanks  supporting me,
sir,
where is this maxerrorI setting and kindly see ini file.
Attachments:

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

More
16 Jul 2021 13:55 #215056 by andypugh
Replied by andypugh on topic Closed Loop
linuxcnc.org/docs/2.8/html/man/man9/pid.9.html

It is quite likely that your existing HAL does not include MaxerrorI, and if it isn't in the HAL then nothing happens if you put it in the INI.

So, if you want to use it, you need to add a "setp" line to the HAL. You can either set the value directly in the HAL, or link to a new entry in the INI.

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

More
17 Jul 2021 09:37 - 17 Jul 2021 21:14 #215127 by rohit269
Replied by rohit269 on topic Closed Loop
Many thanks for supporting me,
Sir,
After add errorI  than improve  the speed  up to 18mm/min but more than 18mm/min  axis motor behavior like earlier and also when run  e.g. G1 z-10 f150  than starting  to  3 or 4mm axis motor jurking than run smoothly  and one more question  I am testing axis scale  with metal scale  e.g.  G1 z100 f100 and that time move 0.400 higher (z100.400Z)  sir kindly tell how to solve this problem. 
Last edit: 17 Jul 2021 21:14 by rohit269.

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

More
19 Jul 2021 07:49 #215292 by rohit269
Replied by rohit269 on topic Closed Loop
Many thanks for supporting me,
Sir,
After add errorI  than improve  the speed  up to 18mm/min but more than 18mm/min  axis motor behavior like earlier and also when run  e.g. G1 z-10 f150  than starting  to  3 or 4mm axis motor jurking than run smoothly  and one more question  I am testing axis scale  with metal scale  e.g.  G1 z100 f100 and that time move 0.400 higher (z100.400Z)  sir kindly tell how to solve this problem. 

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

More
19 Jul 2021 12:44 #215321 by andypugh
Replied by andypugh on topic Closed Loop
18mm/min is very slow. Are you sure that is what you mean?

PID tuning is a process, and every machine is different. All I can suggest is that you read articles on the internet about the subject to try to understand how it works.
PID itself is very simple in terms of what calculations it does, but applying it to a specific application can take a lot of experiment.

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

Time to create page: 0.703 seconds
Powered by Kunena Forum