Scripting a MoveAxis COmmand not working properly.

A place to report problems and bugs in SharpCap
Forum rules
‍

If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs

Please also read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
remorgan
Posts: 5
Joined: Thu Feb 18, 2021 1:24 pm

Scripting a MoveAxis COmmand not working properly.

#1

Post by remorgan »

using SharpCap Pro 4.1.12946 64 bit and Green Swamp Server (GSS) 1.0.8.9

Connected to mount (GSS simulator) using the Test Camera 1 (Deep Sky). Tried running this script from SharpCap...

from SharpCap.Base.Interfaces import Axis
import time
SharpCap.Mounts.SelectedMount.MoveAxis(Axis.AxisPrimaryRAOrAzimuth, 0.004178907)
time.sleep(5)
SharpCap.Mounts.SelectedMount.MoveAxis(Axis.AxisPrimaryRAOrAzimuth, 0)
SharpCap.Mounts.SelectedMount.MoveAxis(Axis.AxisSecondaryDecOrAltitude, 0.004178907)
time.sleep(5)
SharpCap.Mounts.SelectedMount.MoveAxis(Axis.AxisSecondaryDecOrAltitude, 0)

The GSS sessions logs are showing the incoming commands from SharpCap....

2025-03-02 18:15:19.257|00179|Telescope|Driver|Information|23|MoveAxis|axisPrimary, 1.74597852918786E-05
2025-03-02 18:15:19.257|00180|Telescope|Driver|Information|23|CheckRate|axisPrimary|1.74597852918786E-05
2025-03-02 18:15:24.259|00181|Telescope|Driver|Information|24|MoveAxis|axisPrimary, 0
2025-03-02 18:15:24.259|00182|Telescope|Driver|Information|24|CheckRate|axisPrimary|0
2025-03-02 18:15:24.260|00183|Telescope|Driver|Information|24|MoveAxis|axisSecondary, 1.74597852918786E-05
2025-03-02 18:15:24.260|00184|Telescope|Driver|Information|24|CheckRate|axisSecondary|1.74597852918786E-05
2025-03-02 18:15:29.262|00185|Telescope|Driver|Information|7|MoveAxis|axisSecondary, 0
2025-03-02 18:15:29.262|00186|Telescope|Driver|Information|7|CheckRate|axisSecondary|0

I was expecting each MoveAxis command to be 0.004178907 not 1.74597852918786E-05

Any ideas where 1.74597852918786E-05 is coming from?

--Rob
Jean-Francois
Posts: 853
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Scripting a MoveAxis COmmand not working properly.

#2

Post by Jean-Francois »

Hello Rob,

The "normal" MoveAxis command takes a rate ... so 1x or 2x, ... sidereal.
I do not found where the factor 1.7459E-05 is coming from.

Jean-Francois
remorgan
Posts: 5
Joined: Thu Feb 18, 2021 1:24 pm

Re: Scripting a MoveAxis COmmand not working properly.

#3

Post by remorgan »

Not sure what you mean by "Normal". In ascom it's degrees/second. 0.004178907 should be a valid rate. Does sharpcap scripting use something different, may 1 or 1.5? I couldn't find any docs on it. 1.7459E-05 is coming from shaprcap so either the script input is wrong or the output to GSS is not right.

The math maybe this...

0.00419 * 15.01 / 3600 = 1.7469972222222222222222222222222e-5

what are the Sharpcap rates used for MoveAxis in sharpcap and is 0.00419 a valid rate?

--Rob
remorgan
Posts: 5
Joined: Thu Feb 18, 2021 1:24 pm

Re: Scripting a MoveAxis COmmand not working properly.

#4

Post by remorgan »

Jean-Francois,

That seems to check out. So rate for SelectedMount.MoveAxis is a double which is multiplier of sidereal.

i.e. 1 = 0.00417807462379006

So Rate * 15.01 / 3600 = sharpcap output to the driver.

--Rob
User avatar
admin
Site Admin
Posts: 17539
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Scripting a MoveAxis COmmand not working properly.

