sync encoder with magsensor

8 years 6 months ago #29529857 by Faisal_engr
kindly tell me how i sync or take feedback from encoder in close count position mode and take magnetic guide sensor as a command because when i am taking command from magnetic guide sensor and feedback from encoder in count position mode the motor stops working and i am taking multipwm signal from magnetic guide sensor

thanks and hoping for a quick reply

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

8 years 6 months ago #29529858 by TechSupport
What controller are you using? Closed loop count requires a command be issued via serial, so to do this via the setup you want, you would likely need to write a script.

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

8 years 6 months ago #29529859 by Faisal_engr
i am using sdc2130 controller and then how i sync it with magnetic guide sensor kindly help me

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

8 years 6 months ago #29529860 by TechSupport
You wire your encoders to the encoder lines. Disable both pulse inputs 1 and 2 completely (uncheck checkboxes, set to no action, and disabled).

Wire up the pwm out from the sensor to an available pulse input feed. In the conversion type, you set it to magsensor.

Then you would need to write a script that queries the magsensor and gives the controller a command to the motor.

Please review the usermanual for all command references and queries.

For scripting: 'not case sensitive

If you use pulse input 3 for your magsensor then it would look like this.

dim magsensor as integer
top: 'loop label
magsensor = getvalue(_PI, 3)

to give a command to tell the motor 1 to go to count to count position 100, you would use the following.

setcommand(_P, 1, 100)

so with that in mind you can use 'if then' statement arguments to tell the motor how it needs to behave. Here is a sample.


dim magsensor as integer
top: 'loop label
magsensor = getvalue(_PI, 3)

if magsensor = 50 then
setcommand(_P, 1, 1000)
elseif magsensor = 75 then
setcommand(_P, 1, 1500)
end if
wait(1) ' wait 1 mS
goto top
The following user(s) said Thank You: Faisal_engr

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

8 years 6 months ago #29529861 by Faisal_engr
thanks i will try this procedure and will come back to you thanks

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

8 years 6 months ago #29529862 by Faisal_engr
i am using encoder as a feedback and send command from console and script
the command is
setcommand(_p,2,1000)
but it doesnt effect motor and motor doesnt rotate and do anything..
kindly tell me what i should do to solve the problem the controller is sdc2130

waiting for your reply

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

8 years 6 months ago #29529863 by TechSupport
Is your encoder wired to correct pins?

Did you completely disable the corresponding pulse inputs that share that same line?

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

8 years 6 months ago #29529864 by Faisal_engr
yes i disable the corresponding pins and also use the right encoder pins

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

8 years 6 months ago #29529865 by TechSupport
Please download and run this program.

www.teamviewer.com/en/download/windows.aspx

then send an email to This email address is being protected from spambots. You need JavaScript enabled to view it. with the id and password it assigns you.

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

8 years 6 months ago #29529866 by Faisal_engr
right now i dont have anything , i am at home and just trying to know the issue.... is controller should work on a given command or i have to do some other things also

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

Moderators: tonysantoni
Time to create page: 0.076 seconds