Altimeters -How big is too big?

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Thanks for that info about the sensors.

The only external components needed for the MCU are the boot eeprom (only needed when booting) and the crystal, so its pretty good like that.

The op-amps will detect when the pyro is fired and tell the MCU to cut off the current. If they brown out, its not a problem cause when they come back up it will be because the pyro's have fired :) (or timeout has occured, in which case there is a problem with the ignitor!)

The MCU will keep the current on for a period (to be determined) or until the pyro has fired, whichever comes first.

So readers, how long is the time it takes a high current ignitor to fire? and how may amps?
 
Originally posted by mtwieg
With those resistor values the voltage read by the ADC will be:
[9 * (RL / (RL + 3.3K)) * 101] / 4 while armed
and
[2.093 + 9 * (RL / (RL + 4.3K)) * 101] / 4 while unarmed
so in both these situations, RL can still be measured, but the way you calculate it must change depending on whether it is armed or not.

The second equation is not exactly true when there are multiple igniters present. In this case, its not possible to simply add RL+3.3k+1k, because some branches are connected in parallel, which affects the total current and therefore the voltage drop across the 1k resistor.
The voltage reading of the ADC will look like this (N is the number of connected igniters):
Vadc = 9V * ( (RL + N * 1k) / (3.3k + N * 1k) * 101/4
I made a little simplification by substituting the term 3.3k+RL[n] by 3.3k. Otherwise this equation would look quite ugly, without providing a relevant increase in accuracy (below component accuracy).

But there is a much bigger problem: The voltage, read by the ADC, is proportional to the unregulated battery voltage. But there is no circuitry on board that determines the battery voltage, so there is no way of knowing how big the actual resistance values are. Imho, a battery check should be considered. This is not only because of the resistance measurement, but it is a big safety plus, if the device can produce some kind of a low bat warning. This feature could be incorporated with a simple voltage divider, that adapts the battery voltage for the ADC.

Originally posted by basil4j
Good spotting! All those power and ground arrows began to look the same to me lol, ill make sure I change it :)
Have you considered using the “GND” symbol instead of the “VSS” symbol? This would make it quite easier to read the schematic.

Originally posted by mtwieg
One thing that boggles me is that other altimeters with MPX series pressure sensors claim to draw current less than the rated supply current of the sensors alone (like a few ma). This is technically impossible, unless I'm missing something.

You could use a FET to switch the MPX on and off. I don’t know how long it takes until the sensor delivers a stable signal, after it is switched on, but I guess this could work quite well with low sampling rates. Of course, low pass filtering wouldn’t work very well then.

Reinhard
 
Originally posted by Reinhard
The second equation is not exactly true when there are multiple igniters present. In this case, its not possible to simply add RL+3.3k+1k, because some branches are connected in parallel, which affects the total current and therefore the voltage drop across the 1k resistor.
The voltage reading of the ADC will look like this (N is the number of connected igniters):
Vadc = 9V * ( (RL + N * 1k) / (3.3k + N * 1k) * 101/4
I made a little simplification by substituting the term 3.3k+RL[n] by 3.3k. Otherwise this equation would look quite ugly, without providing a relevant increase in accuracy (below component accuracy).
That's true, and I don't see an easy way around it. Good eyes there, chief.

I suppose that since the MCU can tell how many loads are attached it could still do the calculations though. It would be a bit complex though. Not really a big deal, though since the continuity checks don't have to be fast.
But there is a much bigger problem: The voltage, read by the ADC, is proportional to the unregulated battery voltage. But there is no circuitry on board that determines the battery voltage, so there is no way of knowing how big the actual resistance values are. Imho, a battery check should be considered. This is not only because of the resistance measurement, but it is a big safety plus, if the device can produce some kind of a low bat warning. This feature could be incorporated with a simple voltage divider, that adapts the battery voltage for the ADC.
I made a suggestion a bit ago that would take care of this, as well as kill some resistors. By just putting current limiting resistors in front of the noninverting inputs, you protect the opamps from overvoltage, so they can be run off of 3.3V.

In light of the hassle that 1K resistor is causing us, you should make it as small as possible. You have a spare ADC input, correct? You can lower it by a lot and check if the think is armed with the ADC rather than the MCU.

pyros1.jpg

The input to the ADC will have to be protected. A limiting resistor may be enough, but you might need a clamping diode to the ADC's power rail. Depends on the ADC. Again, all resistor values are just estimates, and will need to be adjusted experimentally.

The battery voltage reader is also a fine idea, and is very easy to implement like Reinhard said. I suppose you would want to measure voltage across the large supply capacitor, not the battery itself.
You could use a FET to switch the MPX on and off. I don’t know how long it takes until the sensor delivers a stable signal, after it is switched on, but I guess this could work quite well with low sampling rates. Of course, low pass filtering wouldn’t work very well then.

Reinhard
That's an option. Since you have an accelerometer, you can just use that to detect liftoff and have the MPX sleep until then (maybe sample every few seconds to get a base pressure average). The wake up time for the sensor is 20ms, so you can't power it down between samples unless you want a much lower sampling rate, so it will be on continuously after liftoff. Unfortunately this is where brownout is likely to occur, so that's still a problem. Having the sensor sleep is still a good idea, though, since it will save power while it's idle, which is usually a long time. You should also see if there's a sleep mode for your MCU where is can be woken up by the ADC or other inputs.

Reinhard, I assume a P mosfet would be best for controlling positive supply voltage?

Right now if you want to cut current, the MCU is the biggest culprit. It may sting a bit, but try to cut down how many cores are working during flight and maybe turn down the clock speed (I assume propellers have internal system clock prescalers/dividers).
 
Wow! Thats a bit to digest!

Im just going out the door so ill have to keep this short until I get back tommorow.

I have a few sapre inputs on the ADC so connecting the safe/arm bit to it is no problem, likewise with the voltage test.

Regarding sleeping components. The Prop has a few functions which will allow it to 'sleep'. There is a command which waits for a pin to go high/low, one that waits for a given clock count, and another one for video which isnt too usefull to me...yet :)