#5

Post by admin »

Hi,

yes, the MoveAxis command in SharpCap works by default in terms of multiples of sidereal rate, not degrees/second. If you want, you can bypass SharpCap's handling by getting the .AscomMount property of the SharpCap mount, giving you direct access to the ASCOM interface.

cheers,

Robin
Jean-Francois
Posts: 853
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Scripting a MoveAxis COmmand not working properly.

#6

Post by Jean-Francois »

Hello Rob,

You have (at least) 3 different ways to perform a movement of the mount with SharpCap.

A) the direct SharpCap way:
---------------------------
SharpCap.Mounts.SelectedMount.MoveAxis(0, 4) where "0" is the first mount axis, here RA
SharpCap.Mounts.SelectedMount.MoveAxis(1, -8) where "1" is the second axis, here DEC
The rate is "sidereal" factor. So 4 or -8 will move 4x or -8x sidereal speed.
SharpCap does the calculation for the mount command. It is simple to move a known speed.

To stop the axis movement:
SharpCap.Mounts.SelectedMount.MoveAxis(0, 0)
SharpCap.Mounts.SelectedMount.MoveAxis(1, 0)


B) with SharpCap, with the ASCOM command:
---------------------------------------
import clr
clr.AddReference("ASCOM.Common")
from ASCOM.Common.DeviceInterfaces import TelescopeAxis

k = 0.00417807
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(TelescopeAxis.Primary, 4 * k)
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(TelescopeAxis.Secondary, -8 * k)

To stop the axis movement:
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(TelescopeAxis.Primary, 0)
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(TelescopeAxis.Secondary, 0)

The rate parameter is the speed rate multiplied by the factor 0.00417807.

Alternative:
from SharpCap.Base.Interfaces import Axis
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(Axis.AxisPrimaryRAOrAzimuth, 4 * k)
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(Axis.AxisSecondaryDecOrAltitude, -8 * k)

To stop the axis movement:
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(Axis.AxisPrimaryRAOrAzimuth, 0)
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(Axis.AxisSecondaryDecOrAltitude, 0)



C) with ASCOM command (bypass SharpCap):
----------------------------------------
import clr
clr.AddReference("ASCOM.Com.dll") # used with SharpCap 4.1 and above
clr.AddReference("ASCOM.Common") # used with SharpCap 4.1 and above
import ASCOM.Com
from ASCOM.Com import *
from ASCOM.Com.DriverAccess import Telescope
from ASCOM.Common.DeviceInterfaces import TelescopeAxis, GuideDirection

tel = Telescope('ASCOM.GS.Sky.Telescope') # open a telescope

tel.MoveAxis(TelescopeAxis.Primary, 4 * k)
tel.MoveAxis(TelescopeAxis.Secondary, -8 * k)

To stop the axis movement:
tel.MoveAxis(TelescopeAxis.Primary, 0)
tel.MoveAxis(TelescopeAxis.Secondary, 0)



Concerning your calculation:
0.004178 * 15.041 / 3600 ....
The value 0.004178 is 15.041 / 3600 ... so you have (15.041 / 3600) * (15.041 / 3600) ... but in your first message, you have:

0.004178907 and SharpCap send 0.0000174597852918786. (Note the additional "9" in 0.004178907 )
0.004178907 / 0.0000174597852918786 = 236.34469586 ... and the inverse 1 / 236.34469586 = 0.0041780746 = 15.0410686 / 3600
And 15.0410686 = 360 / 23.934469586 ... and 23.934469586 is the sidereal time.

Yes, that check out.


In summary:
-----------
SharpCap.Mounts.SelectedMount.MoveAxis(0, 4) # where "4" is 4x sidereal.

or k = 0.00417807
SharpCap.Mounts.SelectedMount.AscomMount.MoveAxis(TelescopeAxis.Primary, 4 * k) # for 4x sidereal rate too

Note the "AscomMount" in the second command.


Regards,
Jean-Francois
Post Reply