Homing

Hi,

I am new in tic driver.
I am using tic825 to drive a stepper motor via python programming.
I use Pololu Tic Control Center to set the homing
Advanced settings: changed RC pin configuration to Limit switch reverse.
Then I can go home by
Deviced: Go home reverse
The motor can go reverse until home switch is activated and
go forward until home switch is deactivated.

I tried to do the same thing using ticcmd in python.
My code is attached.
homing.py (776 Bytes)

Motor move according to the new_target value, but the --home command seems not working.
There are no errors.
How to make the program work similar to the Control Centerā€™s ā€˜Go home reverseā€™?
Please advice.

Regards,
Tjun

Itā€™s possible that your homing sequence is not working as expected because you have not configured the Tic825 properly for homing. Specifically, you mentioned that you changed the RC pin configuration to ā€œLimit switch reverseā€ in the Pololu Tic Control Center, but you may need to do the same thing using the ticcmd utility.

OK, I thought that once it configured using control center, then no need to set the RC pin configuration.
What ticcmd should be used?
I couldnā€™t find any ticcmd to configure the RC pin to Limit switch reverse in the documentation.

Hello, tjun.

You are correct; once the Tic is configured using the Tic Control Center software, it will persist and those configuration settings will be used for the other control methods (with STEP/DIR being the exception since it bypasses the control signals being generated by the Tics processor).

It looks like there are just some errors in your code causing the issue. First, I would recommend putting a ticcmd('--exit-safe-start')command before your ticcmd('--energize') command at the beginning of your code. Then, the homing function will get interrupted by the --position command, so you could use a while loop similar to the one you have at the end of your code to wait until the ā€œHoming activeā€ bit is driven low (indicating the homing procedure is finished). For example:

ticcmd('--home', str('rev'))
sleep(0.01)
status = yaml.load(ticcmd('-d', '00405282', '-s', '--full'), Loader=yaml.FullLoader)

while status['Homing active'] == True:
    ticcmd('--reset-command-timeout')
    status = yaml.load(ticcmd('-d', '00405282', '-s', '--full'), Loader=yaml.FullLoader)
    sleep(0.01)

If those changes do not fix the problem, could you post an updated version of your code as well as a copy of your Tic settings file? You can save your Tic settings file from the ā€œFileā€ drop-down menu of the Tic Control Center while the controller is connected.

Brandon

Hi BrandonM,

It works!!
Thank you.

Before asking to this forum, I also put sleep(5) to wait until finishing the ā€œHomingā€ but it didnā€™tā€™ work.

Putting a ticcmd('--exit-safe-start') command before ticcmd('--energize') command fixed the problems.
Also, checking the Homing active status is great.

tjun

1 Like