Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

How to make a very simple solar tracker in seven easy steps

Discussion in 'Tutorials' started by Jacob Ellinger, Jul 5, 2016.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Jacob Ellinger Trainee Engineer

    Messages:
    45
    1. Name a Solar Panel solar panel lower case so it will never be the same as any other default Solar Panel.
    2. Name the Advanced Rotor that will be tracking the sun rotor, again lower case for reasons stated above.
    3. place a programmable block and a timer block anywhere so long as it's connected to the same grind as your solar tracker. Make sure you own everything.
    4. enter the code below into your programmable block.
    5. Set your timer to activate the programmable block and the timer block itself every second.
    6. Set your rotor to the lowest speed "about 0.6 but this depends on how fast you have your sun moving"
    7. activate timer block and your done.

    (note this only works with advanced rotors) How it works is it says "if solar power being made is x or less turn rotor on, else turn rotor off.
    Yes it's not 100% perfect in that you will lose a very small percentage but it's what I managed to make without any programming skills.

    Code:
    
    //Script Generated Using Space Engineers Programming Helper
    //http://www.seprogramminghelper.com
    
    float tempfloat = 0.00f;
    Color tempcolor = new Color(0, 0, 0);
    
    void Main()
    {
    var csolarpanel = GridTerminalSystem.GetBlockWithName("solar panel") as IMySolarPanel;
    var SolarReadout = csolarpanel.DetailedInfo.Split ('\n');
    SolarReadout = SolarReadout[1].Split (' ');
    tempfloat = Convert.ToSingle(SolarReadout[2]);
    if (SolarReadout[3] == "kW")
    {
    tempfloat = tempfloat * 1000;
    }
    
    if (tempfloat < 11000)
    
    {
    var advancedrotor = GridTerminalSystem.GetBlockWithName("rotor") as IMyMotorAdvancedStator;
    advancedrotor.ApplyAction("OnOff_Off");
    
    }
    else
    {
    var advancedrotor = GridTerminalSystem.GetBlockWithName("rotor") as IMyMotorAdvancedStator;
    advancedrotor.ApplyAction("OnOff_On");
    
    }
    
    }
     
  2. Forcedminer Senior Engineer

    Messages:
    2,227
    I'm still trying to understand SE's scripting but i have to wonder. :p

    if the solar panel isn't getting any power does it spin aimlessly until it does?
    I've a feeling if i tried to code that would be the end result.

    amusing but not power effective at all.
     
Thread Status:
This last post in this thread was made more than 31 days old.