r/CreateMod • u/Bright-Historian-216 • Aug 17 '26
Build I made a program that automatically turns solar panels from Power Grid towards the sun
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
6
u/Lonely_Agency_5058 Aug 17 '26
Wonderful work! How do you think, is it possible to build some similar to this without Computer Craft?
5
u/Bright-Historian-216 Aug 17 '26
it is possible with just create and powergrid if you never sleep and never unload the chunk
4
u/Quiet-Upstairs6594 Aug 17 '26
daylight sensors could be used to reset a timer, hopefully making a less "complex" algorythm
3
u/Bright-Historian-216 Aug 17 '26
os.time always returns the in game time, there are no timers used in the code
1
1
u/Lonely_Agency_5058 Aug 17 '26
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 Aug 17 '26
maybe you could make this work with the torsion spring from aero though?
1
u/Lonely_Agency_5058 Aug 17 '26
Probably, idk yet ¯_(ツ)_/¯
2
u/Bright-Historian-216 Aug 17 '26
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 Aug 17 '26
Clockwork bearing
1
u/Bright-Historian-216 Aug 17 '26
unfortunately panels need their own bearing, and i don't think you can put a bearing on a bearing.
1
u/IAmTheStarkye Aug 17 '26
Ah, that is true, it would need something like aeronautics to work ig
1
u/Bright-Historian-216 Aug 17 '26
even if you put it on a swivel i don't think you can connect wires between sublevels
1
u/IAmTheStarkye Aug 17 '26
Wasnt the mod compatible with aeronautics?
2
u/Bright-Historian-216 Aug 17 '26
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 Aug 17 '26
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 Aug 17 '26
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 Aug 17 '26
i blew two resistors and a device connector when connecting the rotor in my survival world
1
u/totallymarc Aug 17 '26
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/Novel_Emu_8191 Sep 23 '26
The computer keeps saying the ‘c’ is a nil value (line 23). How do I fix that?
Also how did you get it all wired up? I can’t figure it out
2
u/Bright-Historian-216 Sep 23 '26
the first few lines after the large comment are the constants that the program uses. c is the rotation speed controller. modify the code so that c points to the correct peripheral id.
the wiring involves a 1/20 rotation ratio. i don't remember precisely, but i think the analog lever powering the adjustable chain drive (or whatever it's called) is set to 3, and everything else is just basic cogwheel division by two.
1
u/lalalarix0 Aug 17 '26
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 Aug 17 '26
mi alasa e ijo kepeken ilo Ajemi. mi sona ala e nimi ijo la mi pana e nimi Inli ona tawa ilo JEI
1
1
u/Terrible_Cellist6417 Sep 22 '26
i was just planning on doing this out myself :0 thank you for saving me some time :>
-2
u/vivoxti Aug 17 '26
Which mod are these solar panels from?
13
5
u/Xenometan Aug 17 '26
Bro, the mod name is sometimes either in the title or in the description. Please read.
33
u/Big-Uzi-Hert Aug 17 '26
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