linear scale and AC servo set up - sanity check
- chienMouille
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 3
05 Oct 2022 13:03 #253526
by chienMouille
Replied by chienMouille on topic linear scale and AC servo set up - sanity check
re: oscillation, I didn't change the tuning of the drive. As when I re-checked as per my post before, It had under a micron following error.
If I add any P to the linuxCNC scale encoder tuning the axis runs away. WHY?
If I add any P to the linuxCNC scale encoder tuning the axis runs away. WHY?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
05 Oct 2022 13:17 #253527
by Todd Zuercher
Replied by Todd Zuercher on topic linear scale and AC servo set up - sanity check
Sounds like a sign/direction problem. Somewhere a direction is reversed. That is usually the cause of such a runaway. The PID loop sees the following error amount, and commands the drive to move faster to try to close the error. (That is what the P term does, it adds an amount proportional to the error to the command output.) If the sign of the encoder or the output is wrong then the error will increase as the the P adds more instead of decreasing causing it to runaway. Do you have the linear scale connected to both the PID and the DRO, and is the direction of movement correct?
Please Log in or Create an account to join the conversation.
- chienMouille
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 3
05 Oct 2022 13:28 - 05 Oct 2022 13:28 #253528
by chienMouille
Replied by chienMouille on topic linear scale and AC servo set up - sanity check
Attachments:
Last edit: 05 Oct 2022 13:28 by chienMouille.
Please Log in or Create an account to join the conversation.
- chienMouille
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 3
05 Oct 2022 14:04 - 05 Oct 2022 14:05 #253531
by chienMouille
Replied by chienMouille on topic linear scale and AC servo set up - sanity check
ok never mind, I changed the pulse width back to 10000, the step scale to 5000, the step len to 2000 and the step space to 2000 and it doesnt run away anymore.
weird but good
working some more on the pid. so far with some P I get it to land on the right spot, but it does it extremely slow so far
weird but good
working some more on the pid. so far with some P I get it to land on the right spot, but it does it extremely slow so far
Last edit: 05 Oct 2022 14:05 by chienMouille.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
05 Oct 2022 14:12 #253532
by Todd Zuercher
Replied by Todd Zuercher on topic linear scale and AC servo set up - sanity check
Maybe a noise issue causing the runaway with improper step timing? Wrong scaling might also cause a runaway.
The higher the P setting the faster it should correct.
The higher the P setting the faster it should correct.
Please Log in or Create an account to join the conversation.
- chienMouille
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 3
05 Oct 2022 15:03 #253534
by chienMouille
Replied by chienMouille on topic linear scale and AC servo set up - sanity check
alright, so now that I can actually set P without the whole system running away (still don't get why it was doing that), the axis always finds the target. The problem now is that it's super slow to do so. Like it will ether over or under shoot and then move to target super slowly. If I set P higher it's faster but I get intense skweeky noises on movement.
Any suggestions?
Any suggestions?
Attachments:
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
05 Oct 2022 15:34 #253537
by Todd Zuercher
Replied by Todd Zuercher on topic linear scale and AC servo set up - sanity check
The intense squeaky noises are probably the servo bouncing around in the dead space caused by your backlash.
Try adding more I to improve the correction time of the small errors. You may find it is helpful to limit the integrator error using the hal pin "pid.N.maxerrorI" to prevent large spikes in the command when large steps in command input happen. For example on my torque command input servo machine (which relies on huge I numbers) I would set the maxerrorI so that the command output would never saturate (go to more than 10v) because of I (for example with I=50000, maxerrorI=0.00005) Doing this allowed me to use much larger I settings for quicker response without causing a lot of trouble because of I wind-up. P would take care of the large errors and the I handles the small error. For this application setting maxerrorI approximately equal to the backlash might be a useful starting point.
Try adding more I to improve the correction time of the small errors. You may find it is helpful to limit the integrator error using the hal pin "pid.N.maxerrorI" to prevent large spikes in the command when large steps in command input happen. For example on my torque command input servo machine (which relies on huge I numbers) I would set the maxerrorI so that the command output would never saturate (go to more than 10v) because of I (for example with I=50000, maxerrorI=0.00005) Doing this allowed me to use much larger I settings for quicker response without causing a lot of trouble because of I wind-up. P would take care of the large errors and the I handles the small error. For this application setting maxerrorI approximately equal to the backlash might be a useful starting point.
The following user(s) said Thank You: chienMouille
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
05 Oct 2022 15:42 #253538
by Todd Zuercher
Replied by Todd Zuercher on topic linear scale and AC servo set up - sanity check
It is possible to add the maxerrorI as a tunable parameter in the servo tuning screen. I don't remember exactly how I accomplished that with my config (it was 10 years ago). It might have been as simple as adding an appropriate line to the ini file and setting up the setp line in the hal file to reference the ini file variable.
The following user(s) said Thank You: arvidb, tommylight
Please Log in or Create an account to join the conversation.
- chienMouille
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 3
05 Oct 2022 18:07 - 05 Oct 2022 18:08 #253551
by chienMouille
Replied by chienMouille on topic linear scale and AC servo set up - sanity check
Attachments:
Last edit: 05 Oct 2022 18:08 by chienMouille.
Please Log in or Create an account to join the conversation.
- chienMouille
- Offline
- Senior Member
Less
More
- Posts: 73
- Thank you received: 3
05 Oct 2022 18:19 #253553
by chienMouille
Replied by chienMouille on topic linear scale and AC servo set up - sanity check
ps: also now the axis goes back and forth between the two closest bits of the scale at rest (no command)
Please Log in or Create an account to join the conversation.
Time to create page: 0.154 seconds