Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing reference search for module 6214 #96

Open
petertumfart opened this issue Aug 24, 2023 · 6 comments
Open

Missing reference search for module 6214 #96

petertumfart opened this issue Aug 24, 2023 · 6 comments

Comments

@petertumfart
Copy link

petertumfart commented Aug 24, 2023

Hi, there is no command for the reference search implemented for module 6214.

@JeffPS13
Copy link

Hello, was the reference search implemented for module 6214?

@trinamic-bp
Copy link
Contributor

Hi. There is no TMCL command that triggers some kind of homing routine (reference search). Something like this only exists for the CANopen firmware variant. With the TMCL firmware the host system must command such a procedure. Alternatively one could implement a homing routine with a TMCL script.

@trinamic-bp
Copy link
Contributor

Sorry, this was not correct, the TMCM-6214 does implement the RFS command.

@petertumfart
Copy link
Author

petertumfart commented Nov 13, 2023

Hi you have to call it via the interface, not via the motor (which was kind of unintuitive to me).

interface.reference_search(0, axis_nr) starts the reference search
interface.reference_search(1, axis_nr) stops the reference search
interface.reference_search(2, axis_nr) returns the status

motor[i].set_axis_parameter(motor.AP.ReferenceSearchMode, val) Sets the homing mode

@petertumfart petertumfart reopened this Nov 13, 2023
@trinamic-bp
Copy link
Contributor

Right, this is not very nice.

This is how it would look like in a minimal script:

from pytrinamic.connections import ConnectionManager
from pytrinamic.modules import TMCM6214

connectionManager = ConnectionManager("--interface kvaser_tmcl")

with connectionManager.connect() as myInterface:
    module = TMCM6214(myInterface)

    for i, motor in enumerate(module.motors):
        motor.set_axis_parameter(motor.AP.ReferenceSearchMode, 2)  # Search right stop switch, then search left stop switch.
        module.interface.reference_search(0, i)  # Start reference search

We could add a per motor function like with the TMCM-3110: TMCM3110.py#L42, to make it look better.

@JeffPS13
Copy link

Thank you both for the support. It would be great to have it implemented as a per motor function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants