SDC2160S for linear motor control using relative optical encoder.

9 years 5 months ago - 9 years 5 months ago #29528478 by psykokwak
Hi all,
I have a linear motor with a relative position feedback using an optical encoder.
Is there a way to force minimal position at startup to initialize the counter ?

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

9 years 5 months ago #29528486 by Griffin Baker
Are you trying to set the actuator to retract to the minimum and then set that as the minimum value?

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

9 years 5 months ago #29528488 by psykokwak
I've made a simple script that starts at startup :
print("starting....\r")

setcommand(_G, 1, -1000)' set motor command to minimum position
top:
value = getvalue(_M, 1) ' get motor command
	
if value = -1000 then
setconfig(_MMOD, 1, 0) ' mode open loop
setcommand(_SENCNTR, 1, 0) ' reset counter
else
setconfig(_MMOD, 1, 2) ' mode closed loop relative position
end if

wait(10)

goto top

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

9 years 5 months ago #29528489 by Griffin Baker
So I take it that you are looking to see if the controller could did this in a different manner that does not require a script?

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

9 years 5 months ago #29528490 by psykokwak
Yes.
But this script solution works for me!
Maybe it can be improved.

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

9 years 5 months ago - 9 years 5 months ago #29528491 by Griffin Baker
The script is the only route currently for what you are looking to do. What are you looking to improve on the script?

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

9 years 5 months ago #29528492 by psykokwak
If I interrupt the move when ask the motor position -1000 (min) I loose the position value.
In my use case it should not be a problem but it's not a proper solution.

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

Moderators: tonysantoni
Time to create page: 0.074 seconds