Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Angle Sensor Use

Archive: 26 posts


I've been playing with the new tools, and I really like them so far. The speed sensor is going to be incredibly useful for me.

I'm a bit confused about how the angle sensor is useful though.

The binary signal seems useful enough for indicating when something is rotated to be within a certain range of angles.

As far as I can gather though, the analog signal just displays a percentage representing how close it is to centered.

say you have an object upright, and you place a 180 degree angle sensor on it. It gives an analog output of 100. You rotate it 45 degrees clockwise, and the analog output now reads 50 (or .5). That's all well and good, but you get the same reading if you had rotated it 45 degrees counter-clockwise instead. That's not so good.

Am I missing something, or will we need to use multiple sensors to be able to accurately determine angle of rotation on freely moving objects?
2011-09-07 10:16:00

Author:
tdarb
Posts: 689


say you have an object upright, and you place a 180 degree angle sensor on it. It gives an analog output of 100. You rotate it 45 degrees clockwise, and the analog output now reads 50 (or .5). That's all well and good, but you get the same reading if you had rotated it 45 degrees counter-clockwise instead. That's not so good.

Am I missing something, or will we need to use multiple sensors to be able to accurately determine angle of rotation on freely moving objects?
I haven't downloaded the patch yet but it would seem so from your description.

You'd need two other angle sensors to detect which direction the object had been rotated in and run the signal from the primary angle sensor through an inverter gate to utilise the full -100% to 100% analog range.
2011-09-07 14:48:00

Author:
Ayneh
Posts: 2454


So??? You'd need four angle sensors 90? Each?2011-09-07 15:02:00

Author:
Unknown User


I would think 2 sensors at a 90 degree angle would be enough. One would give the horizontal position, the other the vertical position.

But I'm not sure why you'd need this setup. What are you trying to do?
2011-09-07 15:11:00

Author:
Rogar
Posts: 2284


using sensors at 90 degree angls won't work because you they would still be broken up into two 45 degree segments each.

@ayneh, inverting just reverses the 0-100 signal. Instead of 100 peak/0 off, it reads 0 peak/100 off. No negative outputs. It's odd how these things are set up.

@I_love_logic, and Rogar. 90 degree sensors would be too small to determine anything from. even with 4 of them, you would be unable to tell if something was rotated at 30 degrees or 60 degrees since they would both have the reading of 50% from the same sensor, and the others would all give 0.

The best I was able to do is two 360 degree sensors laid perpendicular to one another. I actually settled on 4, 180 degree sensors though, since it required fewer unique calculations to determine the angle.

All I am trying to do is determine the rotation angle of the object. I have it set with a look at rotator on it, and I want to know where it is looking. It is doable, just not as easily as it seemed it would be. I had assumed they would be set up to give a readout that would tell you which way something is facing right out of the box rather than just how close to the center point something is depending on their placement. I could be missing something though.
2011-09-07 15:37:00

Author:
tdarb
Posts: 689


@ayneh, inverting just reverses the 0-100 signal. Instead of 100 peak/0 off, it reads 0 peak/100 off. No negative outputs. It's odd how these things are set up.
Ahh, I see. I guess you'd have to use a really big positional sequencer with tons of batteries on it instead of a NOT gate then, eek.


The best I was able to do is two 360 degree sensors laid perpendicular to one another. I actually settled on 4, 180 degree sensors though, since it required fewer unique calculations to determine the angle.

All I am trying to do is determine the rotation angle of the object. I have it set with a look at rotator on it, and I want to know where it is looking. It is doable, just not as easily as it seemed it would be. I had assumed they would be set up to give a readout that would tell you which way something is facing right out of the box rather than just how close to the center point something is depending on their placement. I could be missing something though.
Maybe there's some clever way you could subtract or add the signals together from multiple angle sensors? It gives me a headache so I'll just hide under the table until the analog-heads figure it out.
2011-09-07 16:12:00

Author:
Ayneh
Posts: 2454


Could not you use 2 rotation sensors, 1 set to clockwise and 1 to counter, each activating a different microchip which would have the same angle sensor on it but you would know which one is triggered on negative or positive rotation? Not sure if this helps at all since it depends what you are trying to accomplish in the end. I am currently working on a way to scale moving objects. Scaling non moving objects is easy as emitting a larger version of an object and destroying the old smaller one a millisecond before. Scaling moving and rotating objects, especially with multiple animated parts, was nearly impossible to make look convincing, until now! These new sensors should make that a reality.. I hope

Edit: Make sure you set the rotation sensor to trigger on speed 1 so it will detect any rotation in that direction..
2011-09-07 17:14:00

Author:
Death_with_an_H
Posts: 72


The best I was able to do is two 360 degree sensors laid perpendicular to one another. I actually settled on 4, 180 degree sensors though, since it required fewer unique calculations to determine the angle.

Yeah, two 360 degrees sensors is what I meant. Should have been more clear, I suppose.


All I am trying to do is determine the rotation angle of the object. I have it set with a look at rotator on it, and I want to know where it is looking. It is doable, just not as easily as it seemed it would be. I had assumed they would be set up to give a readout that would tell you which way something is facing right out of the box rather than just how close to the center point something is depending on their placement. I could be missing something though.

I see, you want the value just to see if you can. I suppose it's not as straightforward because it's rather theoretical. That's also why I asked what you were trying to accomplish; I couldn't think of a situation where you'd need this. They could have used you in the beta.
2011-09-07 19:34:00

Author:
Rogar
Posts: 2284


this setup outputs 2 analog signals that can sense all angles in a way that directly translates to what a joystick rotator recieves. Or a boy's right stick to make it aim the same direction.
the angle sensors are all set to 180 degrees and the bottom combiner is inverted,
http://i6.lbp.me/img/ft/15685b53d52e4f969ab8b45444ec76cc80f231ed.jpg

the object on the right will always rotate to match the angle of the object on the left
http://i8.lbp.me/img/ft/6b8ff589d93a24fb912abbe664b316a70a89e3b5.jpg


also this is a way to get negatives with sensors, this setup is what i like to call a positional rotator, it turns to a certain angle depending on the strength and sign of the analog input. the green sensors are set to 180, the yellow sensor is inverted and is set to whatever range you want the rotator to have
http://ic.lbp.me/img/ft/12ce9d0bd9c456e72a232e5f91530c0f428bc46d.jpg
2011-09-07 20:50:00

Author:
evret
Posts: 612


Thanks guys

@Rogar, yeah at this point it's mostly theoretical to see what it will do. One thing I was looking into it for was the possibility of implementing a radar function. If I know my orientation, and which direction an object is in relation to that (look at rotator/angle sensor on holo), it should just be a matter of comparing signals to determine where to put the "blip".

@evret, we're pretty close on what we have. I settled on the four 180 degree sensors, and direction combiners too.

You can also use the digital signals to determine which quadrant is active using AND gates.
2011-09-07 22:30:00

Author:
tdarb
Posts: 689


All I am trying to do is determine the rotation angle of the object. I have it set with a look at rotator on it, and I want to know where it is looking.

So if the object is at 0?, you want 0% analog, and if it's 360?, you want 100% analog, and all values in between?

Not sure why you'd want that - best I could manage was this...

http://i0.lbp.me/img/ft/7e05d5e7f95dca19e7583eb592f8c4298e5055c3.png

...where the left Angle Sensor is 360?, the top Angle Sensor is 180?, chip 'A' is "divide by 2" and chip 'B' is "add 50%".



The best I was able to do is two 360 degree sensors laid perpendicular to one another. I actually settled on 4, 180 degree sensors though, since it required fewer unique calculations to determine the angle.

So what was your solution?



this setup outputs 2 analog signals that can sense all angles in a way that directly translates to what a joystick rotator recieves.

There's another way to have the angular orientation of one object match the orientation of another, but in a relative way, such that, if the target object starts with the same orientation as the source object, it'll always stay at the same angle as the source, but it the target object starts, say, 90 degrees clockwise relative to the source object, it'll always stay 90 degrees clockwise relative, etc.

It's so simple, I don't think a picture is necessary. Just put a Rotation Sensor on the source object set to max speed, and an Advanced Rotator on the target object set to max speed, 100% acceleration and deceleration, and connect the sensor to the rotator.



...this setup is what i like to call a positional rotator, it turns to a certain angle depending on the strength and sign of the analog input.

Would it not be simpler to use a Joystick Rotator and control the position absolutely, rather than using a feedback system?
2011-09-07 23:45:00

Author:
Aya042
Posts: 2870


There's another way to have the angular orientation of one object match the orientation of another, but in a relative way, such that, if the target object starts with the same orientation as the source object, it'll always stay at the same angle as the source, but it the target object starts, say, 90 degrees clockwise relative to the source object, it'll always stay 90 degrees clockwise relative, etc.

It's so simple, I don't think a picture is necessary. Just put a Rotation Sensor on the source object set to max speed, and an Advanced Rotator on the target object set to max speed, 100% acceleration and deceleration, and connect the sensor to the rotator.

i did it that way coz i wanted it ignore starting angles



Would it not be simpler to use a Joystick Rotator and control the position absolutely, rather than using a feedback system?
depends on the use, for many applications the feedback method is much better, and easier to set the movement range
for example you could wire a left/right speed sensor into the positional rotator to make it tilt depending on how fast it was moving in each direction
2011-09-08 02:30:00

Author:
evret
Posts: 612


I was just messing around with this and made a cursor which moves relative to your character regardless of which direction you are facing (local space cameras). Using the speed sensor to detect player movement and adding it to R-Stick value, it works quite nicely. A little more complicated than I expected, but it's just manipulating analogue values for most of it. This also allows you to move around without needing some rebound system, just disable the R-Stick values when hitting screen edge (which would rotate with player).

You use the angle sensor to change angle of the reticule which moves in local space, like already explained. Was going to post it, but evret beat me to it.
2011-09-08 04:48:00

Author:
SSTAGG1
Posts: 1136


So what was your solution?



I started out using the direction combiners, but that didn't work out so well for me. i still think that could work, but I couldn't figure out the comparisons involved.

I'll try to describe it as best I can. Basically I started with the same 4 sensor setup that evret has. Each sensor is set to cover 180 degrees, and laid out so that every sensor overlaps the two perpendicular ones by 90 degrees each.

From there I used the binary signals and AND gates to determine which quadrant was active. If the top and the right angle sensor is active I know it is "looking" between 0-90 degrees (quadrant I). If right and bottom, 91-180 degrees (quadrant II).

So, starting with a counter-clockwise rotation I would see the top and right sensor activate. I attached them both to an AND gate that then ran to the activation node on a MC. Since the signals in the angle sensors relate to how "upright" the sensor is, I placed a circuit node on the MC and just fed the analog signal from the right chip through it so I would get a count up as it rotated. Now whenever the top right quadrant is receiving signal I get the percentage reading from it as the sensor counts up.

From there I just placed 18 batteries on a positional sequencer and can read the angle at 5 degree increments, which is close enough for me.

Then repeated the process for the remaining three quadrants.

Now I just need a real use for it.
2011-09-08 11:31:00

Author:
tdarb
Posts: 689


i did it that way coz i wanted it ignore starting angles

Sure. It's exactly the same design I used in the beta. Just saying (depending on application) there's also a 2-component solution, which is clearly 3.5 times better than a 7-component solution.



depends on the use, for many applications the feedback method is much better, and easier to set the movement range

Figured. Sorry, I seem to have picked up rtm's bad habit of looking for the lowest-thermo solutions.

