how to get object's infromation to variable?

About advanced scenes, and the Thyme scripting language used in Algodoo.

how to get object's infromation to variable?

Postby epsilon » Thu Jan 13, 2011 12:26 pm

Im tring to make an advance flight control system,automatic balance and stabilize the ship,but here's a problem is I cant get the exactly informaion of flight attitude for example angular velocity and speed and so on.

would anyone plz tell me how to get a object angular velocity to a variable number that I can uesed?

thank you for your help
epsilon
 
Posts: 9
Joined: Tue Dec 14, 2010 4:05 pm

Re: how to get object's infromation to variable?

Postby Kilinich » Thu Jan 13, 2011 2:35 pm

epsilon wrote:Im tring to make an advance flight control system,automatic balance and stabilize the ship,but here's a problem is I cant get the exactly informaion of flight attitude for example angular velocity and speed and so on.

would anyone plz tell me how to get a object angular velocity to a variable number that I can uesed?

thank you for your help


Rating: rated 8.1
Filesize: 19.49 kB
Comments: 19
Ratings: 13
download

Rating: rated 7.8
Filesize: 13.68 kB
Comments: 13
Ratings: 10
download
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: how to get object's infromation to variable?

Postby epsilon » Thu Jan 13, 2011 3:42 pm

thx very much~
epsilon
 
Posts: 9
Joined: Tue Dec 14, 2010 4:05 pm

Re: how to get object's infromation to variable?

Postby epsilon » Thu Jan 13, 2011 4:27 pm

its amazing!its so complicated,but it really really cool! thank u!

and its a little bit guilty feeling when using thsi probe,kind like its not my one, I just packaging a fight control system,hehe!
epsilon
 
Posts: 9
Joined: Tue Dec 14, 2010 4:05 pm

Re: how to get object's infromation to variable?

Postby Algonaut » Sat Jun 07, 2014 12:00 pm

I don't understand how it work!
I'm trying to stabilize my flight-object, but it oscillate more and more. Cause I don't know how to integrate my knowledge of control systems engineering in Thyme :)
Attachments
flight-object.JPG
(39.95 KiB) Not downloaded yet
Algonaut
 
Posts: 13
Joined: Mon May 05, 2014 8:30 am

Re: how to get object's infromation to variable?

Postby electronicboy » Sat Jun 07, 2014 4:00 pm

This should of been a new thread, but I'm too busy to move the one post. Your thrusters are probably too powerful, or your tolerance of the y level is too low. Even when the thrusters are turned off, the object will keep moving, increasing the tolerance and miniming the power of the thrusters should be able to helo this, maybe adding reverse thrusters on the other side to try limiting the amount it can go over the y axis as well.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: how to get object's infromation to variable?

Postby Algonaut » Sun Jun 08, 2014 12:43 am

electronicboy wrote:This should of been a new thread, but I'm too busy to move the one post. Your thrusters are probably too powerful, or your tolerance of the y level is too low. Even when the thrusters are turned off, the object will keep moving, increasing the tolerance and miniming the power of the thrusters should be able to helo this, maybe adding reverse thrusters on the other side to try limiting the amount it can go over the y axis as well.

The power (force) of the thrusters is determined by formula:
{force := 943 - (scene.my.pos * scene.my.pos)}
scene.my.pos is the variable for position of the block
As you can see, there is nothing like control systems engineering :oops:
I need a formula or computer-code such as PID-Control to integrate in the thrusters
Algonaut
 
Posts: 13
Joined: Mon May 05, 2014 8:30 am

Re: how to get object's infromation to variable?

Postby electronicboy » Sun Jun 08, 2014 2:35 am

See, I don't think there is a way to handle this nicely, however you could have a loop running:

if Y < (desiredY - tolerance) {
force = force + <finetune a value> }

if Y > (desiredY + tolerance) {
force= force + <finetune a value> }


that is wrote during extreme tiredness, so expect a logic failure, and note: that's probably not valid in thyme at all, more of a hybrid pseudo code.

and, I know the fun of some electrical control systems (mainly changeovers), but that's about it :P
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: how to get object's infromation to variable?

Postby Xray » Mon Jun 16, 2014 11:56 pm

Hi Algonaut,
There are at least a couple of scenes on Algobox that utilize PID control which you may be able to use for your scene. I looked at the image that you posted of the plot but it would be more helpful if you could post the actual scene that you are having trouble with, and one of us might be able to help you better.
User avatar
Xray
 
Posts: 501
Joined: Sun Jun 17, 2012 6:12 am
Location: USA


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 6 guests