Thread: Motor Limits
View Single Post
  #6   Spotlight this post!  
Unread 04-02-2006, 02:02
ForgottenSalad's Avatar
ForgottenSalad ForgottenSalad is offline
In search of a home...
AKA: Michael Wessler
no team
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Bethlehem, NH
Posts: 136
ForgottenSalad will become famous soon enoughForgottenSalad will become famous soon enough
Send a message via AIM to ForgottenSalad
Re: Motor Limits

EDIT: Ah, abw and sanddrag... beat me to it

The limit switch looks something like this.



You'd have to mount one at the far right and one at the far left to constrain the turret's movement. You'd then have to add those two lines of code and it should stop the motor when it hits either the far left (min) or far right (max) switch.

And as far as using a potentiometer, maybe there's a better way to do it, but I find it much easier for purposes of limiting motor movement to use the switches. Problem I had with the pot was getting instant stopping of the motor and sometimes the pot's base would turn with the motor, instead of just the bar turning, and it'd return feedback that was off and become useless for it's purpose. I find pots better for when you need to work with things along the motor's rotation, not for just stopping the motor at the ends.

Last edited by ForgottenSalad : 04-02-2006 at 02:14.