Oh wow, you've really thought out the triggering part eh?!
I'll confess, I think I'm a bit out of my depth when it comes to calculating force from a solenoid, but I will simulate the current waveforms of the solenoid in LTspice anyway and see what happens. The reason I've been typing so much (sorry btw..) is mainly for the charging circuit. I've designed a number of low voltage (3-15V) to high voltage (100-800V) capacitor charging circuits for various apps, and it is a nice feature to have constant current draw from a power supply. Many schems/designs on the internet rely on a fixed power supply voltage, and component limits meaning the charge time and efficiency vary greatly - handy for a quick and dirty approach, but not very elegant and often try to charge up a cap as quickly as possible.
Ok, so here's my understanding of the specs of what you require from this charging circuit (note, I'm not talking about the triggering specifications like pulse width.. sounds like you have that in the bag!)
- 45 seconds MAX charging time. Assuming worst case battery voltage of 7V and the charger constantly being 'on' between shots.
- 100uF HV cap charged to 90V or 60V - final charged voltage configurable via the PIC (maybe a pot to an ADC to set it?)
- 50K resistance from HV cap to GND, used as a voltage divider to monitor cap voltage for the PIC.
- Power supply is a 9V battery, with a variation of say 9.6V max, and 7V when fully depleted.
Ideally, current draw from the battery should be steady (no massive current spikes), and as low as possible (for efficiency/batt life). So obviously that means not charging the cap at full blast within 1.5 seconds, then waiting 30-45 seconds before its actually discharged (when the trigger is pulled). With a 50K (47K + 1K) voltage divider to monitor cap voltage, it'll discharge through that 'fairly' quickly anyway (RC time constant RC = 100uF * 50K = 5 seconds, 60% of cap voltage lost in 5 seconds..)
My suggestions:
1. Use a larger inductance, but with a lower peak current. So say a 330uF inductor, but only rated at 0.4A - doesn't have to be physically bigger. This will give you more control over peak current, since it'll rise slower, meaning your PIC can vary the on time from 1uS (peak current = I = Vt/L = 27mA) to say 20us (Ipeak = 545mA). It'll give you more room for experimentation, so you can adjust it accordingly - either to compensate for battery drain, or just to optimize it in field testing.
2. Pick an off period so that the capacitor can fully charge within the minimum time required. You said 45 seconds, but maybe for room for error you might want it to fully charge within say 20 seconds? This means you won't have to wiat the full 45 seconds, but also means that it'll draw more current (charges quicker) and that the cap will need 'topping up' because every 5 seconds you're not charging it - it'll be discharging via your resistive divider. which leads me to....
2a. Even though its an extra chip, you could buffer your voltage divider with an opamp voltage follower. An LM358 will provide the lower input impedance to the PIC, draw little power, but with a massive input impedance meaning your voltage divider can be 10x its value (470K instead of 47k). This will greatly slow down the natural discharge of the cap when its idle.
2b. I would up the value of the resistive divider anyway - without an opamp. The input impedance specs of the PIC's comparator is for optimum speed. That is detecting voltage changes in the uS range. As your cap is charging over a period of many seconds, the difference in input impedance just means the comparator will take a few mS to trip. So your cap will 'over charge' by a tiny amount. Its less accurate, but also less wasteful
3. Perhaps using a clever bit of software, use the ADC of your PIC to directly measure the voltage from the resistive divider. Or perhaps change the comparators reference so you can detect when its over a certain voltage. So if your battery's voltage is sagging, and its taking longer to charge, you can periodically check if the caps voltage is at a point where it should be during a charge cycle. Say you check it every 200ms. If its lower than it should be at that time, then you can reduce your 'off period' so it charges quicker. Essentially, speeding up (or slowing down) the charging so its guaranteed to reach its desired voltage after a certain time. This is a crude but effective way of compensating for battery voltage variation.
3b. Related to above. If you spend 10-20 charging it, but don't fire for 45 seconds, then even with a high resistance voltage divider, the caps voltage will still droop. So using the above 'checking every 200ms' you can determine when to top it up, by turning the charging PWM back on until its voltage is reached, then turning it off again. Ultimately, from a cold start (cap = 0V) it'll do a full charge. to 90V..wait until the caps voltage has dropped below say 80V (be it because you've pulled the trigger discharging the cap, or just left it) it'll start charging again.
4. Probably should have been #2 but I'm still going with it. Use a low peak current for the inductor, say I dunno, 100- 200mA. So your PWM period is shorter (fixed on time for the peak current, but shorter off time). It'll reduce resistive losses in the inductor, reduce the strain on the battery, but it will mean a higher switching frequency which increasing losses in turning your MOSFET on and off. Its all a balance. As you've realised (me too in fact) its very easy to charge caps as quickly as possible, but difficult to slow the process down without losses.
I was dubious about the use of a microcontroller. But I see it gives you great control over all the timings and voltages - very handy not only for development, but also in-system changes, like modifying the pulse voltage to change the power of the solenoids firing pin. The downside being, software development, and the fact micro's are rather slow in switched mode power supply control loops. But as you're not trying to charge the cap in 100mS, or using a switching frequency of >50kHz, its more than fast enough to monitor things and make adjustments. In fact you've inspired me to try this myself!