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

Reference/homing issue #114

Open
kevintom1995 opened this issue Aug 26, 2024 · 3 comments
Open

Reference/homing issue #114

kevintom1995 opened this issue Aug 26, 2024 · 3 comments

Comments

@kevintom1995
Copy link

kevintom1995 commented Aug 26, 2024

The TMCM-3212 module is not detecting the home sensor when doing the reference search. I used the reference search code from the TMCM3110 module. Is this the correct code to do the reference search for this module?
Reference #53

 def  go_to_home_position(self):
    print('Starting homing procedure')
    # Set reference speed
    self.motor.set_axis_parameter(self.motor.AP.ReferenceSearchMode, 7)
    self.motor.set_axis_parameter(self.motor.AP.ReferenceSearchSpeed, 10000)
    self.motor.set_axis_parameter(self.motor.AP.RefSwitchSpeed, 500)

    home_state=self.motor.get_axis_parameter(self.motor.AP.HomeSwitch)
    print(f'Home state: {home_state}')

    initial_status=self.get_reference_search_status(motor=0)
    print(f'Reference search status initially: {initial_status}')

    #Start reference search
    self.start_reference_search(motor=0, mode=7)
    print('Starting reference search')
    
    #waiting for reference search to complete
    while self.get_reference_search_status(0) != 0
         print('Reference search completed')

    #assigning the actual position to zero
    self.motor.set_axis_parameter(self.motor.AP.ActualPosition, 0)
@trinamic-ok
Copy link
Contributor

The code is correct for searching the home switch. Is the switch connected to the right input? For reference search mode 7, it needs to be connected to the HOME input. The HOME input is pin 3 of the REF / HOME connector (see page 15 in the hardware manual). A home switch can be connected between HOME and GND.

@kevintom1995
Copy link
Author

Actually, i got the issue resolved. I have used an optical switch which has a forward voltage of 1.7V and 20mA rated current. Since we are connecting it to the 5V output of the trinamic module, the excess voltage was converted into current and damages the switch. So adding a resistor in between the module and switch has solved the issue.
Thanks for responding!

@s-light
Copy link

s-light commented Dec 27, 2024

if your issue is solved please close it here in github :-)

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