motor limits for arms, and other things


We have found that having limits in the arms and other moveable parts can help to make the robot easier to control. Originally, we used rotation counters and a variable that changed depending on where the arm was, but this took a lot of work to program.

We came up with a new method. Much easier to program. You will need to find your motor rotation limits so you can put those values in instead of ours.

NOTE: this method requires that you start with the arm/etc in the same position each time. we just start with it DOWN every time we run the code.

The the arm motors have a ‘when armup’, ‘when armdown’, and ‘when armstop’ that simply spins forward/reverse or stops.




We have used the code block below for the claw and arm range/limitation for without using any sensor. It works pretty much but you need to reset the arms position everytime before you start the program or you can run :running_man: the code block after you move the arm all the way down or up then reset the position and run code block autonomously. This is for controller by the way. If you need for autonomous programming, remove AND and controller button :radio_button: blocks. Keep messing with the reference values to catch right limitation. :stuck_out_tongue_winking_eye:

1 Like


Nice. Simpler version of what we have. You are using some modkit commands I have overlooked, specifically the ‘controller button e down’ one.