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

[LOGIC TOOLS] Speed Sensor, Signal Change Sensor

Archive: 13 posts


Hi guys, today i'll be showing you some logic pieces:

The SPEED SENSOR!
What it does is sense whether it is moving above a certain speed.
I'll be giving you a basic kit which you can customize to fit your situation:
This is what the basic kit looks like:
http://i9.lbp.me/img/ft/24902e425d6f325f2cd3385b0cb73a8398cb88f0.jpg
what it does is give out 1 output which is active while the object is moving (at any speed)

CUSTOMIZATION
To make our sensor give activate an output if our object is moving above a speed of 10 (what does this 10 mean? (https://lbpcentral.lbp-hub.com/index.php?t=47951-Guide-to-Speed-Rotation-and-length-units-in-LBP2))
We'll do the following:
1.Select the right most bottom microchip (the red one) and copy it:
http://id.lbp.me/img/ft/0cda5ea054a00aed7ddc2c55fa997584a035e372.jpg

2. Connect the middle input of the blue microchip and connect it to the input of the red microchip you just created:

3. Open up the new red microchip and tweak the blue tag sensor:
http://id.lbp.me/img/ft/ded4b15662a65138798fa3e5c70073970d9c342c.jpg

4. Set the tag sensor's tweak option "Maximum Detection Range" to 10 (or any speed you want)

5. Connect the output of the new red microchip to the "Active" input of the speed sensor microchip
http://i1.lbp.me/img/ft/4d1c3b6c73eb1ca9c8d1534a7de7dd31d12f622c.jpg

6. Disconnect the connection you just made.
http://ib.lbp.me/img/ft/33b527c85cac3567665a37cc701b0455497986e1.jpg
7. All done! now the new output we created will activate only when the sensor is moving above 10 meters per second.

You can do this with any speed you want!
Some ideas for usage:
- Attach to sackbot to make a sneaking level (trigger something if he moves too quickly)
- Use to detect speedy collision
- Puzzles (see tutorial level)

IMPORTANT
If you want to capture an object with the speed sensor, Pause time and move the object away until you can see the blue tag, and then capture the object without touching or going over the blue tag (capturing the little tags it emits will freeze your system, idk why)
BE CAREFUL!

The SIGNAL CHANGE SENSOR!
This is the blue component seen above.
It has 3 outputs:
1. Positive: gives out a pulse when "Input" changes to positive from negative
2. Negative: gives out a pulse when "Input" changes to negative from positive
3. Any Change: gives out a pulse when "Input" changes.
This is useful for implementing a clock for synchronized systems.

http://ie.lbp.me/img/bl/g86531-55e6590f.png
Play this level (http://lbp.me/v/xndn0t) to get them both!
This level contains some quick demonstration of usage of the speed sensor.
Please rate, comment and enjoy!
2011-02-11 00:09:00

Author:
saarraz1
Posts: 86


Dude, this certainly deserves a reply! Great idea and implementation; i was surprised by how sensitive it is in your level. The push-button demonstration was confusing because I didn't understand what the speed sensor was doing there. I had a similar problem to a lesser degree with the ball-on-elastic. The crushers were great demonstrations.

I guess this works by emitting a key and determining if that key is within trigger range or not? It'd be nice to have an explanation of how this works. Is the key on some 'ghost' object? Anyway, good job.
2011-02-13 00:50:00

Author:
merkaba48
Posts: 79


Hello again,

I have made an improvement to your speed sensor! Using this tidbit of info from Antikris's Tidbit post (https://lbpcentral.lbp-hub.com/index.php?t=47043-Did-you-know-that...-(tidbits-of-logic-I-learned)): "a NOT gate, set to Inverted and its output wired to its own input, can act as a very fast pulsing signal? ", I replaced your 0.1 second timer with this NOT gate setup and now it is even more accurate! So accurate even that for what I'm using it for, AS SOON as the object starts moving the sensor picks it up.

The difference I think is that 0.1 seconds is probably approx. 3 frames before it refreshes, but the NOT gate trick alternates the signal every frame. For my purposes, this is excellent.
2011-02-13 02:28:00

Author:
merkaba48
Posts: 79


Hello again,

I have made an improvement to your speed sensor! Using this tidbit of info from Antikris's Tidbit post (https://lbpcentral.lbp-hub.com/index.php?t=47043-Did-you-know-that...-(tidbits-of-logic-I-learned)): "a NOT gate, set to Inverted and its output wired to its own input, can act as a very fast pulsing signal? ", I replaced your 0.1 second timer with this NOT gate setup and now it is even more accurate! So accurate even that for what I'm using it for, AS SOON as the object starts moving the sensor picks it up.

The difference I think is that 0.1 seconds is probably approx. 3 frames before it refreshes, but the NOT gate trick alternates the signal every frame. For my purposes, this is excellent.
There is a reason i use 0.1 seconds and not a frame pulse, if I would have used frame pulses, the units of the tag sensor wouldn't correspond to the standard speed units of LBP (the units used by movers), thus customizing the sensor would be harder to do.

As for the implementation, i used tags connected to the outputs of the speed sensor, so surrounding objects can sense the speed of the object.
The button thing shows that the wall detects that a speedy object hits it and only then it blows up.
Without the speed sensor you could make it blow up on any impact, but with the speed sensor you can do it with regard to the object's speed.

I agree that the button demonstration was kinda clunky. Maybe I'll try to improve on it later on.
(I tried to make a nice demonstation level, instead of just giving away the object)
2011-02-13 08:13:00

Author:
saarraz1
Posts: 86


Wow, this sounds brilliant, and now that it exists, I think I have a use for it. Was planning on making missiles only 'arm' at certain speeds, so they do no damage when the collision is slow. Also, could make gear shifts based on speed of vehicle.2011-02-13 08:53:00

Author:
SSTAGG1
Posts: 1136


This is great tool but I am still going to use my simplified version of it.
It needs only emitter (frequency 0.0 and max 1) and a inverted tag sensor.
2011-02-13 12:45:00

Author:
waD_Delma
Posts: 282


This is great tool but I am still going to use my simplified version of it.
It needs only emitter (frequency 0.0 and max 1) and a inverted tag sensor.
Yeah but yours is useless when trying to sense different ranges of speed.
though yours is a tiny bit more responsive when trying to just figure out if the object is moving.
2011-02-13 13:26:00

Author:
saarraz1
Posts: 86


Yeah but yours is useless when trying to sense different ranges of speed.

You can change max radius of that tag sensor and use AND gate to combine several tag sensors together.
2011-02-13 13:33:00

Author:
waD_Delma
Posts: 282


You can change max radius of that tag sensor and use AND gate to combine several tag sensors together.
Then again how is it different from mine lol
2011-02-13 13:50:00

Author:
saarraz1
Posts: 86


There is a reason i use 0.1 seconds and not a frame pulse, if I would have used frame pulses, the units of the tag sensor wouldn't correspond to the standard speed units of LBP (the units used by movers), thus customizing the sensor would be harder to do.

Ah, interesting. I take back my rather hasty remark of having made an improvement, then! For my purposes the NOT gate trick works much better because I need to detect movement over very small distances in as quick a time as possible. Good stuff, thanks saarraz1.
2011-02-13 14:06:00

Author:
merkaba48
Posts: 79


Wow, never seen anything like it.2011-02-13 16:28:00

Author:
Unknown User


Very cool, maybe imma try making a speedometer with a number display
hmmmmmm...
2011-02-20 03:50:00

Author:
bob is named bob
Posts: 64


This is great tool but I am still going to use my simplified version of it.
It needs only emitter (frequency 0.0 and max 1) and a inverted tag sensor.

This is what I'm using atm - it gives a far smoother response due to the update every frame, allowing for perfect analogue representation of the speed as a relative value, updating at 30Hz. For my purposes this was essential (i say essential, probably not essential, more very, very beneficial). Note that for it to work well and get an accurate proportional speed value , you need to set the minimum detection range to 0.1 and do some fudging to not return 100% when not moving.


I don't see how it's "useless for detecting ranges of speed" though - it's perfect for that, the difference again is that it will detect ranges of speed more accurately against time.... Detecting speed is just a case of distance / time - the only difference between the two systems is that one has a smaller dt. You can even adjust radii to give this concept of x units / second, or x ms-1 if you have any use for such things - personally knowing that 60% is twice 30% is good enough for me.
2011-02-20 12:39:00

Author:
rtm223
Posts: 6497


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.