View Full Version : Quadratic equation problem
I took data from a sensor and basically tried to use the quadratic equation on it. When I plug in a number for it it would work, but the problem is that the motor just won't run when I do it. I've attached the program I made for it. If anyone could guide me in the right direction that would be much appreciated.
Alan Anderson
21-02-2012, 15:02
Where are you putting the code you posted a picture of? What sensor are you reading?
What are you trying to do with this computation?
The code is in the teleop.vi. It's being read from a sonar (after the conversions). I basically needed to run a motor at different speeds based on the distance, but it didn't work well linearly.
The code is in the teleop.vi. It's being read from a sonar (after the conversions). I basically needed to run a motor at different speeds based on the distance, but it didn't work well linearly.
Let "y" be the output from that code, and "x" be the input.
Then it looks like you are computing
y = -8.24x2 +12.3x -3.97
See attachment. Is that what you intended?
Let "y" be the output from that code, and "x" be the input.
Then it looks like you are computing
y = -8.24x2 +12.3x -3.97
See attachment. Is that what you intended?
Yes that's exactly how I wanted it, but the motor just sits there and does nothing when I tried that.
Yes that's exactly how I wanted it, but the motor just sits there and does nothing when I tried that.
Put a probe on the output from your equation (the input to MotorSetOutput) and see what value is there when "the motor just sits there and does nothing".
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.