![]() |
8 volts over talons
Hi guys,
First, thank you to all of Long Island for having is this past weekend! I'm having a weird issue, I'm using Talons to power CIM Motors for our shooter. When a button is assigned to them, the voltage reads 8Volts, when the joystick is applied I get the full volts, solid green and red lights. After calibrations and such, I can't figure it out. Can we just not use assign buttons to talons? We are using JAVA. Thank you in advance. -Mike |
Re: 8 volts over talons
Can you post the relevant part of your code?
Something like this should work: Code:
if (joystick.getRawButton(SHOOTER_BUTTON)) |
Re: 8 volts over talons
It seems like a code issue. Could you post the code? Also, are you using the command based model or the simple template?
|
Re: 8 volts over talons
For the most part, when running a blank code it was essentially just a simple
Code:
if (js.getRawButton(11)){ |
Re: 8 volts over talons
Electrical resistance will make your voltage drop.
There is some resistance in a talon, but not that much. This particular talon could be a bad one though, with a greater resistance. Wire has resistance as well. If you have long wire runs, the voltage could easily drop to 8v by the time it reaches the motor. This calculator shows you how severe that effect may be. http://www.calculator.net/voltage-drop-calculator.html There could be a loose or badly terminated wire somewhere along the path. This would increase resistance, further lowering voltage. Also, it is possible the value you get is what the current battery voltage is. These batteries don't always output 12v, but I'm sure you knew that. It could also be that your voltmeter isn't great, or has poor connections. If the lights on the talons are flashing as you press the button, I'd think it was code. if their not, its probably something else. Your code looks correct, assuming it runs every loop. |
Re: 8 volts over talons
You can debug by printing the values that the talons are set to.
You can do this by writing: Code:
System.out.println(shooter.get()); |
Re: 8 volts over talons
Its set to two talons, but for the sake of this i'm just writing the program as it would be if i only have one. The wire length is closer than any other motor control set up that we have.
So when I revised the program to have it read as such Code:
if (js.getY()> 0)I've even switched out these talons with other talons to eliminate as much as could be and for some strange reason, being set to a button doesn't give it full speed. |
Re: 8 volts over talons
Quote:
Try setting the speed to a variety of values (I would go 1.0, 0.9, 0.8, etc, all the way down to -1.0) and see what voltage you get out of the Talon for each value. Then do the same thing feeding in a joystick, printing out the joystick value as you go so you can get it at about the same values. This will let you plot two response curves, which may help us figure out what's wrong. |
Re: 8 volts over talons
Quote:
|
Re: 8 volts over talons
I've stripped down the code, and removed it from all other variables, started a new file so all i have running is the button, and the js.getY(), (1 is being commented out when the other one is in use). And the results are still the same with the main program. It reads out 1.0 on the driver station, but shows a blinking light, and only reads ~8 volts on a voltmeter when done on a button.
|
Re: 8 volts over talons
So with the striped down code, the only way to stop the motor is to disable the robot?
Try getting rid of the "if" part all together - just set the motor to 1.0 and see what happens. I would also try 0.9, see if the output value changes. |
Re: 8 volts over talons
Also, it would be helpful to post all of the code so we can see what else might be affecting the output
|
Re: 8 volts over talons
yea as i essentially just have the shooters set up to the drive train so its just the wheels running forward, rather than an arm just swinging around I didn't want to risk any other method of coding to be part of the issue. I'll try putting it on different speeds and seeing if the output values change
|
Re: 8 volts over talons
Makes no sense that the axis is causing the Talon to give a different voltage than the button. If it were an electrical problem, you should see consistent and identical results for axis vs. button.
One problem I've frequently seen is: Code:
if (js.getRawButton(SHOOTER_BUTTON))Code:
shooter.set(0.7);If you're multi-threading, maybe something else in another thread is modifying the shooter? It just doesn't make sense that the problem is electrical related. If you don't want to post your code, it's fine, but we can at least help you eliminate the possibility of the problem being your code. |
Re: 8 volts over talons
I tried opening a new project
Code:
public class WhyYouNoWork extends SimpleRobot{ |
Re: 8 volts over talons
I have never come across a problem that's baffled me as much as this has. Is it possible to calibrate the talons while applied on a button, or does it have to read Y-axis for it to work.
|
Re: 8 volts over talons
To calibrate the Talons, you should bring them through the full -1 to 0 to 1 range.
Code:
1. Press and hold the button labeled “CAL” with a paper clip. The |
Re: 8 volts over talons
To answer the electrical questions. The shooter is composed of two CIMs, brand new. Talons, out of the box, and PWMs from AndyMark. The solder-less terminals that connect the wiring are all solid. The raceway for ALL these wires are not ran in a configuration that runs against the chassis or may have been cut, all clean, short, out in the open runs. Instead of having the load on the motors, the multimeter replaced the terminals on the talons so when the actions are live, we have the 12V and the 8V read outs on the display and the Talon LED indicator light.
With this program are two limit switches that prevent the arm to destroy it's self when it fires, and when it returns back to loading position. They work fine, we get zero volts when they are depressed. |
Re: 8 volts over talons
Quote:
|
Re: 8 volts over talons
I'm not sure that reading the output of the Talon with a voltmeter is the correct approach to understanding what is happening. You see the output of a speed controller is a pulsed output that switches between 0 and 12 VDC.
It's the duty cycle (ratio of on to off time) that determines the speed of the motor. What you are probably seeing is the average voltage that the meter is reading over time. An oscilloscope is a better tool to use for this application. Now having set that straight, I am also puzzled why you are reading a different average voltage output based on whether the joystick axis or the programmed button is providing the controlling input to the Talon's PWM input. If you have access to an oscilloscope can you see a difference in the pulse width of the PWM output to the Talon? |
Re: 8 volts over talons
Quote:
|
Re: 8 volts over talons
One problem I see with your code, although it shouldn't cause the problem you are seeing, is that the motor will not turn off if you release the button. You should probably change it to something like:
Code:
if(js.getRawButton(11)){ |
Re: 8 volts over talons
Quote:
What happens if you bind it to another button? |
Re: 8 volts over talons
Quote:
|
Re: 8 volts over talons
Quote:
I thank everyone for trying to get to the bottom of this problem.. |
Re: 8 volts over talons
Quote:
Or maybe a limiter was implemented that lowered it if it went too high, and getY() would return values like 0.99583953 which would go through, but having it be 1.0 will get it artificially lowered in the program to say 0.7? Just throwing ideas out there. |
Re: 8 volts over talons
Quote:
|
Re: 8 volts over talons
Quote:
Grasping at straws maybe but I really think the problem lies elsewhere. |
Re: 8 volts over talons
Quote:
Button state gets pulled directly from the control structure that gets set by the FRCComms library, so it's not like you can accidentally reset the state of the button in code. As far as I know, when you drop comms, the robot uses the last recieved values, so unless it's dropping long enough to fault things (which you'd notice driving), I don't think it's a comms problem. A comms problem that severe should affect things if you're using GetAxis anyways. No, I'm betting it's a windows driver/joystick setup issue. I'm going to bet that (somehow) your joystick is setup to treat holding down that button like rapidly pressing the button. So you think you're holding it, but it's actually flickering off and on, and that's getting reflected in the data from the driverstation. So if you have code for turning the motor off when the button is released, you're actually constantly turning the motor on full speed, then off. Sort of an unintended PWM on top of the PWM. Testing this theory: Set up a variable to count edges on that button and check the value of that variable. Something like: Code:
//In Robot class variable declarationsSolution: 1. Figure out why the DS or windows thinks the button is flickering. I don't know the details of your joystick/laptop setup, so you get to have fun with that. Best solution because it actually fixes the problem. 2. Two separate buttons, one to turn on the shooter, on to turn it off. Worst solution because it complicates things for your drivers. 3. Debounce the OFF side of the button press. It's tricky, but you're basically looking for the button to be off for several loops in a row, to be sure it's actually off and not flickering. This solution should fix things even if the problem is comms dropout. Code:
//In Robot class variable declarationsNote that if this is affecting this particular button, it could potentially affect ANY button where you're changing state based off whether the button is pressed or released. It won't affect things where you just set things if the button is pressed and do nothing if released. |
Re: 8 volts over talons
Also, you really need to post back here with what the problem and solution is because I'm super curious and will PM you endlessly if you don't.
|
| All times are GMT -5. The time now is 22:07. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi