I'm a bit of an electronics noob and haven't been able to find a straight answer to this question despite doing quite a bit of research, so I figured I'd ask it here. I am working on an autonomous RC-scale airplane that will be powered by solar cells on the wing during flight. There is also a 3S 4200mAH Li-ion battery on board to serve as a backup in case of cloud cover/higher power demand, like during takeoff and while climbing. There will be 20 solar cells on the airplane which will produce a peak voltage of about 12V in direct sunlight, but this may drop depending on conditions.
Now on to the question: How do I use the solar cells to power the on-board electronics, motors, and servos and also charge the battery when power demand is less than production? I estimate that the plane will use 35-45W of power while cruising and will produce 72W of power in direct sunlight. While climbing, it could use up to 350W of power. I bought a cheap BMS module a little while ago thinking it would be all I needed, but now I'm not so sure since the input voltage will vary and the BMS should be primarily for protection anyway.
Thanks in advance!
Edit: I forgot to mention that extending the lifespan of the battery is a priority. Since the airplane will hopefully have very long flight times and won't need to dip into battery power very much, fast-charging the battery every time it discharged at all and/or charging it to 100% capacity would likely result in it wearing quickly.