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

Charging and discharging for vehicles

Archive: 8 posts


I want to make a rechargeable battery the Sackboy can can carry round and put into things to power them and only discharge when being used.. It need to be able to be recharged in say 5 seconds with 1 minuet of run time before empty. I need it to work right up until its empty and I need it to be visible to the player how much charge is in it.

I have a battery of sorts. Heres how it works so far. (Please bare with me this is my second time trying to build something in LBP)

I have a bit of sponge (my battery) which has a red tag sensor on it, a green tag and a microchip. On that micro chip is a yellow tag sensor connected to a timer which is connected to a red tag.

When the yellow tag sensor gets near a yellow tag it starts to power up (charge) the battery (the timer) which then activates the red tag, which then in turn activated the red tag sensor which then in turn activated the green tag.

I then take this to the car which has a green tag sensor and a grab sensor linked through an AND gate to the wheels.

So what I need to work out now is how to make the battery discharge as it gets used (visibly though the timer) and then how to do that only when its on the vehicle or thing its powering. I also need to know how to get it to power something even when the timer isn't full until it empties at which point it stops working and needs to be recharged.

I also need to work out how to make the recharges quicker then the discharge so for 5 seconds of charge I can have 1 min of battery life.

I know its a big ask but I'm stuck. Thanks very much. Al.

P.S. I hope I explained it well enough.
2011-01-25 22:22:00

Author:
fusioncell
Posts: 17


i would somehow wire the grab switch to the timer, that is if you can.
Hope it helped!
2011-01-25 22:52:00

Author:
Unknown User


Ok thats an intresting idea. So I have another tag attached to the grab switch and a sensor on the microchip. Then when the grab switch is activated it drains the battery. Clever Idea! Now I just need to get the actual dischage system working. That make a bar go down but that then doesnt represent the power.

My thought is to have the timer with inverted output on the microchip that leads to the red tag. That should power it (except at full power :/ ) Then when I grab it discharges the battery.

For charging I could use some sort of instant charging system using a chip through the reset field but if I am honest I would like it to last say 5 seconds. I could use a second timer to do that.

Squerl101 I love you! YOU HELPED ME SOLVE IT! THANK YOU SO SO MUCH

Of course now my only problem is the battery is a bit large so the player can see the power XD
2011-01-25 23:32:00

Author:
fusioncell
Posts: 17


To get different speeds of charging/discharging a timer, you can use different analog values of signal. So your charger will run at 100% signal strength, but your discharger will run at 5% (20/1 ratio) or whatever.

To do this, you might need a signal converter to change whatever signal is telling the batter to discharge from 100% to 5% (though you might be able to skip this step depending on how your logic is built). To make a converter, stick a batter on a microchip by itself and set it to 5% or whatever. Now feed whatever signal discharges the battery into the bottom of the chip: this will convert it to a 5% signal. Now just wire the battery into the negative end of a signal combiner, which will in turn be wired into the timer. Wire the charger into the positive end and you've got a battery that will charge in 5 seconds and discharge in 100 seconds (you can tweak the signal strengths to get different times).
2011-01-25 23:47:00

Author:
Sehven
Posts: 2188


What I have done is a bit simpler by using a timer on the reset of the timer that acts as the charge level. This is then just at the bottom of the battery as an extra tiny little display. Its not the neatest but its easy to understand and most importantly works! I will try your way though it just a little bit more complicated. The main problem is getting it to 'charge' I can get the timer to decrease or increase but not both unless I use the <-/-> setting at which point as soon as charge stops going in it starts to die. So the other option is the speed setting which I've got working but it wont go up and down just one way, hence the extra mini bar.2011-01-26 02:20:00

Author:
fusioncell
Posts: 17


I can't remember off the top of my head, and I can't get to lbp2 right now to test it, but one of the settings will keep the timer steady and will let you add to or subtract from it with a positive or negative signal. It might just be the on/off setting, but, as I said, I can't remember atm.2011-01-26 04:13:00

Author:
Sehven
Posts: 2188


I can't remember off the top of my head, and I can't get to lbp2 right now to test it, but one of the settings will keep the timer steady and will let you add to or subtract from it with a positive or negative signal. It might just be the on/off setting, but, as I said, I can't remember atm.

forward/backward
2011-01-26 05:07:00

Author:
fodawim
Posts: 363


Yep, just checked it. Forward/backward will always run backwards when there's no signal, unless it's hooked to something that can go both ways (like a thumbstick, 3way switch or a signal combiner). In that case, it will run forward when receiving a positive signal and backward when receiving a negative signal and will keep a steady charge when neither is on, so it will do exactly what you're trying to do.

[edit] Oops, I was wrong. "Speed scale" is what you want since you'll be dealing with analog signals.

Here's a pic of exactly the kind of rig I'm talking about. It's actually much simpler than I made it sound when I described it.
http://i5.lbp.me/img/ft/a95a188f454ba9b740545901d3b878f468a40292.jpg

The green tag sensor is the recharge (takes five seconds) and the red tag sensor is the discharge (takes right around 62 seconds 'cuz there's no round number that works for exactly five and sixty--you'd need a signal strength of 8.33% to get exactly 60 seconds). The battery is set to 8% strength, and the timer is set to five seconds and to receive "speed scale" signals. The other way you could do is to skip the battery/microchip combo and instead, hook an 8% battery into the tag that tells it to discharge and set the discharge tag sensor to "signal strength."
2011-01-26 07:36:00

Author:
Sehven
Posts: 2188


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.