![]() |
speed change in teleop
1 Attachment(s)
how do i change the speed of these motors, in this teleop vi, can you edit it and reply with the edited version or explain it to me.
|
Re: speed change in teleop
Which motor do you want to change speed of? I see Joystick 1 tied to two different motor definitions. This alone is a problem. You need only one of them. Make sure whatever one you choose has also been defined in the 'begin.vi'
You have motor definitions for 'arm' and 'hand' and are controlled from buttons on Joystick 1. You have the motor speed hardwired for both at .125. Are these the ones you want to change the speed of? You can just change the value of .125 to another value between 0 - 1. This of course is hardwired though and can't be changed while the program is running. You could tie another Joystick to these axis if you need variable control while code is running. |
Re: speed change in teleop
this is great, but the arm is our shoulder, why is it a problem to have 2 motors wired to joystick 1.
|
Re: speed change in teleop
Quote:
Your begin.vi from another thread has this. This, in its current state, is broken. What are you trying to do? Do you have two left and right drive motors? Or are you trying to drive your arm using Drive commands? If the second, your doing it incorrectly, as that is not what the drive vi's are made for. Secondly, this is what your code looks cleaned up a bit (teleop) Your controling two drive vi's with the same axis values. If you are using 4 motors for drive use this in begin and this in teleop. If you are indeed controling your arm using button feedback, I'd consider using this. It uses the trottle control on the joystick to set speed and uses buttons two and three for down/up. If you have any questions, let me know. I'll be sure to answer within the next day or so. |
Re: speed change in teleop
Quote:
Pretend we don't know anything about your robot or your controls - which is pretty close to the truth. Explain to us in plain English what you want the driver to do, and what you want the motors or servos or pneumatic cylinders on the robot to do as a result. |
Re: speed change in teleop
Ok, How would i change the speed of the arm and hand motors so if i used a joystick i would not have to push it a fraction of an inch and have it move a million mph, or just slow down the definite speed if i was using a button.
|
Re: speed change in teleop
and would i use a numeric value of one if i wanted to return the speed to normal?
|
Re: speed change in teleop
I'd encourage you to look through the code and find the place where the "too fast" motor is being updated. Right click and probe it and get a sense of what values are being sent. Also, be gentle with the joystick and determine what upper it is that you'd want to send. Now change the code to turn the -1 to 1 value into the "-slow value", and "slow value". Keep probing as you insert a multiply by a number less than one or a divide by a number greater than one. Be sure to make all values default when you are happy with it.
Note that this is not a good solution to fix a gear ratio that is way off, but if there isn't much load on the motor, it will make your drivers way more successful. Greg McKaskle |
Re: speed change in teleop
is there a number input that makes it go backwards, because that is what i thought - values do.
|
Re: speed change in teleop
You can wire a -.5 constant to the run motor vi and it will spin backwards at half speed for the entire time teleop is enabled. That is probably not what you want.
You can divide your joystick value by 2 and wire that output to the run motor vi. This will make it so that the motor will never run at full speed, and will make it so that moving the joystick a quarter of the way forward will make the motor turn at 1/8 speed. You can cube your inputs. This will make it so that you have finer control over the lower values (so moving the joystick halfway will have the motor turn at .5*.5*.5 = .125 = 1/8 speed), but still let you have full range of motion (because 1 * 1 * 1 = 1). You can also square it, but then you have to worry about preserving the sign (because squaring makes everything positive). To make the motor turn backwards when you move the joystick forward, you can just add in a "negate" (named incorrectly, should be negatize) command between the axis and the run motor vi. By saying "How do I change the speed of the arm" the correct answer is to move the joystick to a different position. What you should probably say (assuming I'm reading you correctly) is "How do I change the sensitivity of the joystick so that it (Has a lower max speed/is nonlinear)" or "How do I reverse the direction of a motor?" Figuring out exactly what you want done is the majority of programming. The chassis folks tell you they want the robot to move, and you have to know that that means you need to have the x axis of the joystick control the turning rate, defined by this algorithm... et cetera. Try to do that, and we can help you on how to do it. Alternatively, if you don't know exactly what you want done, you can post some detailed descriptions of how everything is configured (such as: "there's a motor controlling one arm, and then on that arm there's another motor controlling another arm, similar to how a human arm works. How should I go about programming this to take in a height and make the end of the arm go to that place?") and we can help you with that too. However, saying really vague things ("my robot doesn't work" "How do you run an arm?") makes it harder to help you. |
| All times are GMT -5. The time now is 09:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi