-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KX2 power calculation fails #1205
Comments
Oh, and based on the hamlib debug output, it looks like power2mW just gives up:
|
Thanks for the prompt fix, but It doesn't appear to be enough. With the KX2 set to 7.230 MHz CW and 4.8W:
Changing the mode doesn't help. Switching to 14.07615 MHz CW 4.8W yields a number, but it is wrong:
This is with the current 4.5.4 branch hamlib (df8c625). In case it helps, here's the range related output from '1':
(The remaining ranges are empty.) |
… KPA availability We are ignoring the tx_range values for the Kn series #1205
… KPA availability We are ignoring the tx_range values for the Kn series #1205
Thanks again. Trying latest master branch (eb90414) things work but aren't quite as precise as one would like.
It is using "PC" to get the current power level which gives the KX2 responds with anything between "PC000;" (near zero/zero power) and "PC010;" (10W). This is not enough precision to be able to calculate the power accurately in \power2mW. Here's a sampling of what happens. KX2 power setting -> \get_level value -> \power2mW result:
This is all the precision that the standard PC format offers, but the Elecraft doc suggests that the "K2 extended mode" gives 0.1W resolution instead of just 1W resolution. The doc says:
Earlier, the manual describes the K22 mode as:
At least skimming through the manual, it looks like it should be safe to enable the extended mode on rig open and then interpret the PC value appropriately. However, for all I know there are assumptions in some of the other Kenwood/Elecraft rig code that'd trip up on possible changes in FW, ID, and KY behavior. |
Seems to work much better now (most of the values are spot-on). There is a tiny bit of a rounding error for some of the power settings, but when it is off, it is off by only 1mW. As before, KX2 power setting -> \get_level value -> \power2mW output: 0.3W -> 0.02 -> 0.299W For example, during the last one (9.8W) the KX2 responds to PC with: PC0980; My (unsubstantiated) guess is that it is the float to unsigned int conversion that isn't getting the rounding just right. Thanks. |
If you print those values with "%g" you should get the right answer.
Mike W9MDB
On Saturday, January 7, 2023 at 01:47:15 PM CST, jeffpc ***@***.***> wrote:
Seems to work much better now (most of the values are spot-on). There is a tiny bit of a rounding error for some of the power settings, but when it is off, it is off by only 1mW. As before, KX2 power setting -> \get_level value -> \power2mW output:
0.3W -> 0.02 -> 0.299W
0.5W -> 0.033333 -> 0.499W
9.0W -> 0.600000 -> 9.000W
9.8W -> 0.653333 -> 9.799W
For example, during the last one (9.8W) the KX2 responds to PC with: PC0980;
My (unsubstantiated) guess is that it is the float to unsigned int conversion that isn't getting the rounding just right.
Thanks.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
I'm not sure how %g would help. The power (in mW) returned by rig_power2mW is an unsigned int. rigctl prints it as %i and that value is already wrong. IOW, it is not a printing issue:
|
Should be reflecting correct values now |
Confirmed, \power2mW seems to show the correct number now. Thanks. |
I have C code that uses rig_get_level & rig_power2mW to obtain the current power level setting. This code works fine with FT-991A (model 1035) but fails with KX2 (model 2044).
Specifically, the call to rig_power2mW returns -1. The values I pass in are 0.266667 for the power (but all the values I obtain from rig_get_level fail the same way; the range appears to be [0,0.6666667]), 7230000 for the frequency, and 2 for the mode (LSB). The same appears to happen when I try to use \power2mW in rigctl:
The host is running FreeBSD with hamlib 4.4.
I traced the "conversation" between hamlib and the KX2, and saw (H = hamlib, R = radio):
Based on my reading of the K & KX programmer's reference, the requested power output level ("PC") uses a format in 1W increments unless the K2 extended mode is used at which point it uses 0.1W increments. The KX2 allows power setting in 0.1W increments.
The text was updated successfully, but these errors were encountered: