![]() |
Help! RobotDrive Error in all 3 languages
2 Attachment(s)
After having spent countless hours trying to solve this problem, we are now interested in what new ideas people might have towards solving the following problem. Please read through the entire post. I realize that it is rather lengthy, however this is an important problem that could possibly affect other teams.
When we first started the programming, we started with Java as our programming language. While trying to create a simple program, we discovered that while driving, the robot had a tendency to turn towards one side. After spending several hours solving a series of mechanical problems, we still had the same problem. We then began to test the output of the jaguars with our multi-meter. We discovered that one side was outputting approx. 12.5 volts while the other side was outputting approx. 10 volts. Believing that this was an issue with the jaguar firmware, we went to update the jaguar firmware, however have been unable to update the jaguar firmware so far due to the fact that we do not have access to a computer with a serial port outside of our school district (our school district does not allow us access to the necessary computers). We later made the discovery that there was yet another problem. We decided to test the control circuit of the PWM cables. We discovered that one side was putting 2.27 volts through the control circuit while the other was putting 0.67 through on the other side. This led us to believe that it was not in fact a jaguar problem, but instead a problem with the cRIO or the digital sidecar. After having swapped out a series of different components, we decided to try something different. Since we still had the electrical board from last year, we decided to run the program on the old electrical board. We made the necessary changes to the board (such as module placement and cRIO imaging) and then downloaded the test program. We discovered that an entire other electrical board had the same problem. After switching out an additional series of parts, we now believed it to be a programming error. We then proceeded to reduce the program to the simplest program possible. We wrote the following piece of code. Quote:
Discovering that this piece of code did not work properly, we instead decided to try a different programming language. We then proceeded to reformat the cRIO, and prepare a new code sample in Wind River. We discovered that this code had the sample effect as the Java code that we had previously tried. Quote:
With time quickly shortening, we are in desperate need of some help with this problem. Any and all ideas would be appreciated. |
Re: Help! RobotDrive Error in all 3 languages
Did you switch out the power wires? There could be a frayed wire somewhere...
|
Re: Help! RobotDrive Error in all 3 languages
We tried both our new electrical board and our board from last year. We did not switch any of the cables between them.
Quote:
|
Re: Help! RobotDrive Error in all 3 languages
Just as a note, after some further testing, we discovered that in Java, by controlling the individual jaguars instead of through a RobotDrive instance, I am able to match the speeds correctly.
|
You didn't mention if you had calibrated the Jaguars ...
|
Re: Help! RobotDrive Error in all 3 languages
Quote:
|
Re: Help! RobotDrive Error in all 3 languages
In the Java example you initialize the RobotDrive object at its declaration:
Quote:
Quote:
|
Re: Help! RobotDrive Error in all 3 languages
Quote:
However, this may be a non-issue anyways depending on your electrical and software setup. If you are running the basic tank drive software with all the CIM motors hooked up normally (red-red, black-black) one side will need to be inverted from the other. If this is done in software one side will get a different PWM signal than the other, and this can be easily determined by looking at the speed controllers while driving forwards. If the speed controller led's for the left side are different than the right side that means they are inverted in the software. Which is perfectly fine. You didn't specify your actual drive-train setup, are you guys doing 4wd or 6wd? I suspect that you have one or more of the following problems: a) You still have binding issues in your drive-train b) Bad weight distribution on your wheels c) Not all wheels contacting the ground. If you see the same problem in all 3 programming languages using the default code (disregarding many other teams using the default code without issue) the problem is probably not the software. When you drive fully forwards and the speed controllers led's are constantly on (green or red) that means the software is putting out a full throttle command. |
Re: Help! RobotDrive Error in all 3 languages
We are actually planning to use a 2WD with 4 motors. After further inspection of the National Instruments documentation of the Jaguars, we discovered that to go in full reverse is 0.67 and to go full forward is 2.27 which is the values we were recieveing. We are using a multimeter to test the output of the control circuit. This now leads me to believe that it is no longer a software problem and instead a firmware problem with the jaguars. Does anyone have a suggestion as to how to update the firmware on the jaguars? When I connect the jaguar to the computer, it just reads 0 for everything, but it says that it is connected.
Thank you to everyone who has contributed towards helping us find a solution to this problem. |
Re: Help! RobotDrive Error in all 3 languages
Quote:
I'm hacking this in pretty fast, but it should get you going ... Code:
#define SIDE_BIAS 0.1 // TBD from experimentationFor better drift compensation, try a yaw rate sensor as feedback to a proportional control of the SIDE_BIAS value ;) Thanks, Eric PS JAG firmware upgrade instructions: http://www.usfirst.org/sites/default...ructions02.pdf |
Re: Help! RobotDrive Error in all 3 languages
Quote:
Have you tried measuring the voltage on the input side of the two Jaguars while this condition is occurring? I think it is likely that the side measuring the lower voltage has mechanical binding and/or improperly terminated wiring or long wire runs and is dropping a greater voltage before it gets to the input of the Jag (and likely dropping more voltage inside the Jag as well if the current draw is higher) The directional bias mentioned by the previous poster for the CIM motors is a few percent and while it can cause the robot to drift slightly dependent on construction it shouldn't result in the substantial difference you appear to be reporting. |
Re: Help! RobotDrive Error in all 3 languages
@EricS - Thanks for the code sample. I will take a look. We have tried using the updating manual, but it appears as though our school district does not have the drivers installed for the serial port to work.
@RufflesRidge - We are going to go and try and different things with the Jaguars today including what you have mentioned. Thank you everyone who as contributed towards solving our problem. |
Re: Help! RobotDrive Error in all 3 languages
Quote:
If you have an oscilloscope handy, you can actually see what's really going on: The Jag outputs a PWM signal to the motor - Essentially, it never gives the motor 10V, or 8V (unless that's what your battery is at). Instead, it'll oscillate between a high and low voltage, and the width of the pulses averages out to be 10V, or 8V, or whatever you want. When hooked up to a motor, the motor essentially does the averaging for you. So if you hook the scope or a multimeter up to a Jag with a motor attached, your going to see the output voltage you expect for the speed its going. On the other hand, if you remove the motor, you'll see the actual square waveform on the scope. We've done this demonstration on our team (we were fortunate enough to have an old scope donated last fall by our primary sponsor). It's very clear that for the same speed forwards and backwards, the waveforms are simply inverted images of each other. The issue comes with the motors - they have a forward bias. In other words, they prefer to run forwards. As a result, you'll see the robot drift to one side, since the motors running in reverse are running slightly slower. Don't believe it? Here's something any team can do with what came in the KoP: - Hook up the nice rotary encoders we got from US Digital to 2 CIMple boxes. - Hook a motor up to each CIMple box. - Place some sort of load on the output shaft of the CIMple boxes, (a flywheel, a pully lifting a weight, something). We don't want to just let these run at free speed with no load. - Run the motor leads together, but switch polarity - red from one motor meets black from the second motor, and vice-versa. - Hook the encoders into your digital side car, and that up to the cRio. - Set them up in code to read out the speed or distance. - Hook the CIM motor leads directly up to power, with no speed controller between them - Run the whole thing, and look at the encoder output - you should see that one is running faster than the other! |
Are you using the same type of jaguar on both sides?
|
Re: Help! RobotDrive Error in all 3 languages
I think that we have solved the problem. On our robot, we have 16" drive wheels. We built a second frame today from the KoP and discovered that it drives very smoothly and very straight when you are only using 6" wheels.
We continued extensive testing on the jaguars and discovered that the jaguar tends to output more power going in reverse than going forward. While this is not a problem with the standard 6" wheels provided, it does present a problem when you have 16" drive wheels and casters on the front. This will likely have to be a programming fix unless anyone has any other ideas because it will be a matter of limiting the reverse power down to what the forward power is outputting. We believe that we have found the other issue. While trying to drive a couple of days ago, we discovered that one side would stop while the other would keep going full throttle. This problem only seemed to present itself when the robot was pushing against something (ie. a person). We now believe that the gear box could have been assembled incorrectly and is therefore causing issues when the motors come under load. I will add new information as more is discovered tomorrow. |
Re: Help! RobotDrive Error in all 3 languages
Quote:
Quote:
|
| All times are GMT -5. The time now is 20:15. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi