Spindle encoder : PID loop : Integration with probe basic

More
15 Jun 2022 07:59 #245162 by EragonPower
Hello everybody,
i've mounted a magnetic encoder on my high speed spindle (256 PPR on a 24kRPM spindle) and using the PNCconf generated hal i've hooked it up fearly quickly. To be clear i'm using a mesa 7i76e. Complete HAL file (github.com/EragonPower/LinuxCNCMachineCo.../blob/master/CNC.hal)

Now, the first issue that i've encountered is that Probe Basic doesen't display the real time RPM but it thinks that the real RPM is equal to the comanded RPM, i've checked and everything looks right to me:

net spindle-revs <= hm2_7i76e.0.encoder.00.position
net spindle-vel-fb-rps <= hm2_7i76e.0.encoder.00.velocity
net spindle-vel-fb-rpm <= hm2_7i76e.0.encoder.00.velocity-rpm
net spindle-index-enable <=> hm2_7i76e.0.encoder.00.index-enable

net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable
sets spindle-at-speed true

How to i connect the spindle speed from the encoder to the spindle speed display? where do i net spindle-vel-cmd-rpm-abs to?

Second point, PID loop, i've tried changing PID values in many different ways, but none yielded closed loop capabilities in the way that someone would expect.

i'm quite unsure on what to do to be honest, has someone any idea?

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

More
15 Jun 2022 14:20 #245197 by spumco
Probe Basic is still under development and different versions may (do) have different features.  I, too, am missing the ability to connect the spindle encoder to the 'actual' RPM field in the display.

You might be able to figure out when this function was removed (intentionally or not) if you plow through the probe basic branches on github.

Best way to check if you have it is to open Halshow, and then open the qtpyvcp pins section.  You should see a number of pins that aren't part of 'normal' LCNC - rapid override, feed override, spindle load, etc.  If you have spindle-rpm-in or something like that, it's available.

If not, then the version/branch of Probe Basic you have installed does not have that feature available and no amount of fiddling in hal will get your actual spindle RPM displayed.

If you do have a spindle-rpm-in pin that shows up, it needs to be linked in the postgui.hal file.  That pin doesn't exist until after Probe Basic loads; in fact, all of the qtpyvcp pins need to be connected in the postgui file.

If you're confused, or didn't understand some (or all) of what I wrote, don't be shy - ask for clarification.  The amount of jargon in LCNC is staggering and it's hard to determine what level of understanding the questioner has.

For example - if you understood my second paragraph above, great.  If not, I can post screen shots of what you need to do (so you can also learn what the jargon/terms mean).  But it takes time to do that sort of thing - if you don't need serious hand-holding then we won't waste time on it.

Keep in mind that I'm not any kind of expert; I'm just a couple steps further along with LCNC and Probe Basic.

[Tommy - might want to move this to QTPYVCP]

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

More
15 Jun 2022 14:32 #245198 by tommylight

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

More
15 Jun 2022 16:02 #245211 by TurBoss
Hello,

> How to i connect the spindle speed from the encoder to the spindle speed display? where do i net spindle-vel-cmd-rpm-abs to?

you can try to net to qtpyvcp.spindle-encoder-rpm.in

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

More
16 Jun 2022 10:08 #245249 by EragonPower
Update:

i've checked in halshow, there is no qtpyvcp pin related to spindle speed sadly. while in halshow i've also found that the spindle encoder speed is spindle-vel-fb-rpm, on the other hand spindle-vel-fb-rpm-abs, the pin that the PID loop uses, is always =0, i might try to change the PID speed feedback loop and look if sonething changes.

#*******************
#  SPINDLE
#*******************

setp   pid.s.Pgain     [SPINDLE_0]P
setp   pid.s.Igain     [SPINDLE_0]I
setp   pid.s.Dgain     [SPINDLE_0]D
setp   pid.s.bias      [SPINDLE_0]BIAS
setp   pid.s.FF0       [SPINDLE_0]FF0
setp   pid.s.FF1       [SPINDLE_0]FF1
setp   pid.s.FF2       [SPINDLE_0]FF2
setp   pid.s.deadband  [SPINDLE_0]DEADBAND
setp   pid.s.maxoutput [SPINDLE_0]MAX_OUTPUT
setp   pid.s.error-previous-target true

net spindle-index-enable  <=> pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rpm-abs     => pid.s.command
net spindle-vel-fb-rpm-abs      => pid.s.feedback
net spindle-output        <=  pid.s.output

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

More
17 Jun 2022 03:08 #245295 by spumco
You can ask the Probe Basic devs if they know of a branch with a working encoder-feedback display field.

Lcvette mentioned he'd found an issue with it back in Jan so I'm guessing it's been removed from python3 branch until it gets sorted out.

forum.linuxcnc.org/qtpyvcp/44878-probe-b...help?start=10#233591

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

More
23 Jul 2022 19:45 #248139 by Lcvette
this has been rectified in the py3 master branch and is a setting selection in the settings section to switch between commanded and actual spindle rpm in the feedback display box. the associated configuration changes in the config files will also be required for it to work and function as expected. but there is no plan to add to the py2 branch, it will be a future feature when py3 branch is officially available and more documented, this will be shortly after the LCNC official 2.9 stable release on bookworm or which ever version is used for its debut.
The following user(s) said Thank You: spumco

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

More
24 Jul 2022 14:20 #248170 by EragonPower
So, tell me if i've understood correctly: i need to move to the py3 branch of PB to have this feature

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

More
24 Jul 2022 23:40 - 24 Jul 2022 23:41 #248203 by Lcvette
Correct, but that comes with its own set of trials and annoyances with upgrading linuxcnc while it's being worked on etc.

When py2 went obsolete it removed our ability to update probe basic installer and update so we decided to focus on the py3, qtpyvcp/ prove basic, debian 11, lcnc 2.9. The hope was lcnc official release would be sooner rather than later, unfortunately those hard working folks have been having a time getting everything ready so it's left us in a bit of an awkward position.

That said, i am working on a how to for installing deb11 bullseye and lcnc and qtpyvcp/probe basic.
Last edit: 24 Jul 2022 23:41 by Lcvette.
The following user(s) said Thank You: TurBoss

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

Moderators: KCJLcvette
Time to create page: 1.086 seconds
Powered by Kunena Forum