about take a feedback and error detection in set speed and feeback

5 years 4 months ago #29530997 by maheshraje27891
i was write the script to detect the the error in set speed by analog input pot.1 and read a feedback and it will be compare it but is it not working what can i do now.....
my script is.....for vbl2360

in closed loop position tracking mode

dim set_speed as integer
dim Fedback as integer

top:


set_speed = getvalue(_AIC,2)

Fedback = getvalue(_F,2)

if (set_speed = Fedback) then

setcommand(_GO, 2, 0)

elseif(set_speed > Fedback)

setcommand(_GO, 2, -(set_speed - Fedback))

elseif(set_speed < Fedback)

setcommand(_GO, 2, (Fedback - set_speed ))
else

end if


goto top

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

5 years 4 months ago #29530998 by TechSupport
The else conditions is missing an argument, otherwise is ignored.

Try adding a wait(1) statement before goto top

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

5 years 4 months ago #29530999 by maheshraje27891
i want to send command from hyper terminal with given setting in user manual and i send this

!P 2 50
but it is nothing happen and i got same reply from controller

actually i don't know how should go to 50 rotation of motor and stop there until next position command

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

5 years 4 months ago #29531004 by TechSupport
To know if it even did anything is to query the counter. The !P command is for closed loop count position, therefore it won't do anything in your current position. You have to use !G.

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

Time to create page: 0.132 seconds