motors module¶
This is the most basic driver. It implement goto and track features in alpha/beta axis. It can be consider as AltAz mount but without aligment routines.
- class synscan.motors.motors(udp_ip='192.168.4.1', udp_port=11880)[source]¶
Implementation of motor commands and logic following the document: https://inter-static.skywatcher.com/downloads/skywatcher_motor_controller_command_set.pdf
IMPORTANT NOTES (based on the above doc):
In the motor controller, there is a hardware timer T1 that is used to generate stepping pulse for stepper motor or reference position for servomotor. The input clocks frequency of the timer, plus the preset value of this timer, determine the slewing speed of the motors.
For GOTO mode, the motor controller will take care of T1 automatically. But motion mode has to be set to tracking=False
When T1 generates an interrupt, it might:
Drive the motor to move 1 step (1 micro-step or 1 encoder tick) for low speed slewing.
Drive the motor to move up to 32 steps for high speed slewing. This method applies to motor controller firmware version 2.xx. For motor controller with firmware 3.xx or above, the motor controller always drive the motor controller 1 steps/interrupt.
Typical session:
Check whether the motor is in full stop status. If not, stop it.
Set the motion mode.
Set the parameters, for example, destination or preset value of T1.
Set the “Start” command.
For a GOTO slewing, check the motor status to confirm that the motor stops (Generally means arriving the destination. ). For a Speed mode slewing, send “Stop” command to end the session.
Generally, the motor controller returns to “Speed Mode” when the motor stops automatically.
NOTE: Methods begining with axis prefix act only onto selected axis.
- axis_set_goto_target(axis, targetDegrees)[source]¶
GoTo Target value in Degrees. Motors has to be stopped
- axis_set_goto_targetCounts(axis, targetCounts)[source]¶
GoTo Target value in StepsCounts. Motors has to be stopped
- axis_set_goto_targetIncrementCounts(axis, targetCounts)[source]¶
GoTo Target increment in StepsCounts. Motors has to be stopped
- axis_set_motion_mode(axis, Tracking, CW=True, fastSpeed=False)[source]¶
Set Motion Mode.
NOTE: Channel will always be set to Tracking Mode after stopped
Motion mode msg is 1byte msg (2 HEX digits)
HEX Digit 1 bits:
B0: 0=Goto, 1=Tracking
- B1: 0=Slow, 1=Fast (T)
0=Fast, 1=Slow (G)
B2: 0=S/F, 1=Medium
B3: 1x SlowGoto
HEX Digit 2 bits:
B0: 0=CW,1=CCW
B1: 0=Noth,1=South
B2: 0=Normal Goto,1=Coarse Goto
- axis_stop_motion_hard(axis, synchronous=True)[source]¶
Hard stop. If synchronous==True wait to finish
- counts2degrees(axis, counts)[source]¶
Return position or speed in degrees for a given counts or counts/seconds value
- degrees2counts(axis, degrees)[source]¶
Return position or speed in counts for a given deg or deg/seconds value
- get_parameters()[source]¶
Get main motor parameters. Some of this parameters are needed for all calculations so they have to be available to the rest of the code
Parameters are stored in a dict with te following keys:
countsPerRevolution
TimerInterruptFreq
StepPeriod
MotorBoardVersion
HighSpeedRatio
comm module¶
Module to manage UDP comunications. It should not be used by user but by the others drivers.
- class synscan.comm.comm(udp_ip='192.168.4.1', udp_port=11880)[source]¶
UDP Comunication module. Virtual. Used as base class. All members are protected
- _hex2int(data)[source]¶
- Convert data recived from motors following
Synscan Motor Protocol rules
24 bits Data Sample: for HEX number 0x123456, in the data segment of a command or response, it is sent/received in this order: “5” “6” “3” “4” “1” “2”.
16 bits Data Sample: For HEX number 0x1234, in the data segment of a command or response, it is sent/received in this order: “3” “4” “1” “2”.
8 bits Data Sample: For HEX number 0x12, in the data segment of a command or response, it is sent/received in this order: “1” “2”.
- _int2hex(data, ndigits=6)[source]¶
- Convert data prior to send to the motors following
Synscan Motor Protocol rules
24 bits Data Sample: for HEX number 0x123456, in the data segment of a command or response, it is sent/received in this order: “5” “6” “3” “4” “1” “2”.
16 bits Data Sample: For HEX number 0x1234, in the data segment of a command or response, it is sent/received in this order: “3” “4” “1” “2”.
8 bits Data Sample: For HEX number 0x12, in the data segment of a command or response, it is sent/received in this order: “1” “2”.