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

Yet another way to divide signals.

Archive: 8 posts


I've seen many ways to divide signals. We've done this https://lbpcentral.lbp-hub.com/index.php?t=53559-How-to-divide-analogue-signals&highlight=dividing+signals and this https://lbpcentral.lbp-hub.com/index.php?t=74799-Division-of-Signals&highlight=dividing+signals, and now, we're going to do this. (Caution: This is kind of logical and crap.)
http://if.lbp.me/img/ft/edf515b513c779bbee67e96e60f622a47baaa47c.jpg
This is my method of dividing signals. It can perform a/b, where a and b are between 0 and 100. There is a green tag on each piece of sticker panel. The tags are the same (no labels). The tag on the left sticker panel and the microchip on the right piece are exactly 100 units away from each other. The tag sensor on the right piece's microchip has a maximum detection range of 100 units, a minimum range of 0.1 units (so the analog signal will be more accurate), is set to closeness, and detects the green tags. It's output goes through a NOT gate before going into a signal probe, so the output is 100%.
The whole setup works by using a gadget I made called the center seeker, which is placed on the green piece of sticker panel. It can find the center of an area whose borders are marked by 4 tags. An example is the center seeker in a box. If all four of the box's sides are marked by tags, then the center seeker will always find the center of said box, no matter where it is in the box. The original center seeker could originally move around on both the x and y axis, but the one used here only moves around on the x, so it only needs two tags.
http://i6.lbp.me/img/ft/ab6d4edef578fc6f1864982376b2f5a0f4faeb25.jpg
(The center seeker).
As you can see, it has a green tag on it. The center seeker will find the center of the two red pieces of sticker panel, and since it has a green tag on it, the tag sensor detects that instead. It outputs something close to 50% (tag sensors are not pinpoint accurate), so it's like we're dividing by two.
What happens if we place another center seeker inside?
http://i6.lbp.me/img/ft/7d6c8d08875335d2aabd8099d3273b532c3c6b51.jpg
Wait for it...
http://i2.lbp.me/img/ft/82233f675975ecb1e350261704f153741dd8c74e.jpg
This happens. The left center seeker finds the center between the left red and the right center seeker, and the right center seeker finds the center between the right red and the left center seeker, meaning equal distance between all of them. The tag sensor, detecting the nearest tag, outputs something like 66.66%-run through the NOT gate, that becomes 33.33. So, we have pretty much divided 100 by 3. See the pattern? If we had 3 center seekers, it would be like dividing by four, four center seekers, like dividing by 5, and so on.
Here is 100 divided by 7.
http://if.lbp.me/img/ft/b8febbaac36d4cba69b0b7e177c87b93df63f522.jpg
It's only kind of accurate, though.
But say, what if you didn't want to divide something other than 100? Like 50/3, or 30/2, instead of just 100/b?
Well, you can do this:
http://ia.lbp.me/img/ft/74a7582176519d42cd0526460bec81381da79ee7.jpg
What I did is move the left red 60 units towards the right red, so now the NOT gate outputs about 40%. Now I can divide 40 by any number.
http://i3.lbp.me/img/ft/e835f995b1c8b4e018522e3c665f9e9ed4edc61d.jpg
40 divided by 5. It's something like 8%.
So that's my method:
Pros:
Simple compared to other methods.
Does not involve much math
Extremely customizable and tweakable.
Cons:
Not very accurate
Can take a long time to work.
Cannot handle negative values, although I may add logic that lets it.

