Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Home to Hard Stop(s)

Home to Hard Stop(s) 2 years ago #1604

  • ssmith3
  • OFFLINE
  • Posts: 4
  • Karma: 0
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?

Re: Home to Hard Stop(s) 2 years ago #1605

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
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.
www.animatics.com/smartnews/267-smartnews-june-absolute-encoder-option-available.html

Re: Home to Hard Stop(s) 2 years ago #1606

  • ssmith3
  • OFFLINE
  • Posts: 4
  • Karma: 0
If I have continuous power, it there a way to detect hard stops at both ends of travel and set software travel limits?

Re: Home to Hard Stop(s) 2 years ago #1607

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
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.

Re: Home to Hard Stop(s) 2 years ago #1608

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
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
Last Edit: 2 years ago by csearcy.

Re: Home to Hard Stop(s) 2 years ago #1609

  • csearcy
  • OFFLINE
  • Posts: 480
  • Karma: 23
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
Last Edit: 2 years ago by csearcy.
The following user(s) said Thank You: Pegotz
  • Page:
  • 1
Moderators: hsummer, csearcy
Time to create page: 0.46 seconds