While a core is waiting, it consumes only a few nanoamps even at 80MHz. I will be making use of this :)

It has an internal PLL; 2,4,6,8 and 16X. I will only be using a 5MHz crystal and perhaps a 4x PLL. 20MHz should be enough to do everything :)

Only about half the cores will be used during flight. I could probably do it all in 1 core, but the prop does not have interupts so I will need a bit of determinisim which the extra cores give.

Will comment on turning on/off the sensors when im back, outa time unfortunatly :(

Please discus while im away :) This is very usefull!
 
I have no idea how you're doing you're program, I don't see why more than one core at 4MHz shouldn't be enough. Of course, I know very little about the prop, so I can't say for sure. I don't use interrupts in my code either, and I get by at 1MHz, and the only peripherals I use are timer/counters in output compare mode. I assume the prop can do that, correct?

What kind of data filters are you using? If you're using something fancy like a kalman filter, then using multiple cores would be very useful.

As for getting out of sleep mode, what I would do is have the output of the ADXL also connect to a comparator which controls a wake up pin on the mcu. That way it will wake up whenever a certain acceleration is reached. This is easy for avrs, since they have an integrated comparator that is meant partially for this purpose. If the PROP doesn't, then adding your own externally wouldn't be a big deal. As a matter of fact, you could easily use your fourth op amp as a comparator for that purpose.
 
I like the look of that latest schematic, less components and using 3.3V for the cont test is easier to do on my PCB layout so thats another plus.
I will add the 9V battery test, but will still use 3.3V for the continuity testing.

Regarding powering the sensors. I will add an FET to the board to turn on/off the pressure sensor.
Lift off is acceleration based so its no problem to disable, I guess I could use a very basic FET as the current draw isn't very high!

During descent, I could also add a function which disables the accelerometer to save power. The data collected from it would be rubbish anyway after apogee. This would reduce the chance of brownout at least for low alt deployment.

When I get to the stage where Im adding an additional 2-axis accelerometer I can easily re-enable it but thats a long way off :)
 
Originally posted by mtwieg
I have no idea how you're doing you're program, I don't see why more than one core at 4MHz shouldn't be enough. Of course, I know very little about the prop, so I can't say for sure. I don't use interrupts in my code either, and I get by at 1MHz, and the only peripherals I use are timer/counters in output compare mode. I assume the prop can do that, correct?

I could run it as low as 1MHz, and if I need more speed could use the 16x PLL. This is as easy as changing a xtal so will consider this when I get to the finer details of programming.

Originally posted by mtwieg
What kind of data filters are you using? If you're using something fancy like a kalman filter, then using multiple cores would be very useful.

I have been looking at Kalman filtering and will amost certianly implement it in the future. For inital testing though I will use something simpler to make sure I have the hardware right :)