I wonder if it's less thermo to just manipulate the analog signal prior to feeding it into the Joystick Rotator... might check that out. Might not be, though - analog signal division uses quite a lot of components. Still, there might be a latency advantage - circuits based on feedback have a tendency to lag by at least one frame.



for example you could wire a left/right speed sensor into the positional rotator to make it tilt depending on how fast it was moving in each direction

Considering the Speed Sensor's "Max Speed" option effectively allows you to scale the output signal, that would seem like an example where a simple circuit like this...

http://if.lbp.me/img/ft/82ffdff8e2161df4d1d639780b64d6f57ab50f19.png

...would achieve the same result, with a fraction of the component count.



From there I just placed 18 batteries on a positional sequencer and can read the angle at 5 degree increments, which is close enough for me.

Ah. That's exactly what I was trying to avoid. What you really need is for the Angle Sensor to vary by 25% for a 90? angle, which would require being able to set the Angle Sensor's "Trigger Angle Range" to 720?. Unfortunately, the maximum value is 360?, so I couldn't figure out a better way than dividing its output by 2. There probably is one tho'.



Now I just need a real use for it.

Yeah. I couldn't figured out why you'd actually need it. The only application I could think of would be a numerical display of an object's angle.
2011-09-08 17:41:00

Author:
Aya042
Posts: 2870


Ah. That's exactly what I was trying to avoid. What you really need is for the Angle Sensor to vary by 25% for a 90? angle, which would require being able to set the Angle Sensor's "Trigger Angle Range" to 720?. Unfortunately, the maximum value is 360?, so I couldn't figure out a better way than dividing its output by 2. There probably is one tho'.

I think we are essentially doing the same thing in different ways.

The sequencer was just for display really. I also connected each quadrant to one of Balorn's probes to test the cycling between them, so I'm already getting the data out of them. Each quadrant already puts out a 0-100% reading based on its angle away from the nearest 90. Knowing which quadrant, and the percentage gives all the info one would need to determine orientation.

I was just using the sequencer to go one step further and test how difficult it would be to translate into a reading of actual degrees.

There probably is an easier way that is staring us in the face, but it hasn't made itself known yet.



Yeah. I couldn't figured out why you'd actually need it. The only application I could think of would be a numerical display of an object's angle.

What really sort of baffles me is why this sensor, in its current state, is necessary. You can create the same thing with a bolt, piece of holo, tag, sensor, and a gyroscope. That's why I created a test scenario to play with it. I just don't see it as a big leap forward in usefulness like the speeed and rotation sensors.
2011-09-08 18:37:00

Author:
tdarb
Posts: 689


Sure. It's exactly the same design I used in the beta. Just saying (depending on application) there's also a 2-component solution, which is clearly 3.5 times better than a 7-component solution.
not if the problem to be solved is angle matching that ignores start angle............



Considering the Speed Sensor's "Max Speed" option effectively allows you to scale the output signal, that would seem like an example where a simple circuit like this...

http://if.lbp.me/img/ft/82ffdff8e2161df4d1d639780b64d6f57ab50f19.png

...would achieve the same result, with a fraction of the component count.


thats the method i've been using since the lbp2 beta, however you cant easily alter the range of movement 45, 90 and 135 degrees each way are easy but other angles become more complicated and require division or other logic, with the feedback loop method all you have to do is change the range of the sensor and it's done
2011-09-08 20:55:00

Author:
evret
Posts: 612


What really sort of baffles me is why this sensor, in its current state, is necessary. You can create the same thing with a bolt, piece of holo, tag, sensor, and a gyroscope.

Well, all of the new sensors' behaviors were possible to replicate prior to 1.06, so I guess you can just think of them as a more convenient, lower-thermo, and lower-latency way to achieve them.



not if the problem to be solved is angle matching that ignores start angle

Hence the use of "depending on application". As useful as a one solution is, there are many use-cases where the lower-thermo solution would be acceptable.



thats the method i've been using since the lbp2 beta, however you cant easily alter the range of movement...

