Welcome, Guest

TOPIC: Homing to a hard stop example program

Homing to a hard stop example program 2 years 3 months ago #2264

  • Kurt
  • Kurt's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
In the homing to a hard stop example program, you switch from a MV move to a MT move after hitting the hard stop. Do I need a "G" to start the motor torque move?



'
GOSUB0 'go to home subroutine
'
END 'END OF PROGRAM
'
C0 'HOME ROUTINE
h=-500 'This is some home offset from hard stop
'to define home as zero
r=1
'Make r a -1 to reverse home direction

v=500000 'some faster home speed off of hard stop

PRINT("Homing motor",#13)
MV
V=-100000*r 'HOMING VELOCITY
A=1000 'HOMING ACCEL
E=30 'SETTING ERROR FOR HARD STOP LIMIT
'This may need to be changed
G 'start a velocity mode move

'The following line looks at the Position error status bit.
'You should expect to get a position error when you hit a hard stop.
WHILE Be==0 LOOP
'You will drop out of the above loop when Be equals 1
'i.e. you errored on position.

PRINT("Hit hard stop",#13)
PRINT("Switching to torque mode",#13)
T=-100*r
MT
WAIT=1000
PRINT("Setting position register",#13)
O=h*r 'Setting present position to HOME OFFSET value
X
E=500 'setting normal running error limit
V=v
MP
P=0
PRINT("Moving to Zero",#13)
G
TWAIT 'do nothing until trajectory is complete
PRINT("Motor is at Home",#13)
RETURN
Last Edit: 2 years 3 months ago by Kurt.
The administrator has disabled public write access.

Re: Homing to a hard stop example program 2 years 3 months ago #2265

  • csearcy
  • csearcy's Avatar
  • OFFLINE
  • Moderator
  • Posts: 459
  • Thank you received: 77
  • Karma: 23
Yes. A G is needed to change to any new mode.
The administrator has disabled public write access.
The following user(s) said Thank You: Kurt
Moderators: hsummer, csearcy, swalters, mmeyers
Time to create page: 0.231 seconds
Powered by Kunena Forum