Originally posted by mtwieg
As for getting out of sleep mode, what I would do is have the output of the ADXL also connect to a comparator which controls a wake up pin on the mcu. That way it will wake up whenever a certain acceleration is reached. This is easy for avrs, since they have an integrated comparator that is meant partially for this purpose. If the PROP doesn't, then adding your own externally wouldn't be a big deal. As a matter of fact, you could easily use your fourth op amp as a comparator for that purpose.

I will be using a launch algorithim (which seems to be very similar to the Progressive launch algoritim I have seen around...) which may not work with a comparator as the prop needs to compare the actual ADXL reading (via the ADC) to a few numbers.

Which brings up another point about launch detection, but thats for another post lol

About that schematic you posted. Would having the 3.3V used for the cont test, tied to the 9V firing current cause troubles? Probably not but its worth asking :)
 
Oh! I have just had it pointed out to me that the P channel firing FET was around the wrong way!

The source should be connected to +9V and the drain to the load. I had it the other way around!

Does this seem right to you guys? Ive posted the correct diagram to be sure I understood correctly :)
 
Originally posted by basil4j
Oh! I have just had it pointed out to me that the P channel firing FET was around the wrong way!

The source should be connected to +9V and the drain to the load. I had it the other way around!

Does this seem right to you guys? Ive posted the correct diagram to be sure I understood correctly :)

That circuit leaves the FETs on all of the time. This hardly seems useful.
 
Originally posted by UhClem
That circuit leaves the FETs on all of the time. This hardly seems useful.

Hmmm I thought it was strange that only one person would say it...

Attached is the file I showed the guy, and here is what he said...

"(BTW, you've got the PMOS drain and source reversed in your schematic.)"

"On your PMOS FET, the source should be connected to +5V, and the drain to your load. You have it the other way around."

Which way is correct for a P channel FET? Im so confused right now lol
 
The sources on PFETS should be connected to positive voltage.
 
Originally posted by mtwieg
The sources on PFETS should be connected to positive voltage.

The source being the pin with the little arrow pointing towards it?

So that would mean the FET on the diagram you showed me was indeed reversed? In it the source was connected through the load to GND.
Which means the modified diagram I posted was correct?

UhClem,

If this were a depletion mode FET it would be 'normally on', this is an enhancement-mode FET which is normally off (Go Wikipedia :p )

If i'm missing something, could you please explain?

EDIT: UhClem, Sorry for the confusion, seems I had the depletion mode FET symbol in the diagram, my mistake its actually enhancment mode :)
 
I am very well aware of how depletion and enhancement mode FETs work. What I was referring to was the PNP drive transistor. Depending on the values of the resistors it will likely be on. Even if it isn't on the resistors by themselves are enough to turn on the FET.
 
Originally posted by UhClem
I am very well aware of how depletion and enhancement mode FETs work. What I was referring to was the PNP drive transistor. Depending on the values of the resistors it will likely be on. Even if it isn't on the resistors by themselves are enough to turn on the FET.

I know you do, sorry if it came across wrong, It was more for my own clarity :)

How would you recommend I avoid the situation you describe?
 
Originally posted by basil4j

How would you recommend I avoid the situation you describe?


If you insist on using a high side P channel FET then what you want is a NPN open collector driver. Dirt simple and been used for decades. Ditch those "bias" transistors as the built in resistors are not required and in fact hurt. Any general purpose NPN device will do. 2N2222A, 2N3904, etc.

The gate to source resistor will have the sole job of turning the FET off. When this happens all it has to do is discharge the gate capacitance. Because the capacitance is so low and the turn off time isn't critical, it can be of a very high value. The 47K shown is fine.

In order to apply the maximum voltage to the gate you will need to sink a current of (9V - 0.2V)/47K = 187uA. Given a nominal hfe of 100 this requires a base current of 1.87uA. A base resistor of 10K or so should ensure that the transistor is saturated and limit the base current to less than 330uA.

But what I would do is use a N channel FET on the low side and eliminate the need for a drive transistor. This would require some thought as to which FET to use given the gate drive of only 3.3V.
 
Originally posted by UhClem If you insist on using a high side P channel FET then what you want is a NPN open collector driver. Dirt simple and been used for decades. Ditch those "bias" transistors as the built in resistors are not required and in fact hurt. Any general purpose NPN device will do. 2N2222A, 2N3904, etc.

Ok thanks for the advise on that one.

