Skip to content

Commit

Permalink
"#484-jog_ppt separated"
Browse files Browse the repository at this point in the history
  • Loading branch information
r-yamada1998 committed Oct 6, 2023
1 parent 70ad026 commit cca0d1e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions neclib/devices/motor/cpz7415v.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,19 @@ def _start(
with busy(self, "_busy"):
self.motion[axis]["speed"] = speed
self.motion[axis]["step"] = int(step)

# from Kunizane Master thesis on the antena motion
axis_mode = [self.motion_mode[axis]]
self.io.set_motion(axis=axis, mode=axis_mode, motion=self.motion)
self.io.start_motion(
axis=axis, start_mode="const", move_mode=self.motion_mode[axis]
if self.motion_mode[axis] == "ptp"
self.io.set_motion(axis=axis, mode=axis_mode, motion=self.motion)
self.io.start_motion(
axis=axis, start_mode="const", move_mode="ptp"
)
elif self.motion_mode[axis] == "jog":
self.motion[axis]["speed"] = int(abs(5e-3*self.speed_to_pulse_factor[axis]))
self.io.set_motion(axis=axis, mode=axis_mode, motion=self.motion)
self.io.start_motion(axis=axis, mode=axis_mode, move_mode="jog")
time.sleep(0.02)
self.io._change_speed(abs(speed), axis)

def _stop(self, axis: Literal["x", "y", "z", "u"]) -> None:
self.logger.debug(f"Stopping {axis=}. May indicate drive direction reversal.")
Expand Down

0 comments on commit cca0d1e

Please sign in to comment.