Get motor command when !EX

4 years 6 months ago #29534050 by jyce
Hi,
I'm trying to do this :
setcommand(_EX, 1) ' enable emergency stop
top:
	value = getvalue(_M, 1) ' get motor command
goto top

value remains at 0 as long as emergency stop is enabled :(

Is there a way to change this behaviour ? Maybe a firmware fix ?

Best,

Please Log in or Create an account to join the conversation.

4 years 6 months ago #29534051 by Gabriel_Isko
Replied by Gabriel_Isko on topic Get motor command when !EX
This is correct behavior. An Emergency Stop locks the motor command at 0. All the FETs float during an Emergency Stop, so it would be inaccurate to allow the motor command to change since the controller isn't trying to achieve the motor command output.

What are you trying to accomplish in your application?

Please Log in or Create an account to join the conversation.

4 years 6 months ago #29534062 by jyce
Replied by jyce on topic Get motor command when !EX
Hi,
Thanks for your answer.
I would like to synchronize the emergency stop with the break (connected through one DOUT).
Right now, my script do the stuff but my MCU has to send the !MG command each time it send a command which is not 0
setcommand(_EX, 1) ' enable emergency stop

pvalue = 0

top:

	value = getvalue(_M, 1) ' get motor command

	' Stop
	if value = 0 then
		if pvalue <> 0 then
			gosub TimerSet
		end if
	end if
	
	' Go
	' Let my MCU remove the emergency stop condition
	if value <> 0 then
		if pvalue = 0 then
			gosub TimerReset
		end if
	end if
	
	pvalue = value
	
	gosub TimerUpdate

goto top

timerFlag = 0
TimerSet:
	timerFlag = 1
	settimercount(0, 1500)	' set timer
	settimerstate(0, 0) 	' start timer
return

TimerReset:
	timerFlag = 0
return

TimerUpdate:
	' check if timer has completed
	if timerFlag = 1 then
		if (gettimerstate(0) = 1) or ((getvalue(_DO, 1) and 1) = 0) then
			timerFlag = 0
			setcommand(_EX, 1) ' enable emergency stop
		end if
	end if
return

Please Log in or Create an account to join the conversation.

4 years 6 months ago #29534064 by Gabriel_Isko
Replied by Gabriel_Isko on topic Get motor command when !EX
Yes this is correct. Because the emergency stop is an emergency condition, it needs to be cleared manually.

Emergency stop is not designed to operate as a power release. Our controller cannot relinquish electronic control of a motor during normal operation.

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds