8i20/BLDC component, limited spindle speed

More
15 Jul 2018 21:32 - 15 Jul 2018 21:32 #114242 by PCW
can setsserial read parameters?

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
Last edit: 15 Jul 2018 21:32 by PCW.

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

More
15 Jul 2018 22:46 #114246 by blazini36
I think "setserial" the linux program can read but "setserial" the real time hal utillity does not mention it in the docs.

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.

More
16 Jul 2018 01:57 #114256 by blazini36
Setserial is literally driving me nuts. It literally takes like 10 tries to get it to successfully write 1 parameter with a power cycle between every one. Not a big deal for changing 1 thing 1 time, but to change 4 parameters a couple of times takes forever.

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.

More
16 Jul 2018 02:20 #114259 by PCW
Not sure what the timing issue with setsserial is, but you only need a power cycle before you use the NV values so there's no reason to power cycle each time

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.

More
16 Jul 2018 02:42 #114262 by blazini36
Well earlier on I realized that the hex values I posted were incorrect 1600 rather than 16000 for example. Once I figured that out I had to reset all the params several times now I'm back to the default.

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.

More
16 Jul 2018 03:20 #114270 by PCW
It may be that with your 6 pole motor 1900 RPM is as fast as you can go at a ~1 KHz servo thread, though this limit seems odd, as does the fact that lowering the current loop gain makes such a large difference (did you try increasing the current loop gain?)

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

More
16 Jul 2018 03:53 #114272 by blazini36
Yes, I tried doubling the PI and halving it as you suggested. Halving it dropped the speed to 800rpms with 1900 requested, doubling it had it topping out at 1800 but it was slightly less stable than original.

I suppose it pays to read the manual because I just noticed this:

Default values forNV KQP
and NVKDP are 50 and default values for NVKQI and NVKDI are 150000

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.

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.

More
16 Jul 2018 09:27 #114284 by andypugh

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.

More
16 Jul 2018 11:29 #114286 by blazini36

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.

More
16 Jul 2018 11:52 #114289 by andypugh

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.

Time to create page: 0.129 seconds
Powered by Kunena Forum