Homes robot. More...
Functions | |
def | homing_script.homing () |
homes robot from which our inverse kinematics are with respect to More... | |
Variables | |
homing_script.pinC3 = pyb.Pin (pyb.Pin.board.PC3, pyb.Pin.IN) | |
homing_script.pinC2 = pyb.Pin (pyb.Pin.board.PC2, pyb.Pin.IN) | |
homing_script.enc1 = EncoderReader.EncoderReader(1) | |
homing_script.enc2 = EncoderReader.EncoderReader(2) | |
homing_script.ENA = pyb.Pin (pyb.Pin.board.PA10, pyb.Pin.OUT_PP) | |
homing_script.IN1 = pyb.Pin (pyb.Pin.board.PB4, pyb.Pin.OUT_PP) | |
homing_script.IN2 = pyb.Pin (pyb.Pin.board.PB5, pyb.Pin.OUT_PP) | |
homing_script.tim3 = pyb.Timer (3, freq=20000) | |
homing_script.ENB = pyb.Pin (pyb.Pin.board.PC1, pyb.Pin.OUT_PP) | |
homing_script.IN3 = pyb.Pin (pyb.Pin.board.PA0, pyb.Pin.OUT_PP) | |
homing_script.IN4 = pyb.Pin (pyb.Pin.board.PA1, pyb.Pin.OUT_PP) | |
homing_script.tim5 = pyb.Timer (5, freq=20000) | |
homing_script.mot1 = motor_drv.MotorDriver(ENA, IN1, IN2, tim3) | |
homing_script.mot2 = motor_drv.MotorDriver(ENB, IN3, IN4, tim5) | |
int | homing_script.limit_trigger1 = 0 |
int | homing_script.limit_trigger2 = 0 |
Homes robot.
The robot spins each axis one at a time until the limit switch is hit. This physical contact on the first arm disables the motor then spins the second arm until it has reached its respective limit switch.
def homing_script.homing | ( | ) |
homes robot from which our inverse kinematics are with respect to
This function moves one robot arm at a time until the limit switch is reached, thus breaking out of the loop and activating the second motor arm. Once the home is reached, confirmation statements are printed to the screen.