Originally posted by UhClem The gate to source resistor will have the sole job of turning the FET off. When this happens all it has to do is discharge the gate capacitance. Because the capacitance is so low and the turn off time isn't critical, it can be of a very high value. The 47K shown is fine.

Great :D

Originally posted by UhClem In order to apply the maximum voltage to the gate you will need to sink a current of (9V - 0.2V)/47K = 187uA. Given a nominal hfe of 100 this requires a base current of 1.87uA. A base resistor of 10K or so should ensure that the transistor is saturated and limit the base current to less than 330uA.

I assume you are refering to the bias transistor base (rather than the FET) and going through a resistor to ground?

Originally posted by UhClem But what I would do is use a N channel FET on the low side and eliminate the need for a drive transistor. This would require some thought as to which FET to use given the gate drive of only 3.3V.

mtweig suggested in an ealier design, an FET which would do the job.
However, I think I will stick with the high side P channel (with the changes you have suggested) as it works well with the continuity test.
 
Originally posted by basil4j
I assume you are refering to the bias transistor base (rather than the FET) and going through a resistor to ground?

Almost but not quite. You need a resistor in series with the base to limit current. A resistor between the base and emitter is useless unless you are trying to bias an analog amplifier to a particular operating point. This is a simple switch that is either on or off.

To remove all doubt I have attached a schematic. It includes a simplified representation of the MCU output.
 
Originally posted by UhClem
Almost but not quite. You need a resistor in series with the base to limit current. A resistor between the base and emitter is useless unless you are trying to bias an analog amplifier to a particular operating point. This is a simple switch that is either on or off.

To remove all doubt I have attached a schematic. It includes a simplified representation of the MCU output.

Excellent, thats great thanks!

I have never seen a simple MCU output, very interesting :)

I take it this same circuit would work for both the firing circuit and for switching sensors on/off? (With a lower speced PMOS FET)
 
Another question (suprise suprise lol)

I am not throwing out what we have discussed, just exploring 1 more option :)

Could I use a NMOS FET in place of the NPN transistor? This could save a bit of power while switching?

The circuit attached is what I plan on using to switch on/off the power to the sensors as it has a low power consumtion.

If I was to use the same circuit, but with the FDS6681 PMOS FET (high current rating) instead of the IRLML6402 on the schematic could I also use this for the pyro circuit?
 
Good suggestion UhClem. For some reason in my head I had the transistor biasing the gate towards the collector, not the emitter. The way it is, it might be firing.

A P channel transistor will suit the purpose better. However, because the MCU I/Os will initially be tristate, the NPN base should be weakly biased to ground so charge can't build up on the gate and power the transistor at power up, correct?

the reason we're going with a PFET right now is because with the pyro on the low side, the voltages measured by the op amps will be closer to ground, thus allowing the op amps to be powered off a lower supply voltage, and also requiring less resistors. Not needing a low gate threshold voltage is just an added bonus.

And using an N mosfet instead of the transistor would also work fine. You would still need to bias it to ground though. Any normal SOT23 size part would do fine. The FDV303N looks good. I can't say whether it has any significant advantage over a BJT, though. What do you think, UhClem? You seem to understand transistors better than I.

And the sensor controlling schematic looks fine. Keep in mind, I haven't tried it myself, but I see no reason why it shouldn't work. When selecting the P FET, you're focus should be on a low on-state resistance at your VGS (-5V) so the voltage drop is minimal. Something like the PMV65XP. You need the voltage of your sensors and the ADC to be as close as possible to each other.

It's unfortunate that the MCU and the sensors run at different voltages. If they didn't, you could just power them with I/Os from the MCU.
 
Originally posted by mtwieg
And the sensor controlling schematic looks fine. Keep in mind, I haven't tried it myself, but I see no reason why it shouldn't work. When selecting the P FET, you're focus should be on a low on-state resistance at your VGS (-5V) so the voltage drop is minimal. Something like the PMV65XP. You need the voltage of your sensors and the ADC to be as close as possible to each other.

Maybe there is a catch that I have overseen, but I was just wondering, if it wouldn’t make more sense, to control the power of the complete analog section (including all the sensors, the ADC and maybe even the opamps and the sensing current for the igniters)? The voltage drop of the PFET wouldn’t create a difference between the ADC and the sensors, therefore eliminating this problem. Otherwise, a linear regulator, which can be shut down, could be used for the analog part. The number of components, that draw continuous power, would be reduced to the digital parts.

Reinhard
 
