Ferdinand, yes, you need to provide more details about your hardware, but from your code I can only assume you are using a Alegro Hall effect device to measure the current, maybe a 712 or 758 type device, and that the device is a bi-directional device, not uni-directional.
Not sure where to start with your code, but it needs a fair amount of work and it would help you if you could document it far better than you have. Even document each line.
But, the code you have as follows;
SA = ((((analogRead(1)) * (5.0 / 1023.0) - 2.5) * 20) * -1);
Will give you the problem you are experiencing. The reason is that you are trying to null out the Vcc รท 2 offset of the current sensor, which, when the ADC is hovering around 512 counts, being zero current, will go make your variable of SA, being a double, go negative.
A simple fix would be to do a check of the ADC value, and if it was around 512, then do not null out the offset.
Only null out the offset of 2.5 while the ADC count is greater than 512.
The above is not the best method as you will find that you will in practice get different values for each current sensor that will not be exactly 512, but will instead float around this area due to noise and temperature and your Arduino ADC Vref accuracy.
Also, why do you have delays in your function void calculations() ?
I see no reason for them, avoid using the delay statement, rather, if you need delays or times events, then look at the example 'blink without delay'
Another thing is that you are constantly writing to the LCD in each loop cycle, which may create issues as your program grows.
What size solar system are you working with ?
Paul