Home to Hard Stop(s...
 
Notifications
Clear all

Home to Hard Stop(s)

6 Posts
1 Users
0 Likes
11 K Views
(@ssmith3)
Posts: 4
New Member Guest
Topic starter
 

I am looking for a simple way to detect hard stops at both ends of travel and then operate between these values even after a power shut down. Should I use the Software limits for this or is there a better method?

 
Posted : 22/09/2014 5:42 am
(@csearcy)
Posts: 316
Reputable Member Guest
 

The only way you can know position after a power shut down is to use the absolute encoder option.
The following link shows what motors support this option.
http://www.animatics.com/smartnews/267-smartnews-june-absolute-encoder-option-available.html

 
Posted : 22/09/2014 12:18 pm
(@ssmith3)
Posts: 4
New Member Guest
Topic starter
 

If I have continuous power, it there a way to detect hard stops at both ends of travel and set software travel limits?

 
Posted : 24/09/2014 4:23 am
(@csearcy)
Posts: 316
Reputable Member Guest
 

Yes. Home to one end with the Home to Hard Stop example (Zero your position with an offset and trap the position value into a variable). When it completes, home to the hard stop on the other end. Trap the position at the other end into a variable. Set your soft limits based on the two trapped values.

 
Posted : 24/09/2014 10:58 am
(@csearcy)
Posts: 0
New Member Guest
 

What version of firmware are you using? Class4 or Class5?

Here is a Class4 version... it finds ends of travel by AMPS command.. then cycles between points.

'This is a Class4 Bench Test... with nothing connected to the shaft.
'Firmware versions 4.75 to 4.95 should compile and run this code.
SADDR1 UCI UDI ZS F=32 'Motor1 Init.. no limit switches
AMPS=100 'You should be able to stop the shaft with your fingers
E=1000 'This is default.. but you may want to set it lower
MV 'Put the motor in velocity mode
V=-100000 'Set a speed in the Negative direction
A=1000 'Set an Accel/Decel
G 'Start motion
TWAIT 'Wait for the hard stop
WAIT=2048 '2048=1/2sec in Class4
O=100 'set some value away from the hard stop!
V=100000 'Set a speed in the Positive direction
ZS 'Clear Errors
G 'Start motion
TWAIT 'Wait for the other hard stop
WAIT=2048 '2048=1/2sec in Class4
SLN=0 'Set your Negative Soft Limit to some value
SLP=@P 'Set your Positive Soft Limit to some value
SLE 'Enable Soft Limits
mm=@P-100 'Set a positon for some moves
m=mm/2 'Set another
E=1000 'Make sure the error limit is back to default
AMPS=1000 'Make sure AMPS is at 1000
MP 'Set the motor to Position Mode
P=m 'Set a position
V=300000 'Set a velocity
A=4000 'Set the accel/decel
ZS 'Clear errors
G 'Start motion
TWAIT 'Wait for motion to complete
r=m/2 'Do some math for positon
rr=m+r 'Do some more
P=m G TWAIT 'Go to whatever variable m came out to be
WAIT=1000 'wait about 1 second
WHILE 1 'This starts an endless loop
P=r G TWAIT 'Move and wait until the move completes
WAIT=1000 'wait about 1 second
P=rr G TWAIT 'Move and wait until the move completes
WAIT=1000 'wait about 1 second
LOOP 'This is the end of the endless loop
END
C1 'This subroutine runs whenever an error is detected.
ZS 'Deal with error conditions before you execute this command
RETURN

 
Posted : 24/09/2014 4:43 pm
(@csearcy)
Posts: 0
New Member Guest
 

Here is an example for Class5.

'This is a Class5 Bench Test... with nothing connected to the shaft.
ADDR=1 EIGN(2) EIGN(3) ZS 'Motor1 Init.. no limit switches
AMPS=100 'You should be able to stop the shaft with your fingers
EL=1000 'This is default.. but you may want to set it lower
MV 'Put the motor in velocity mode
VT=-100000 'Set a speed in the Negative direction
ADT=1000 'Set an Accel/Decel
G 'Start motion
TWAIT 'Wait for the hard stop
WAIT=1000 'Wait 1 sec
O=100 'set some value away from the hard stop!
VT=100000 'Set a speed in the Positive direction
ZS 'Clear Errors
MV
WAIT=1000 'Wait 1 sec
G 'Start motion
TWAIT 'Wait for the other hard stop
WAIT=1000 'Wait 1 sec
SLN=0 'Set your Negative Soft Limit to some value
SLP=PA-100 'Set your Positive Soft Limit to some value
SLE 'Enable Soft Limits
mm=PA-200 'Set a positon for some moves
m=mm/2 'Set another
EL=1000 'Make sure the error limit is back to default
AMPS=1000 'Make sure AMPS is at 1000
MP 'Set the motor to Position Mode
PT=m 'Set a position
VT=300000 'Set a velocity
ADT=40 'Set the accel/decel
ZS 'Clear errors
G 'Start motion
TWAIT 'Wait for motion to complete
r=m/2 'Do some math for positon
rr=m+r 'Do some more
PT=m G TWAIT 'Go to whatever variable m came out to be
WAIT=1000 'wait 1 second
WHILE 1 'This starts an endless loop
PT=r G TWAIT 'Move and wait until the move completes
WAIT=1000 'wait 1 second
PT=rr G TWAIT 'Move and wait until the move completes
WAIT=1000 'wait 1 second
LOOP 'This is the end of the endless loop
END

 
Posted : 24/09/2014 6:57 pm
Share: