|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Potentiometer code
If I want CIM motor to be locked (I mean I dont want it to move even if someone tries to move it) what can I do in my code.
I dont think I can do something like that but my friends insist. Last edited by cilginbilgin : 04-02-2011 at 14:48. |
|
#2
|
||||
|
||||
|
Re: Potentiometer code
A motor not moving is a quality of the gears not the program. you cant do anything without burning up the motor
|
|
#3
|
||||
|
||||
|
Re: Potentiometer code
Quote:
Quote:
First to be sure I am understanding what you guys want to do: When the robot is stopped you want the robot to resist being pushed, correct? The first and simplest step is to move the jumper on the speed controllers from coast to break. When you spin an electric motor it becomes a generator, this jumper configures the speed controller so that when you spin the motor (by pushing the robot) the motor leads are shorted and the motor resists being pushed. This will prevent the robot from rolling, however if you push it hard enough it will still move (if you can overcome the friction). The other solutions are more complicated. You can uses the Accelerometer and Gyro to detect changes in position that occur when they shouldn't. If the robot is not receiving commands to move then have it monitor the gyro and accelerometers. If the Gyro or Accelerometers show that the robot is moving then have the bot try to oppose that motion by driving or turning towards the force (in the opposite direction of the motion). This will get you some of the results you want, but I warn you, it wont be perfect, and in my experience it is more trouble than it is worth. Edit: This combined with your other thread that I just repiled to makes me think that you are trying to do this with a motor on an arm, not with the drive motors. If this is the case your PID control (that you are working on in the other thread you created should handle this pretty well, if it is in one position it should stay there even if you try to move it. Last edited by JamesBrown : 04-02-2011 at 11:13. |
|
#4
|
||||
|
||||
|
Re: Potentiometer code
Quote:
but yes the jumper will work for stoping that motor from moving. |
|
#5
|
|||
|
|||
|
Re: Potentiometer code
Quote:
If you can tell me how to move the jumper I would be very pleased. Thanks for your help! |
|
#6
|
||||
|
||||
|
Re: Potentiometer code
Quote:
If you are using PWM to control the motors: Looking at the Jaguar motor controller, to the right of where you plug in the PWM cable there are three pins with a jumper. if you put the jumber on the two pins to the right (these should be signal and low) the controller is in brake mode. I do not have a controller in front of me to see the specific labelling but if my directions are not clear enough go to the Jaguar site http://www.luminarymicro.com/jaguar and you can look at there instructions in the geting started file. Last edited by JamesBrown : 04-02-2011 at 13:34. |
|
#7
|
||||
|
||||
|
Re: Potentiometer code
Quote:
Also it is worth noting that you can infact break a motor using software. If you use CAN there is a function to switch between break and coast. If you use PWM then you can connect the signal wire from a digital out to the center pin on the Brake/Coast jumper and control braking that way. |
|
#8
|
|||
|
|||
|
Thank you James! I got it!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|