Stepper controlled servos doesnt move with Encoder feedback configured

  • Faggan
  • Faggan's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
08 Jun 2022 19:02 #244774 by Faggan
Hi,

I'm stuck on configuring LinuxCNC for my new machine. I'm sure there are people here that have the experience with LinuxCNC to help me.

The Machine: 
Controller hardware: MESA 7i76 + 7i89 from a 6i25
Movement hardware: ProNet servos and drivers
Control mode: Step/direction + Encoder feedback from the servos
Hal and Ini files attached.

Some background:
I have been trying to figure out the correct settings for the Hal and Ini file in relation to Step/direction control with encoder feedback for a while. To make things easier I decided to test them individually. I made a dummy Pncconfig with just step/direction control (no encoder feedback) to iron out some of the issues I had with scaling between LinuxCNC and the drivers. With that out of the way I added the encoders into the Pncconfig to test them out as well. They scale correctly and the numbers move in the desired direction when I move the machine manually. 

In short. The wiring and scaling works. (i think, i will get back to scaling further down)

The issue: 
When I first started LinuxCNC i had errors in relation to the hal file that Pncconfig created. This error was the same for all axis. The error seems to be related to these lines and that there are two connections to the same function:
net x-pos-fb     <= hm2_5i25.0.stepgen.01.position-fb
net x-pos-fb     => joint.0.motor-pos-fb
net x-pos-fb     <=  hm2_5i25.0.encoder.01.position
net x-pos-fb     =>  joint.0.motor-pos-fb

My assumption at the time was that because Pncconfig made too many connections to net x-pos-fb. Using all my available guessing power I commented out the top two (as you can see in the attached Hal file) and that got me past the errors and LinuxCNC started. 

However. I now can not move the axis. When I try to move them they start to oscillate. Something I guess is related to the PID tuning, Or lack there of. Instead what happens is that I get a FERROR. Not surprising considering the axis doesn't move. 

Raising the FERROR parameter in the hopes that i have some delay in the system that is causing this but the only change is that the error takes a little longer to show. Also not surprising.

To me it seems that the system has control over the servos since they oscillate when idle. My commands does however not cause any notable change in the position of the axis. Maybe a small one, but its hard to tell with the oscillation going on.  

Maybe something:
I have seen somewhere that the scaling for steps and encoders need to be the same. I do not grasp the concept fully though, is that in relation to machine units? IE the scaling need to both come down to 1mm of movement? Or is it pulse for pulse? I don't know if this is related at all. 

I am at a loss here. Can anyone help?
If you need more files or logs from the system to get a better picture of the issue just ask.
Attachments:

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

More
08 Jun 2022 20:06 - 08 Jun 2022 20:11 #244777 by PCW
Yes, the PID tuning will be very different with encoder feedback because of the delays
between command and feedback in the drive/motor/mechanics.

This will require lowering the P term by a large factor.

The step/dir and encoder scale must be set so  the encoder
position and stepgen position scale are correct (in machine units)

There need be no correspondence between step counts and encoder
counts other that they are scale properly in machine units (and in the same direction)
Last edit: 08 Jun 2022 20:11 by PCW.
The following user(s) said Thank You: Faggan

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

  • Faggan
  • Faggan's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
08 Jun 2022 21:02 #244781 by Faggan
When I have been testing the PID tuning I have been at around 60 in P value and even then without major instability. The frequency of the oscillation goes up with P but the axis is still stable. Would that be unreasonable with this in mind?

Ok, so no problem there then!

That doesn't solve my issue moving the axis though. Have I made an error in connecting the pins in Hal in some way then maybe?

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

More
08 Jun 2022 23:22 - 08 Jun 2022 23:22 #244788 by PCW
It most likely does not move (much) because you have no FF1 and MaxError is quite small

FF1 must be 1.000 on all joints

Lack of FF1 and MaxError = 0.0127mm means very little response

I would probably set MaxError to 0

(beware of runaways if you have step/encoder directions mis-matched)
Last edit: 08 Jun 2022 23:22 by PCW.

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

  • Faggan
  • Faggan's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
09 Jun 2022 20:31 #244818 by Faggan
FF1 at 1.000 works a lot better. Thank you!

MaxError? Is that the FERROR parameter?

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

More
09 Jun 2022 21:17 #244820 by PCW
Its settings like these in the hal file:

setp pid.x.maxerror 0.012700

I would set this to 0 (no bound) with encoder feedback
The following user(s) said Thank You: Faggan

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

More
09 Jun 2022 22:21 #244823 by BigJohnT
You might try my Mesa Configuration Tool to see if you get a better config.

JT

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

  • Faggan
  • Faggan's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
14 Jun 2022 11:25 #245108 by Faggan
Changing the parameters you mentioned PCW worked. Thank you. 

I now find myself with other issues related to PID tuning (I think)

All guides I have seen (if I understood them correctly) tells you to start to increase P until there is vibration on the axis and then back off. 
My issue is that from extremely low P values I have oscillation on the axis after a short move. During a move the oscillation is very small. 

I don't know how to get around this. If I try to use D gain to get rid of the "idle" oscillation I need to put so much D value on there that the axis now stutters when I do a commanded move. 

Increasing P gain only results in a higher frequency oscillation with higher amplitude. At P1 the amplitude is about 0,003mm. At P10 its around 0,06mm.



Is there any way of dampening the "idle" oscillation? 
Attachments:

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

More
14 Jun 2022 13:43 - 14 Jun 2022 13:55 #245119 by strahlensauger
I just added scales to my machine, so I know this can be frustrating, and there can be errors in the mechanical, in the electronics and in the hal and INI files...
Last edit: 14 Jun 2022 13:55 by strahlensauger.

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

More
14 Jun 2022 13:51 - 14 Jun 2022 13:59 #245122 by strahlensauger
I use 5 um scales, the encoder scale is 200. 
your encoder scale looks pretty high, maybe that is the reason your axis don't move.

​​​​​​200 means 200 scratches on the glass on 1 mm.
 
Last edit: 14 Jun 2022 13:59 by strahlensauger.

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

Time to create page: 0.117 seconds
Powered by Kunena Forum