Well, in this example it's as simple as changing the ratio of the "Max Speed" of the object to the "Max Speed" of the Speed Sensor, although you're limited to 90? in either direction, but that may suffice for the bulk of use-cases.

In fact, both the Speed Sensor and the Rotation Sensor provide a new, low-thermo way to do arbitrary analog signal scaling, although the Rotation Sensor is probably the only one which is practical.

Just put a Microchip on a piece of hologram, inside which you put an Advanced Rotator (100% Acceleration/Deceleration) and a Rotation Sensor. Then you can feed the input signal into the Advanced Rotator, take the output signal from the Rotation Sensor, and the ratio of the "Rotation Speed" on the two components determines the scaling value.

...or (and this is quite funky), you can do the same thing, but use both inputs on the Advanced Rotator (setting it to Speed Scale), and multiply two arbitrary analog signals. Here's an example of multiplying the up/down and left/right from a Controlinator's left analog stick...

http://ic.lbp.me/img/ft/1ac4a2eae6c257ca70421837cafa91cf0f80ddff.png

...which reads "0.5937 x 0.4686 = 0.2787", which isn't quite right, but I attribute the error to an inaccuracy in the signal probe.

Obviously this can only ever multiply fractions of one, but combined with the "Rotation Speed" ratio scaling technique, gives you a lot of multiplication options just using two components.
2011-09-08 23:07:00

Author:
Aya042
Posts: 2870


Dude, I posted both setups in my original post to show examples of how angle sensors could be used, both setups are perfect for their intended purposes, and nothing you have suggested has been anything new to me, I had the beta too so I'm fully aware of what can b done with each, even the multiplication and division suggested I'm your last post is nothing new, it seems like your trying to "school" me like you think you always know more than everyone else......2011-09-08 23:20:00

Author:
evret
Posts: 612


What really sort of baffles me is why this sensor, in its current state, is necessary. You can create the same thing with a bolt, piece of holo, tag, sensor, and a gyroscope. That's why I created a test scenario to play with it. I just don't see it as a big leap forward in usefulness like the speeed and rotation sensors.
It's useful for when you are using multiple systems relying on the angle detection. Using a tag sensor can create conflicts when you find another copy of the item.
2011-09-08 23:35:00

Author:
SSTAGG1
Posts: 1136


...it seems like your trying to "school" me like you think you always know more than everyone else...

Defensive, much?

Just because I'm quoting your post, doesn't necessarily mean I'm talking just to you - if I wanted to do that, I'd send you a PM. I always figured the point of a public forum system is to share information with everyone - you've shared some ideas, and I'm sharing some different ideas. I'm not saying my ideas are better than yours, they're just alternatives.
2011-09-08 23:42:00

Author:
Aya042
Posts: 2870


Defensive, much?

Just because I'm quoting your post, doesn't necessarily mean I'm talking just to you - if I wanted to do that, I'd send you a PM. I always figured the point of a public forum system is to share information with everyone - you've shared some ideas, and I'm sharing some different ideas. I'm not saying my ideas are better than yours, they're just alternatives.

oh, by bad, so was there another reason for posting less versatile (changing the angle range on a sensor to change range movement is way easier than any other method), less reliable (just like movement matching, rotation speed matching will become out of sinc, especially when starting and stoping with high speeds) ways to kinda do the same thing without an angle sensor? (what was the thread topic again?)

if someone asked how to make C turn on only when both A and B where active, would you tell them to grab an AND gate from the tools bag or show them how to do it with pistons/winches and tags and sensors?
2011-09-09 02:45:00

Author:
evret
Posts: 612


Here's an example of multiplying the up/down and left/right from a Controlinator's left analog stick...

http://ic.lbp.me/img/ft/1ac4a2eae6c257ca70421837cafa91cf0f80ddff.png

...which reads "0.5937 x 0.4686 = 0.2787", which isn't quite right, but I attribute the error to an inaccuracy in the signal probe.

Obviously this can only ever multiply fractions of one, but combined with the "Rotation Speed" ratio scaling technique, gives you a lot of multiplication options just using two components.

