stepper_motor_base
frog.hardware.plugins.stepper_motor.stepper_motor_base
¤
Provides the base class for stepper motor implementations.
Attributes¤
Classes¤
StepperMotorBase(hot_bb_angle, cold_bb_angle)
¤
Bases: Device
A base class for stepper motor implementations.
Create a new StepperMotorBase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hot_bb_angle
|
float
|
Angle of hot black body relative to nadir (degrees) |
required |
cold_bb_angle
|
float
|
Angle of cold black body relative to nadir (degrees) |
required |
Subscribe to stepper motor pubsub messages.
Source code in src/frog/hardware/plugins/stepper_motor/stepper_motor_base.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Attributes¤
ANGLE_PRESET_DEFAULTS = frozendict(zenith=180.0, nadir=0.0, home=0.0, park=90.0)
class-attribute
instance-attribute
¤
Values for preset angles that the mirror can rotate to.
This does not include angles for hot_bb and cold_bb as these can be configured by users.
angle
property
¤
The current angle of the motor in degrees.
Returns:
| Type | Description |
|---|---|
float
|
The current angle |
is_moving
abstractmethod
property
¤
Whether the motor is currently moving.
step
abstractmethod
property
writable
¤
The current state of the device's step counter.
steps_per_rotation
abstractmethod
property
¤
The number of steps that correspond to a full rotation.
Functions¤
move_to(target)
¤
Move the motor to a specified rotation and send message when complete.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
float | str
|
The target angle (in degrees) or the name of a preset |
required |
Source code in src/frog/hardware/plugins/stepper_motor/stepper_motor_base.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
send_move_end_message()
¤
Send a message containing the angle moved to, once move ends.
Source code in src/frog/hardware/plugins/stepper_motor/stepper_motor_base.py
102 103 104 | |
signal_is_opened()
¤
Signal that the device is now open.
Source code in src/frog/hardware/plugins/stepper_motor/stepper_motor_base.py
44 45 46 47 | |
stop_moving()
abstractmethod
¤
Immediately stop moving the motor.
Source code in src/frog/hardware/plugins/stepper_motor/stepper_motor_base.py
68 69 70 | |