Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Quadratic equation problem (http://www.chiefdelphi.com/forums/showthread.php?t=103497)

DFZXA 21-02-2012 12:43

Quadratic equation problem
 
1 Attachment(s)
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

Re: Quadratic equation problem
 
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

Re: Quadratic equation problem
 
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

Re: Quadratic equation problem
 
1 Attachment(s)
Quote:

Originally Posted by DFZXA (Post 1131941)
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

Re: Quadratic equation problem
 
Quote:

Originally Posted by Ether (Post 1131956)
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

Re: Quadratic equation problem
 
Quote:

Originally Posted by DFZXA (Post 1132507)
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".




All times are GMT -5. The time now is 11:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi