8i20/BLDC component, limited spindle speed
It does look like the lo numbers are the KDI and KQI
and somehow they have been split into lo(w) and hi(gh) halves
so I think you were right in the first place with your asterisked commands
Please Log in or Create an account to join the conversation.
It works but it's actually kind of difficult to use. No matter what it throws an error even if the parameter is updated correctly, sometimes I have luck with the hex string, sometimes better luck with the decimal value so it takes a while when you have to flip the power off the remote device after each update.
I finally got the pid all changed and it limited the speed even further to around 800rpm when 2000 is requested. I suppose I should try to double them instead?
I tried writing to nvkqi for giggles but it throws a not found error. nvkqil does write eventually.
Please Log in or Create an account to join the conversation.
It seems like some sort of timing issue. Once you loadrt the setserial command the 8i20 immediately drops serial connection. Is there some setting that could help this?
Please Log in or Create an account to join the conversation.
What are your current linuxcnc tuning values?, these may also be your limiting factor
Please Log in or Create an account to join the conversation.
It didn't dawn on me until I was almost done that setting the servo thread in the halcmd script to double speed might help with setserial, and sure enough it did.
The most stable I can get the spindle running at 1900rpms with the PCs latency is
servo rate 800000
Pgain 0.1
Igain 1
Dgain 0
8i20 is back at defaults of
nvkdil 32000
nkdp 50
nvkqil 32000
nvkqp 50
Encoder is a 1000ppr differential in quadrature. BLDC component I believe starts the spindle looking at hall sensors in trapezoidal then moves to sinusoidal (qh mode).
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I suppose it pays to read the manual because I just noticed this:
Default, NVKDP and NVKQP are at 50, but NVKDIL and NKQIL are at 32000. NVKDIHI and NVKQIHI are at 0 while NVKDILO and NVKQILO are at 50000. If HI and LO are the limits they seem backwards and 150000 isn't even settable if the limit is 50000.Default values forNV KQP
and NVKDP are 50 and default values for NVKQI and NVKDI are 150000
Is it possible that this thing has a bad default flash? These parameters don't seem to make much sense when looking at the manual. Any chance you can investigate some off the shelf 8i20s or something.
As a side note I suppose the "funny cable" for Mesa Utillities is a USB-serial converter cable with a DB9 to RJ45 adapter?
Please Log in or Create an account to join the conversation.
It works but it's actually kind of difficult to use. No matter what it throws an error even if the parameter is updated correctly
It does, and this is documented in the manual page.
The reason for this is that it is called with "loadrt" in order to have access to the real-time communications link. But it then needs to exit with an error so you can "loadrt" it again. If it didn't quit with an error then HAL wouldn't allow you to re-load it.
The 8i20 is a bit unusual amongst smart-serial devices in that it is a bit less smart than most. The parameter discovery data is "faked" using the data here: github.com/LinuxCNC/linuxcnc/blob/master...tmot2/sserial.h#L227
I think that the gains were split in to high and low sections because they are ULONG in the manual, but that data length is not available in smart-serial.
In LinuxCNC 2.8 you can simply set the parameters in the HAL file. The new value is only written if it does not match the old one, to prevent wearing out the eeprom.
The high/low split will still be an issue in 2.8. Note that if you are changing the gains then changing the low part will have almost no effect, you might as well only change the high-order part.
Please Log in or Create an account to join the conversation.
It works but it's actually kind of difficult to use. No matter what it throws an error even if the parameter is updated correctly
It does, and this is documented in the manual page.
The reason for this is that it is called with "loadrt" in order to have access to the real-time communications link. But it then needs to exit with an error so you can "loadrt" it again. If it didn't quit with an error then HAL wouldn't allow you to re-load it.
The 8i20 is a bit unusual amongst smart-serial devices in that it is a bit less smart than most. The parameter discovery data is "faked" using the data here: github.com/LinuxCNC/linuxcnc/blob/master...tmot2/sserial.h#L227
I think that the gains were split in to high and low sections because they are ULONG in the manual, but that data length is not available in smart-serial.
In LinuxCNC 2.8 you can simply set the parameters in the HAL file. The new value is only written if it does not match the old one, to prevent wearing out the eeprom.
The high/low split will still be an issue in 2.8. Note that if you are changing the gains then changing the low part will have almost no effect, you might as well only change the high-order part.
I know the setserial errors are just "the way it is", that's OK I just mention it because when the write fails as it frequently was you don't know it actually did until you power down, run the start script, then re-check parameters. It becomes frustrating but as I said, success seems much more likely when the servo thread is at 500000 or so. Maybe this can be looked into and suggested in the docs?
I did try setting parameters in HAL but by running setp in halshow, not editing the hal file. These changes did not error and they were reflected in "watch" but they did not seem to do anything as they do when using setserial. Would it be the case that they have to load at startup?
I don't understand what you mean by changing the "high order" part. As I said it appears something is backwards or I'm misunderstanding the Lo-Hi. Default parameters are Hi-0, Lo-50000 with the gain at 32000 (assuming "nvkqil" is the gain and nvkqilo and nvkqihi are the limits). The manual suggests 150000 as the setting of "NVKQI".
If changing the LO part will have no effect what should I change the HO to? Should HO still be treated as the upper limit? Assuming I want to change nvkqil to 150000 do I set nvkqihi to 200000 and leave nvkqilo at 50000?
Please Log in or Create an account to join the conversation.
I did try setting parameters in HAL but by running setp in halshow, not editing the hal file. These changes did not error and they were reflected in "watch" but they did not seem to do anything as they do when using setserial. Would it be the case that they have to load at startup?
Which version of LinuxCNC are you using?
I don't understand what you mean by changing the "high order" part. As I said it appears something is backwards or I'm misunderstanding the Lo-Hi. Default parameters are Hi-0, Lo-50000 with the gain at 32000 (assuming "nvkqil" is the gain and nvkqilo and nvkqihi are the limits). The manual suggests 150000 as the setting of "NVKQI".
The nvqil should be the limit (according to the 8i20 manual).
nvqihi and nvqilo should be the high and low order halves of a long-int value. I don't actually recall _why_ they are split across two HAL parameters. The manual says that they are "ULONG" and the integer HAL pins are 32-bit (floats are 64-bit doubles)so it may be that I determined that they are a 64-bit value and had to spread across 2 32-bit pins.
Maybe PCW can advise?
Please Log in or Create an account to join the conversation.