|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Motor Limits
Is there a way to make a limit on how far a motor can turn? We have our turret moutned on a tourntable. The mounts for the hopper are on the sides, and we don't want the motor to turn our gun right into them if its tracking for the green light.
We also have a gate that opens and clases and we dont want it to close too far. PS. Has anyone gotten their algorithm made and programmed for their gun to shoot yet? Thanks whoops sorry for posting it in the wrong forum... cmucam not programming Last edited by Idaman323 : 04-02-2006 at 01:57. |
|
#2
|
||||
|
||||
|
Re: Motor Limits
We're using limit switches to do the same type of thing. Two limit switches came in the kit.
If your motor was hooked to pwm01 you'd use... Limit_Switch_Max(rc_dig_in01, &pwm01); Limit_Switch_Min(rc_dig_in02, &pwm01); That would (should) stop your turret's turning as soon as it hits the limit switches. DISCLAIMER: I have not yet physically tested this yet, I didn't use any limit switches last year, and didn't get to test if that was stopping our turret today. I compiled and uploaded, but never tested the switches. That *should* work though. You could also do it with a pot (I originally tried this way) but the limit switch, in my opinion, is much easier. Last edited by ForgottenSalad : 04-02-2006 at 01:51. |
|
#3
|
|||
|
|||
|
Re: Motor Limits
Is the limti switch something in the program or or a piece of equipemtn to put on. Im not at our "workshop" so I cant look now..
|
|
#4
|
|||
|
|||
|
Re: Motor Limits
It is just small switch (physical) with a little metal arm on it to make it easier to press. See this pic http://www.omron.com.au/product_info...mit_switch.jpg You mount the switch such that when the device reaches maximum travel, the switch is pressed. The RC reads the state of the switch as being closed. And your program shuts off the motor (in that direction) accordingly.
|
|
#5
|
|||||
|
|||||
|
Re: Motor Limits
It is a physical switch you mount so that it gets pressed when your turret is at the maximum extent of its rotation.
You could also put a potentiometer (analog sensor) or encoder (digital sensor) on the turret shaft/motor and limit the rotation manually in software. |
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
Re: Motor Limits
Okay, does that need to hook up to anything special? Victor (Dont think so), Spike (dont think so either). Does it just need power to run?
And does anyone know by chance how many of these you get with the kit? |
|
#8
|
||||
|
||||
|
Re: Motor Limits
Two came in the kit this year.
You have to hook them up to the digital inputs on the RC. Make sure your programmer sets them right in the code and your electrician wire them up correctly and you should be set. Last edited by ForgottenSalad : 04-02-2006 at 02:14. |
|
#9
|
|||
|
|||
|
Re: Motor Limits
Heh, Im not only the driver, but the only programmer we have. I am also the youngest on the team, 15..
We arn't meeting til Monday so I wont be able to check it out till later. We may need like 2 more, for our gate. Or mayeb we can somehow just make sure we dont hit it farther then needed Saves some money. Since we have a team of 10. Ya need all the help and money you can get, hehe.Thanks for all the quick replys! So has anyone set up their algorithm for the gun yet? |
|
#10
|
||||
|
||||
|
Re: Motor Limits
As far as saving money goes, I'm pretty sure you can get them at radioshack for a pretty cheap price. On a different note, good luck with your robot this year! I hear "turret" and "gate" in your posts... I draw that you might be going for both...
|
|
#11
|
|||
|
|||
|
Re: Motor Limits
gate meaning the side goals? That wasn't what I was reffering to. But our end robot will be able to push a ball or two in there if needed. The gate I was reffering to was the motor that opens and shuts the opening for the balls dropping into the gun. Because you dont want to make a shot from accross the field... thatd be ridiculous
... but cool if we made it.Were definatly getting closer, our teacher is getting nervous that we wont finish it, heh. Ill check radioshack on Monday or tomorow if I am by there see if they have them. Thanks. |
|
#12
|
||||
|
||||
|
Re: Motor Limits
Heh, our local radioshack appearantly doesn't stock them though I could swear I've seen them there before. I don't know if yours will, I haven't checked the website if any of the stores stock them.
|
|
#13
|
|||||
|
|||||
|
Re: Motor Limits
Quote:
|
|
#14
|
||||
|
||||
|
Re: Motor Limits
Limit switches definetly recommended for physical stops over pots. We had a problem last year with a pot rotating with our arm, causing one side to only shut off when it hit the limit switch, and preventing us from turning in the other direction because we designed the code to stop if it hit a certain pot value or the limit switch. A locked arm was pretty close to useless.
On the note of a gate to stop balls, you might want to use a pneumatic or servo instead. It won't be a massive amount of weight to hold back so either of these should work, if you already have pneumatics you might as well use one more (that's what we're going with). |
|
#15
|
|||
|
|||
|
Re: Motor Limits
Well, the gate I think we decided on the window motor. And when the limit switch is hit, it will stop the motor. Will the motor still be able to turn in the opposite direction. BEcause we dont want a locked arm.
And I just went to Radio Shack, they had them. They only had two left. They were only $2.69 so I decided to buy them right then. http://www.radioshack.com/product/in...entPage=search |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|