That's a workable idea too. However, we don't want to power down all the analog parts. At least the accelerometer has to be powered up so it can wake up the other parts. The pressure sensor takes up much more current than the others, so that's the prime concern. One could use separate voltage regulators with enable inputs, one going to the pressure sensor and one going to everything else. However, this would likely result in the supply voltages being less equal than with the P FET method. Most common regulators are accurate to around 0.5%, or 15 mv for 3V. the voltage drop over a low Rds P fet would only be a couple millivolts. It would save some parts, though.
 
Originally posted by mtwieg
A P channel transistor will suit the purpose better. However, because the MCU I/Os will initially be tristate, the NPN base should be weakly biased to ground so charge can't build up on the gate and power the transistor at power up, correct?

Ok , would 1K do?

Originally posted by mtwieg
And using an N mosfet instead of the transistor would also work fine. You would still need to bias it to ground though. Any normal SOT23 size part would do fine. The FDV303N looks good. I can't say whether it has any significant advantage over a BJT, though. What do you think, UhClem? You seem to understand transistors better than I.

Originally posted by mtwieg
And the sensor controlling schematic looks fine. Keep in mind, I haven't tried it myself, but I see no reason why it shouldn't work. When selecting the P FET, you're focus should be on a low on-state resistance at your VGS (-5V) so the voltage drop is minimal. Something like the PMV65XP. You need the voltage of your sensors and the ADC to be as close as possible to each other.


And I take it I could use the same NMOS FET (FDV303N) for both the firing circuit and the sensor power switch? For the PMOS FET, I would use the FDS6681 for the firing circuit, and the IRLML6402 for the sensors.

Originally posted by mtwieg
It's unfortunate that the MCU and the sensors run at different voltages. If they didn't, you could just power them with I/Os from the MCU.

I had thought of that :D But im trying to be difficult ;)


Originally posted by Reinhard
Maybe there is a catch that I have overseen, but I was just wondering, if it wouldn’t make more sense, to control the power of the complete analog section (including all the sensors, the ADC and maybe even the opamps and the sensing current for the igniters)? The voltage drop of the PFET wouldn’t create a difference between the ADC and the sensors, therefore eliminating this problem. Otherwise, a linear regulator, which can be shut down, could be used for the analog part. The number of components, that draw continuous power, would be reduced to the digital parts.

Good suggestion. In most situations during a flight this would work (e.g. during flight when both sensors are doing their thing). However, as mtwieg said, the ADXL & ADC will be required prior to launch where the pressure sensor will not be so I can't really shut them all down :(

The standby current of the ADC is only ~0.5uA so it would take more current to switch its power!
The ADXL is only 1mA when in use, now i'm not sure how to figure out the current needed to turn the power on/off to the ADXL, but it could be more than the power to operate it (could someone confirm this?)

Originally posted by mtwieg
It would save some parts, though.

So far im ok for space. The PCB is vert dense but I can fit all these SOT23 packages on without a problem. From what I can see, the routing shouldn't be too difficult either touch wood.
 
Originally posted by mtwieg
A P channel transistor will suit the purpose better. However, because the MCU I/Os will initially be tristate, the NPN base should be weakly biased to ground so charge can't build up on the gate and power the transistor at power up, correct?

No. No. A thousand times no.

The collector current in a BJT is controlled by the base current.

Pull down resistors are in no way required to make sure it is off. It will be off until current is provided to it. The reason that you need a pull down on MOSFET's in some cases is because the gate is simply a conductor separated by an insulator from the channel. There is no such isolation in a BJT.

The base emitter junction is a PN junction (assuming a NPN transistor) just like a diode. Would you put a pull down resistor on a diode to make sure it didn't conduct?

Of course not.

All it does is increase the amount of current required to turn the transistor on and waste space on the circuit board.
 
Originally posted by UhClem
No. No. A thousand times no.

The collector current in a BJT is controlled by the base current.

Pull down resistors are in no way required to make sure it is off. It will be off until current is provided to it. The reason that you need a pull down on MOSFET's in some cases is because the gate is simply a conductor separated by an insulator from the channel. There is no such isolation in a BJT.

The base emitter junction is a PN junction (assuming a NPN transistor) just like a diode. Would you put a pull down resistor on a diode to make sure it didn't conduct?

Of course not.

All it does is increase the amount of current required to turn the transistor on and waste space on the circuit board.

Ok then, so no pull down resistors with the BJT :)

What are your thoughts on using N channel FET in place of the BJT? Do you think there would be any benefit in doing this? (In terms of power consumption etc)
 
Back
Top