Menu

Topic-icon Home finding routine on boot up

More
3 months 1 week ago #29533490 by call8212

I am new to microbasic, but not new to programming, and am trying to get a homing code to find the reverse limit switch on boot up. I downloaded an example of a home finding script from here: www.roboteq.com/index.php/technology-menu/microbasic-technology and have been trying to understand it. Basically I have a SDC2160 controller connected to an quadrature encoder. I have a limit switch (NC) on digital pin 3. I don't understand what it means to load the home counter. I can get it into the "if" statement and start to move back but then it will freeze and stop moving and I can't regain control until I manually press the limit switch.

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

More
2 months 4 weeks ago #29533503 by Gabriel_Isko

Hey, Sorry for the late response. Somehow this post slipped through my radar.

The idea behind loading home counter values is that you can set reference values for your encoder and home counter that correspond to your applications home position. Therefore, if you modify the position of your output, you have a simple way to re-calibrate the home of your system. Check out the documentation for the BHOME, EHOME, and H commands in Section 19 in our User Manual .

The idea behind the sample script is that it moves until the limit switch is pressed, and then sets the motor channel up for position relative mode. I'm actually working on an improved version of that script that should be agnostic to the motor output mode that you wish to use. For now, the main useful part of that script is the part that monitors for a digital input to find the home position of a system.

Let me know your progress on this script and I can provide more assistance.

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

More
2 months 4 weeks ago #29533504 by call8212

Thanks for the response, I got it working! I came across EHOME and H commands and understanding those commands got it working good.

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

Time to create page: 0.069 seconds
Go to top