Error is between chair and controller.

When you were using the sticks to set the multiplied values, you were not reaching an equilibrium point that would allow the rotation > rotation sensor to "catch up" as it were. You were lagging behind a little because your values were changing a little when you hit pause.

Take my test:

http://ic.lbp.me/img/ft/9aca54e516606fd489ecb13c1033ad8d8fe6e11d.jpg

.2183 x .5667 = .12371061

Pretty accurate to me, and all I had to do was allow the simulation to catch up to the values.
2011-09-09 02:51:00

Author:
comphermc
Posts: 5338


...was there another reason for posting...

I refer you to my earlier comment...

Sorry, I seem to have picked up rtm's bad habit of looking for the lowest-thermo solutions.
...although Comph is equally guilty of that crime, and it doesn't always end well (https://lbpcentral.lbp-hub.com/index.php?t=25137-Directional-Incrementation-Logic-Board) - some people seem to interpret alternative solutions as a personal attack, whereas I've always been appreciative of them, if for no other reason than they often inspire me (or others) to find more optimal solutions for the benefit of the whole community.

For example, one solution to the problem of storing an arbitrary analog signal with less latency than a Timer-based solution, started from the OP of this thread (https://lbpcentral.lbp-hub.com/index.php?t=52358-Analog-Memory-Cell), in which tetsujin posted this alternative solution...

http://i3.lbp.me/img/ft/853ca71c468dd060caddede6ddc5218369ce7c6b.png

...then hesido further optimized it based on his observations on three-input XOR gates (https://lbpcentral.lbp-hub.com/index.php?t=58316-Mini-tutorial-Applying-different-analogue-signals-to-a-single-input) to this...

http://i1141.photobucket.com/albums/n590/hesido/Gaming/D-latch-upgraded.jpg

..then I 'borrowed' an idea from one of Comph's tutorial videos, and ended up with this (https://lbpcentral.lbp-hub.com/index.php?t=59597-Analogue-value-storer-remapper)...

http://i5.lbp.me/img/ft/e0527fe888eab8ff9010121c9855a6ae2ad4eb18.png

...which I take no credit for, since it was really just a composite of other ideas, but hopefully the result is the lowest thermo (and lowest latency) solution to the problem for everyone's benefit.

However, if you have a better solution, I'd be very interested to see it.



if someone asked how to make C turn on only when both A and B where active, would you tell them to grab an AND gate from the tools bag or show them how to do it with pistons/winches and tags and sensors?

Well, that's a somewhat ridiculous example, but when providing solutions, I'll try to prioritize in favor of lower thermo (or sometimes lower latency depending on requirements) over flexibility. Based on the number of posts I see where people complain about running out of thermo, I assumed that low-thermo solutions were desirable.

Flexibility is typically less desirable in real levels - you usually have a specific problem to solve, and adding additional complexity to solve problems which don't actually exist, seems redundant.



Error is between chair and controller.

Bah. I'd (erroneously) assumed it was a zero-latency solution, but I just retested, and you lose a frame between the inputs and output. Shame, but it's still the lowest-thermo solution I can think of.
2011-09-09 04:28:00

Author:
Aya042
Posts: 2870


What really sort of baffles me is why this sensor, in its current state, is necessary. You can create the same thing with a bolt, piece of holo, tag, sensor, and a gyroscope.

It's probably to make it easier for less techie creators to do stuff with the Brain Crane. I image Spaff's mum was put behind a PS3 and asked to make a level, and she wanted to align a key with a lock, so they made her an angle sensor.
2011-09-09 09:58:00

Author:
Rogar
Posts: 2284


http://i3.lbp.me/img/ft/853ca71c468dd060caddede6ddc5218369ce7c6b.png


I could do that with only a not gate and a selector... and my eyes closed... and arms tied. lol
PS. Sorry for the off topic.
2011-09-09 12:05:00

Author:
zupaton
Posts: 167


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.