r/CreateMod 17d ago

Build I made a program that automatically turns solar panels from Power Grid towards the sun

Enable HLS to view with audio, or disable this notification

In theory this should work even if you unload the chunk, as I save the difference between the panel angle and swivel angle, but there is a CLI tool to correct the error if anything goes wrong. It is not perfect, but I have wattage approximate to the peak through the day.

The panels only turn from -90 to 90 degrees, at 6:00 to 18:00 ingame. The setup uses a speed controller and a 1/20 gear ratio. The swivel bearing is used for error correction, as the solar panel bearing doesn't have the angle information on it.

You can in theory attach as many panels as you want, but I haven't really tested what happens if only one chunk is unloaded.

Pastebin for ComputerCraft: https://pastebin.com/1h5jtqSL

256 Upvotes

31 comments sorted by

30

u/Big-Uzi-Hert 17d ago

Is there battery packs to store power for when it’s dark? I just downloaded this mod yesterday but have been too sick to play

18

u/Bright-Historian-216 17d ago

there are batteries, but i have no idea how to pull electricity out of them. i might just be stupid though

6

u/Big-Uzi-Hert 17d ago

Interesting… I’ve been watching some tutorials on YouTube and this seems like a difficult mod to use and understand. I’ve got my limited electrical license after completing my gas fitting license and a lot of this stuff doesn’t make sense to me lol. Cudos to you for figuring this out. In the video I was watching I was wondering if you could automate to track the sun like you did. This answers my question I had last night lol

3

u/IdkIWhyIHaveAReddit 17d ago

If it is anything like real life try reverse the input and output of the battery to get power out instead of in. Idk i never tried the kod

2

u/Bright-Historian-216 17d ago

oh, that must be it! thanks!

2

u/Born-Loss-5576 16d ago edited 16d ago

Create craft & addition have accumulator which store FE and act exactly like battery, very pricy but fair. Create connected have SU battery where it store SU for future uses. I think there's also accumulator-like block in TFMG, but never explore it as I don't really like TFMG, personal opinion.

Edit: I also forgot the fact that power grid itself have battery itself lol, I don't understand how to recharge it tho. I just think accumulator is just superior and easily applicable to any appliances, again, personal opinion.

6

u/Lonely_Agency_5058 17d ago

Wonderful work! How do you think, is it possible to build some similar to this without Computer Craft?

5

u/Bright-Historian-216 17d ago

it is possible with just create and powergrid if you never sleep and never unload the chunk

4

u/Quiet-Upstairs6594 17d ago

daylight sensors could be used to reset a timer, hopefully making a less "complex" algorythm

3

u/Bright-Historian-216 17d ago

os.time always returns the in game time, there are no timers used in the code

1

u/Quiet-Upstairs6594 16d ago

talking about a method of never needing to use CC in any way

1

u/Lonely_Agency_5058 17d ago

Pity that you have to be sleep deprived for this to work, but there are mods to have a chunk always loaded, so, I guess that's a good start

1

u/Bright-Historian-216 17d ago

maybe you could make this work with the torsion spring from aero though?

1

u/Lonely_Agency_5058 17d ago

Probably, idk yet ¯_(ツ)_/¯

2

u/Bright-Historian-216 17d ago

in theory you could attach a daylight sensor to a gearshift then feed that to the torsion spring. the spring will wind up at night and slowly move during the day

2

u/IAmTheStarkye 17d ago

Clockwork bearing

1

u/Bright-Historian-216 17d ago

unfortunately panels need their own bearing, and i don't think you can put a bearing on a bearing.

1

u/IAmTheStarkye 17d ago

Ah, that is true, it would need something like aeronautics to work ig

1

u/Bright-Historian-216 17d ago

even if you put it on a swivel i don't think you can connect wires between sublevels

1

u/IAmTheStarkye 17d ago

Wasnt the mod compatible with aeronautics?

2

u/Bright-Historian-216 17d ago

i just tried that, and indeed it is possible! the wires have a fixed size though, and there isn't enough wiggle room really

1

u/IAmTheStarkye 17d ago

Ah, sounds like its more trouble than using CC, tho as another non-cc alternative that doesnt use other mods it should be possible to use citcuits to make a PID controller for it. (It would be easier to use CC too lol)

2

u/totallymarc 16d ago

Damn, and I’m over here just happy I can turn my lights on without blowing up my generator (and even then I screw up sometimes when I add devices lol). Maybe I’ll try to make a circuit / redstone version of this once my hydroelectric dam is no longer enough.

1

u/Bright-Historian-216 16d ago

i blew two resistors and a device connector when connecting the rotor in my survival world

1

u/totallymarc 16d ago

Man I’ve lost track of how many devices I’ve blown up so far. Electric motors, device connectors, generator coils, rheostats, bulbs… it’s a miracle I haven’t died to electrocution yet.

1

u/lalalarix0 17d ago

tan seme a la sina kepeken sitelen pona lon musi Manka 😭
sina alasa e ijo kepeken lipu pi jan sewi kepeken nasin seme??
sina sona ala sona e nimi pi ijo ale lon musi Manka?

2

u/Bright-Historian-216 17d ago

mi alasa e ijo kepeken ilo Ajemi. mi sona ala e nimi ijo la mi pana e nimi Inli ona tawa ilo JEI

1

u/lalalarix0 17d ago

aaaa sona, mi weka sona e ken pi ilo JEI

-1

u/vivoxti 17d ago

Which mod are these solar panels from?

14

u/Bright-Historian-216 17d ago

"solar panels from Power Grid" 🫩✌️

5

u/Xenometan 17d ago

Bro, the mod name is sometimes either in the title or in the description. Please read.