Log in

View Full Version : Quadratic equation problem


DFZXA
21-02-2012, 12:43
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?

DFZXA
21-02-2012, 17:23
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.

Ether
21-02-2012, 17:40
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?

DFZXA
22-02-2012, 10:53
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.

Ether
22-02-2012, 11:02
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".