So that's pretty much my method. So yeah.
(Thanks Creator's Toolkit for the sweet logic probe!)
2012-10-25 03:56:00

Author:
Kalawishis
Posts: 928


EDIT: Yes, I know I'm double posting but I made some very important edits. The pictures should now show up, meaning you people can now actually understand this tutorial. Plus I improved the writing to make something more clear.2012-10-31 23:29:00

Author:
Kalawishis
Posts: 928


your center seeker seems over-complicated, all you need is the 2 sensors wired to a combiner, then wire that directly to the mover. if it moves away from center just invert the combiner or swap the wires

also it's not that the sensors are inacurate, it's because when the seeker is really close to center the signals are too small to affect the mover

and


(Thanks Creator's Toolkit for the sweet logic probe!)
you're welcome
2012-11-02 13:30:00

Author:
evret
Posts: 612


your center seeker seems over-complicated, all you need is the 2 sensors wired to a combiner, then wire that directly to the mover. if it moves away from center just invert the combiner or swap the wires

It's not just that. If I used the design you specified then the center-seeker would wobble back and forth (since it overshoots the center) unless I set the speed to a super small speed like 0.1 (making the whole thing take a long time to work). I know this for sure because this was the original design of the center seeker before I made an important change.
I made it so that the center seeker started off at a high speed, but as it got closer to the center it slowed down. So it would start off at, say, 10 but would be traveling about 0.1 when it's almost exactly on the center. I would measure the difference between the signals from the right tag sensor and the left one on the center seeker, wire that to an AND gate and wire that gate to the Advanced mover. To prevent analog confusion, the other input of the AND gate (telling the Advanced mover to move left or right) had to be completely digital (+1,0,-1). That explains the complexity.

also it's not that the sensors are inacurate, it's because when the seeker is really close to center the signals are too small to affect the mover

I'm not sure about that, because if that were true then if I placed the center seeker left of the center, then the answer should be about 50.08 because the mover would have stopped by then. But it's 49.92 no matter what side I start on. Although you could be right though. I'll do more tests.
2012-11-02 21:36:00

Author:
Kalawishis
Posts: 928


It's not just that. If I used the design you specified then the center-seeker would wobble back and forth (since it overshoots the center) unless I set the speed to a super small speed like 0.1 (making the whole thing take a long time to work). I know this for sure because this was the original design of the center seeker before I made an important change.
if you have both acceleration and deceleration at 100 it stops it from over shooting the center, you may need a lower speed for the distances you are working with but it shouldnt need to be any lower than 30

I made it so that the center seeker started off at a high speed, but as it got closer to the center it slowed down.
the very nature of tag sensors set to closeness causes it to send a lower signal as it gets closer to the center, so there is no need to do it via logic and there is no need to use digital.
2012-11-03 01:37:00

Author:
evret
Posts: 612


the very nature of tag sensors set to closeness causes it to send a lower signal as it gets closer to the center, so there is no need to do it via logic and there is no need to use digital.
And that would work if I were only using one tag sensor-but I'm using two. The analog signals from the two sensors, added up, will always be the same number. So as it approaches the center, one tag sensor will increase its signal and one will decrease-depending on whether it is right of left of the center. When the center seeker is in the center, the two tag sensors' analog signals are equal. Typically, they would both converge to something like 50%. That's why I have extra logic to measure the difference.
If I only used one tag sensor then I wouldn't be able to tell position or where to go.

if you have both acceleration and deceleration at 100 it stops it from over shooting the center, you may need a lower speed for the distances you are working with but it shouldnt need to be any lower than 30
I'm pretty sure that's not the case but I'll check soon.
2012-11-03 04:35:00

Author:
Kalawishis
Posts: 928


You don't seem to be getting my point, you either have a unique tag for each side, or you have the radius limited to left for one and right for the other. If you wire both directly to a combiner, then wire the combiner to a mover with max acc and dec it will find the center. This works as I have been using this technique since lbp2 first came out. My 3d shooter dem bones completely relies on this type of setup to dynamically move the point of level rotation around the player instead of around the center of mass.2012-11-03 05:37:00

Author:
evret
Posts: 612


...Okay I did some tests.
Turns out, evret, you're right about everything.
You were right about the center seeker being to complicated. This center seeker was based off a different design made by me.
http://i0.lbp.me/img/ft/40072dbeee3e010cb2cea22c2ef48f8fc8a50667.jpg
It shot out it's own tags to reference itself from. The tags would stick to any surface, which would be interpreted as the center seeker's container. The way the logic for this one was designed, made it so your methods wouldn't work.
But now, this is the new design.
http://i3.lbp.me/img/ft/c0343c27e6b64f2c6f94c48795165bc48ee23427.jpg
Stripped of unnecessary creator's toolkit logic it now can use your methods, which are much better. It slows down automatically and I can set the advanced mover to a much higher speed, in this case 100. This also makes the entire machine more accurate, proving that the movers and not the tag sensors caused the inaccuracies.
I improved the entire division machine a lot. I moved around reds 0.1 units here or there, tweaking, to allow for greater accuracy. The machine is usually accurate to 2 places and is sometimes perfectly accurate. Also (due to supernormal signals) it works a lot faster.
http://i0.lbp.me/img/ft/360214a728c0636a9637c1de572d1ae6847912a5.jpg
All functions of this can be operated by a controlinator.
2012-11-03 16:52:00

Author:
Kalawishis
Posts: 928


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.