Stopping the motor ...
 
Notifications
Clear all

Stopping the motor automatically at limit

2 Posts
1 Users
0 Likes
2,218 Views
(@mcconchiesm)
Posts: 0
New Member Guest
 

I have a motorized gantry where the vertical motion is performed with a SM34165DT-C motor running firmware version 5.0.1.0. The gantry has two Micro Switch LSP1A limit switches installed at the top and bottom of the travel. The switches are currently wired as closed with pin 13 on the I/O port passing through both switches and back to pins 3 and 4. Via the SmartMotor Playground software, I have confirmed that the IN() word knows when the switch lever has been actuated and have a working homing program that can use either IN(2) or IN(3). Is there a way to have the motor detect when the IN(2) and IN(3) changes value during normal motion (not during the homing routine) and stop immediately? Or is there a better way to detect when a lever on a limit switch has been actuated?

In case it's relevant, commands to move the motor are issued through the CANBus protocol using a custom LabView program. The same program calls custom subroutine on the motor when the user wants to home the gantry.

I read through the forum topic "Information needed for Right/Left (+/-) Limit input use", but I am not sure if it applies.

 
Posted : 29/01/2020 2:43 am
(@csearcy)
Posts: 0
New Member Guest
 

Yes. You can use EIGN(2) and EIGN(3) to make the over travel switches act like general purpose inputs during the homing routine.
After homing is complete and you have moved off of the over travel switches, you can issue the EILP and EILN commands to turn the switches back into over travel switches. If you make a move that runs into either one of them, the motor's firmware will stop the motor.. You will be able to detect this in your program and issue a ZS (Clear all Errors) and you will be allowed to make a move off of the switch. It will not let you keep going in the same direction... which was towards the switch. It will work that way on either end of travel.
It is your responsibility when to make the switches general purpose or over travel switches. When they are over travel switches, the motors firmware will cause the motor to stop and it will set status bits so you can detect that this has happened and which switch was hit. When they are commanded to be general purpose switches (like during the homing routine), it is your responsibility to make the motor stop, or it will run right past them and NOT stop until it hits something that does.

 
Posted : 29/01/2020 6:41 pm
Share: