Quote:
Originally Posted by Chris Hibner
Your logic seems correct. However, you may not be getting anything from the ultrasonic sensor. See the attached image of the ultrasound example (the example can be found in (LabviewInstallFolder)/examples\FRC\Analog\EZ1 MB1010 Sonar Analog).
The example sets the averaging, sets sample rate, and then gets the voltage within the while loop. We tried moving the "set averaging" and "set sample rate" to Begin.vi, but the "analog get voltage" stopped working when we did that. Perhaps you need to add the "set averaging" and "set sample rate" into your while loop.
Can you describe the following:
1) How exactly is your robot behaving when you run autonomous?
2) When you run autonomous, what are you seeing from your "Distance" indicator?
|
After we put set averagıng and set sample inside the while loop the code seems to be working however there is a small problem. Let x inches be the distance I want the robot to stop and to extend the piston. When I set robots position to some distance which is greater than x inches and run the code the robot stops and extends the piston at x-y inches. If I set robots position to x inches from the wall and run the code the robot doesnt move and extends the piston as I want. Is there anything I can do to avoid this problem or should I just tell the robot to stop at x+y inches to make it stop at x inches?
Quote:
Originally Posted by MotorHead
I haven't used the Ultrasonic yet, so I can't comment on its setup. I do have a problem with your logic. The way you currently are configured is: If distance >= to 40 then back up with y =-.4, If distance < 40, stop and activate solenoid.
The problem with this is you do not have a deadzone in which to stop. Your arrangement can cause the robot to excessively hunt about the setpoint of 40. Look again at the vi I posted. There is a nested case structure to test if you are above or below the setpoint or if you are within the acceptable deadzone, in which case, do nothing.
|
It doesnt back up it goes forward with negative integers.
Thank you guys for your helps!!!!!
