Introducing the TinyTIM

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

martinjaymckee

Well-Known Member
Joined
Mar 14, 2015
Messages
61
Reaction score
0
I thought that I'd show people what I've been working on recently – in the area of rocket electronics. I'm working on developing a high-speed data-acquisition flight computer. I decided ( on a whim ) to call it the TinyTIM ( Tiny Timing and Instrumentation Module ). It's basically just a flight computer. The only real "innovation" is that this first version will be able to sample most of its sensors at 500Hz. The available sensors on the board are:

MPU6050 ( with 3-axis, 16-g, accelerometer; and, 3-axis, 2000 deg/s, gyroscope )

ADXL375 ( 3-axis, 200g, accelerometer )

MS5611 ( 24-bit, barometer/altimeter )
HMC5883L ( 3-axis, magnetometer, which I'll not be using in the first versions )

All of the sensors except the magnetometer would support 500Hz. The magnetometer is something of a dog, at 80Hz max. In any case, I may not use it for anything. It just happens to be on the board.


I'm actually using breakout boards for the sensors while I'm working out a first version of the software, here's the setup:
tiny_tim_v1_test_1.jpg

Working from right to left, the first board is a USB-Serial converter that is being used -- initially -- for debugging output and power ( the 5v from USB ). Eventually, of course, this same serial connection will also be used for configuration and data download. Above the breadboard is the JTAG interface I'm using to program/debug the processor on the TinyTIM. The middle two boards are: above, the IMU breakout board, and, below, an accelerometer breakout board. Most of the sensors are on a Chinese IMU sensor breakout board, the GY-86. They are readily available and inexpensive. The GY-86 carries the accelerometer/gyroscope, the magnetometer, and the barometer. The secondary accelerometer is on a board I designed ( just to see if I could hand solder the blasted things! And yes, I was, indeed, successful :) ). Since It was a soldering test, mostly, I have an ADXL343 on the board. It has the same interface as the ADXL375 that I would use in flight, but it is cheaper ( about half the price ) so I decided to use it for the soldering test and ground testing. The last bit, all the way to the right on the breadboard, is the TinyTim itself. It's actually designed for the GY-86 to be back mounted. This is the v0.1 TinyTIM board which didn't have a spot for the secondary accelerometer. Later versions mount that as well ( on a board the same size ).

The board features a 32-bit ARM microcontroller, two deployment events outputs ( the drive MOSFETS are not currently mounted, however, they will be good to about 10A ), a built-in magnetic switch, and 16MB of storage memory. Additionally, the board has the serial interface and two GPIO pins that can be configured as either digital input/output or analog inputs with a range of 0-3.3 volts. The board itself is 21mm x 45mm, around the same size as an Eggtimer Quark or the Featherweight Altimeters Raven ( that I'm still lusting over! ). It's not targeted to compete with current flight computers, I have one, fairly specific, goal in mind for this one -- blazing fast acquisition rates. Missing, at the moment, are separate deployment and logic batteries, a buzzer, a couple of GPIO ( I'd like to have four, at least ), and an on-board button for configuration/testing. I'm not sure that I'll ever add the "missing" items though. I'm not designing this to be a "kitchen-sink" flight computer.



As I said, it's a fairly standard flight computer. It does have a couple more sensors than usual, but, the real kicker is the sampling rate that should be possible. The version above -- v0.1 -- has all of the sensors on the I2C bus and the sample rate target is 500Hz continuous ( which will fill the memory in about ~400sec. ). The final goal, however, for a real version 1.0 board is to have barometer sensing at 700Hz and the gyroscope and accelerometer sensing at 2.1kHz. That will necessitate moving the sensors over to an SPI bus ( and putting them on my board, as the GY-86 doesn't break out the pins needed for an SPI interface ). At that speed, the memory will only last for a bit under a minute-and-a-half, but it will have stored a whole ton of data. I like data!



The sensors are all of fairly high resolution ( 24-bits on the baro, 16-bits on the magnetometer, gyro, and accelerometers ), so after calibration, the data will be clean. Clearly, though, the high data rate is going to mean a fair amount of noise in the system. As such, later work is going to be going towards developing software that can process the data to it's best effect. Also, I've got some ideas about how I want the deployment events to work. I like everything to be flexible ( some would say, too flexible ), so I'm planning to have a number ( likely sixteen ) of programmable events of different types: comparison events ( against values in the system ), timer events ( for expiration of a timer that can be started by another event ), boolean events ( to combine other events ), and maybe others. Setting up deployment actions would be based on these events. Of course, the actions would be configurable too. Once again, lots of work will need to go into PC software to make all this work. And, because it would be such an involved setup of the system, I think that a ground-test facility is absolutely necessary. I'd be tempted to integrate it into OpenRocket, but that might be a bit more than I really want to undertake. In any case, I'll need some way to do a complete simulation of a whole flight to check the configuration.


Some other thoughts on features that I would like to include -- with the same basic flight firmware and possibly different hardware -- are: telemetry ( actually, with an external radio, this board could do this just fine ), GPS tracking, more deployment/staging outputs ( and safer outputs... the current design has almost zero protection ), more inputs and outputs. My goal for the TinyTIM is to keep it small enough to fit in a 24mm tube, and for a more complete version to fit in a 38mm ( or, if I'm really good, 29mm ) tube.


It's a fairly ambitious project ( if only for the data-rates involved in both sensing and streaming to the memory ), but it's coming along fairly well so far. I don't have much to show at the moment, as I've just been assembling the hardware, doing very basic electrical tests ( it didn't blow up when I connected power – check; it does turn on – check; etc. ), and writing a first version of the libraries to communicate with things, and it's working. I can read from the sensors and talk to the computer. The SPI, as well, seems to be working though I have yet to actually do a write/read test with the memory. I've actually got quite a bit more work to do on the memory interface because I need to get that working with DMA ( direct memory access ), so that writing data to memory is done mostly without processor intervention. Otherwise, I won't be able to make the loop timing.



So, thinking about time frame here. I've got a version 0.3 board at the fab right now and I should receive it in a week or two. I'm hoping to have all the components I need for that before hand and most of the test code done so that I can have a working device by mid-May. I've already got the two mule airframes built ( just waiting on final markings and parachutes ).
mule_1.jpg

They are nice and small -- based on BT-55 tubing -- so they should be able to loft the the test payload I have in mind ( an Eggtimer Quark along with the TinyTIM ) to nearly 275 m on just an Estes D12-7 ( the mule can also easily handle an E12, E15 or even F50 ) – should make for an inexpensive and flexible flight program. Once I can actually fly it in recording mode ( with the basic lift-off triggering in place ), I'll do a half-dozen flights for sensor checking and so forth, then start working on the next major piece of this whole thing – the flight software. Version 0.3 is going to upgrade the processor speed from 24MHz up to 72MHz ( max ) and the data memory from 8kB up to 36kB, so it should allow for many more capabilities than I had originally intended for this small board. I'd guess I might have a really functional Version 0.3 with flight software and a basic computer-based interface in about six months ( another couple dozen flight tests too, of course, without actually activating any flight events ). Then I'll build a new mule for dual-deploy tests and do a series of a half-dozen or so. By that time I should have enough information to do a solid redesign of the board, moving all the sensors on-board, and possibly doing another processor upgrade for expanded memory and processing rate. Then another couple of months to finalize the firmware and computer interface. If I'm lucky, I'll have it all done by December, just in time to start thinking about using it for an R&D project for NARAM 2017.



Oy!

Any thoughts or comments are greatly appreciated. This won't be a quick build by any means, but I'm hoping to have something more to show here soon.

Cheers,
Martin Jay McKee
 
Your sample rates seem a bit low to me. But then I am working on recording the MPU-6000 at 8,192 SPS using a measly MSP430. But some questions/comments:

1) The sample rate on the MPU-6050 is not well controlled with at best 1% accuracy when using an internal clock. Depending on what you want to do with the data this could be a problem.

2) The MPU-6050 sample rates do not match your recording rates. How will you handle decimation?

3) Good luck soldering QFN packages. I am 1 for 2 now.
 
Wow that's a heavy project . I hope you succeed in your efforts . I did some work with a arduino mini and an uno once but nothing of this magnitude . I am definitely interested in what you are doing. Keep up the hard work. I will be watching this thread.
 
Not many people that would consider 500 Hz a low sample rate for a rocket flight computer! Anyway, It's a start. I'd certainly be interested in how you are going to keep up with storing the data at a rate of 8,192Hz. Also, I was aware that the gyroscope could reach that rate, but I was unaware that the you could sample the accelerometer that quickly -- the datasheet that I have says that the maximum sample rate for the accelerometer in the MPU6050 is 1,000 Hz.

I've never played with the MSP430, but it has always looked like a neat little device. I never have needed the low-power that it offers ( I'm usually designing controllers for power-hungry electric motors ), and I went from the Atmel AVR series to the NXP ARM Cortex-M series. To begin with, I'm only running the ARM at 12MHz; and, I should be able to reach my sample-rate goals fine. Eventually, I'm going to use a Kalman filter for sensing liftoff, burnout, and apogee type events though, so I definitely want the best sampling time accuracy I can get, and I will almost certainly want to up the processor speed. I hadn't even checked the accuracy of the MPU6050s internal clock, 1% isn't going to cut it, in the long run, so I might have to start looking at an external clock, the 19.2MHz option would be pretty easy to generate using one of the timers on the processor. Any external clock connection would a couple of board revisions from what I have though.

As for decimation, I'm deliberately ignoring the problem, at the moment. Yes, that means that the data I collect isn't going to be as good as it could be. That's okay. I'm just getting it running, as a start. Once I've done that, I'm going to have to tweek the recording rate to better align with sample rate, but, once I get it running at the full ~2kHz sample rate I'm looking for from the accelerometers, I'll have the problem of slower barometric pressure sensor ( and magnetometer, if I end up including it ) so I'll have to do even more massaging at that point. Right now I'm just looking to get the system up and running, recording the best "raw" values I can.

As to soldering QFNs... I may have just gotten lucky, but I actually found the accelerometer almost easy. I tinned the pads, put down some liquid flux, positioned the chip, and reflowed it into place with my cheepo rework station. It sank right into place. The first time around I had a couple of pads that didn't quite reflow the way I liked, so I went back and heated them up again with some additional flux, and it was done. I'm not expecting it to be that easy ( I've got another project that I'm using a surface mounted Micro-USB B connector, and it's driving me up a wall! ). Plus, the ADXL300 series has a nice large pad pitch. I'm not really looking forward to hand-soldering the MPU-6050.

Today was a productive day as far as code is concerned. I got quite a bit of testing done on the memory. Unfortunately, it's looking more and more like I'm going to have to erase the flight memory before liftoff. It just takes too darn long to erase sectors, I'm not sure I could buffer samples for that long. It would also increase the complexity of the flight firmware, having to figure out what to erase, and when. At least to start, I think I'm just going to do a bulk erase of the whole chip. I'll come up with a better ( cleaner and smarter ) solution once it's actually doing something. Now I've gotten all the hardware except for the igniter drivers tested, and they're dead simple. I'm comfortable that they'll be okay ( from a control standpoint ). Since I've been writing all the control libraries, I've been spending lots of time in the datasheets of the processor in addition to the external devices. It almost makes me wish for the ease of an Arduino, sometimes. I much prefer having "reinvented the wheel" though. I can make it work exactly the way I want it to, and I can understand better what went wrong when it breaks. This hasn't been the funnest part though. It should get progressively more fun from here!

Martin Jay McKee
 
Not many people that would consider 500 Hz a low sample rate for a rocket flight computer! Anyway, It's a start. I'd certainly be interested in how you are going to keep up with storing the data at a rate of 8,192Hz. Also, I was aware that the gyroscope could reach that rate, but I was unaware that the you could sample the accelerometer that quickly -- the datasheet that I have says that the maximum sample rate for the accelerometer in the MPU6050 is 1,000 Hz.

I've never played with the MSP430, but it has always looked like a neat little device. I never have needed the low-power that it offers ( I'm usually designing controllers for power-hungry electric motors ), and I went from the Atmel AVR series to the NXP ARM Cortex-M series. To begin with, I'm only running the ARM at 12MHz; and, I should be able to reach my sample-rate goals fine. Eventually, I'm going to use a Kalman filter for sensing liftoff, burnout, and apogee type events though, so I definitely want the best sampling time accuracy I can get, and I will almost certainly want to up the processor speed. I hadn't even checked the accuracy of the MPU6050s internal clock, 1% isn't going to cut it, in the long run, so I might have to start looking at an external clock, the 19.2MHz option would be pretty easy to generate using one of the timers on the processor. Any external clock connection would a couple of board revisions from what I have though.

As for decimation, I'm deliberately ignoring the problem, at the moment. Yes, that means that the data I collect isn't going to be as good as it could be. That's okay. I'm just getting it running, as a start. Once I've done that, I'm going to have to tweek the recording rate to better align with sample rate, but, once I get it running at the full ~2kHz sample rate I'm looking for from the accelerometers, I'll have the problem of slower barometric pressure sensor ( and magnetometer, if I end up including it ) so I'll have to do even more massaging at that point. Right now I'm just looking to get the system up and running, recording the best "raw" values I can.

As to soldering QFNs... I may have just gotten lucky, but I actually found the accelerometer almost easy. I tinned the pads, put down some liquid flux, positioned the chip, and reflowed it into place with my cheepo rework station. It sank right into place. The first time around I had a couple of pads that didn't quite reflow the way I liked, so I went back and heated them up again with some additional flux, and it was done. I'm not expecting it to be that easy ( I've got another project that I'm using a surface mounted Micro-USB B connector, and it's driving me up a wall! ). Plus, the ADXL300 series has a nice large pad pitch. I'm not really looking forward to hand-soldering the MPU-6050.

Today was a productive day as far as code is concerned. I got quite a bit of testing done on the memory. Unfortunately, it's looking more and more like I'm going to have to erase the flight memory before liftoff. It just takes too darn long to erase sectors, I'm not sure I could buffer samples for that long. It would also increase the complexity of the flight firmware, having to figure out what to erase, and when. At least to start, I think I'm just going to do a bulk erase of the whole chip. I'll come up with a better ( cleaner and smarter ) solution once it's actually doing something. Now I've gotten all the hardware except for the igniter drivers tested, and they're dead simple. I'm comfortable that they'll be okay ( from a control standpoint ). Since I've been writing all the control libraries, I've been spending lots of time in the datasheets of the processor in addition to the external devices. It almost makes me wish for the ease of an Arduino, sometimes. I much prefer having "reinvented the wheel" though. I can make it work exactly the way I want it to, and I can understand better what went wrong when it breaks. This hasn't been the funnest part though. It should get progressively more fun from here!

Martin Jay McKee

Very cool. On the sample rate, that seems to be plenty to me since even the Altus Metrum hardware does "only" 100 samples/s.

On QFNs, have you tried a soda can stencil?

https://lowpowerlab.com/blog/2013/01/23/diy-home-made-metal-stencils-step-through/

Unless you plan to develop this into a commercial product, here's what I've been waiting forever for someone to develop and offer:

1. Open hardware and software for something that can not only record altitude and acceleration, but also the rocket's orientation on all axis
2. The hardware would consist of readily available and cheap China-sourced (i.e. eBay) sensor modules along with a standard type of suitable MCU module that is so popular it is widely cloned
3. These would all be soldered into a motherboard that includes the required connections for externally attached whatevers and board space for power MOSFETs with their few associated components
4. The Gerbers for that motherboard would be made available on-line along with the software

Right now, anything that can track more than just altitude and acceleration is rather pricey.

EDIT: If you have no intent to commercialize this, why concentrate on "as small as possible" which then makes DIY versions extremely difficult to build without, for instance, solder stencils for QFN packages; for many, definitely including myself, anything small enough to fit in a 2.56" ID e-bay is small enough and with HPR, plenty lightweight enough; separate cheap, commercially available modules soldered to a motherboard make a DIY version both cheap and easy to buy and build and your PCB design much easier to create.
 
Last edited:
@winston
I actually began with a thought much like what you propose. I was going to stick with using only breakout boards for sensors, but ran into the problem of accelerometers with a large enough range being available. Pretty much everything is limited to 16g, which just isn't enough. It would be easy enough to manufacture a breakout for the accelerometer, but then it needs to be sourced somehow. I do like the idea of open hardware / open source. I've considered pushing something to the hobby market one of these days ( years.... ) and even if I were to do so, it would be open sourced. The truth is, with just one developer ( or even a few ) it is difficult to service all the feature requests that inevitably are made ( and the bugs as well ). It is easy to release "official" firmware snapshots that have been vetted to be safe, and have the development branch still growing.

While I certainly see it as a different project, I'd be happy to consider developing a DIY recording altimeter. I too have wanted orientation information, that is one of the main reasons that TinyTIM has take the shape that it has. Of course, before I undertook another project, I'd be interested in the requirements that others would be looking for. For instance, what is the measurement range would be desired. An important question is if 16 gees would be enough -- given that it is likely to saturate at liftoff on many flights, and certainly would at ejection events. How much memory would be desirable and at what sample rate? How many ejection channels? For my projects, I'm more likely to use a device that is on the smaller end ( I'm interested in putting electronics in LPR and MPR, thus the minimal size ). But, a larger device would certainly be easier. If there's interest, I may look into it. And then there's the kicker. What would be a good target price for a DIY module, assuming you had the tools to build it, but none of the parts, how much would people be willing to spend?

I'll be working like a banshee next week and the following, so I'm really trying to get as much work done on this in the next few days as possible. I can't leave construction of the rockets to wane however. What's the point of having schmick electronics, if there's nothing to fly them in?!


Cheers,
Martin Jay McKee
 
Great project. I'm amazed what a person can do these days for just a little money. A project like yours would probably have been $1000's of dollars 25 yrs ago if it were even technically possible.
 
Not many people that would consider 500 Hz a low sample rate for a rocket flight computer! Anyway, It's a start. I'd certainly be interested in how you are going to keep up with storing the data at a rate of 8,192Hz. Also, I was aware that the gyroscope could reach that rate, but I was unaware that the you could sample the accelerometer that quickly -- the datasheet that I have says that the maximum sample rate for the accelerometer in the MPU6050 is 1,000 Hz.

I have already tested the code to write to a micro-SD card and it runs at ~500KB/s with the main problem being periodic stalls from the micro-SD card. Surprisingly, a recent high speed micro-SDHC card (so it claimed) was not any better than an old micro-SD card.

The MPU-6000 accel only provides data at a maximum of 1024 SPS so I just ignore seven out of eight samples.

Oh, one little detail that you might have missed: The MPU-6050 does not have a SPI interface, the MPU-6000 does.
 
Hang out at the camera forums for your SD card recommendations. Every time I have a new embedded project I go find out what's up.
 
While I certainly see it as a different project, I'd be happy to consider developing a DIY recording altimeter. I too have wanted orientation information, that is one of the main reasons that TinyTIM has take the shape that it has. Of course, before I undertook another project, I'd be interested in the requirements that others would be looking for. For instance, what is the measurement range would be desired. An important question is if 16 gees would be enough -- given that it is likely to saturate at liftoff on many flights, and certainly would at ejection events. How much memory would be desirable and at what sample rate? How many ejection channels? For my projects, I'm more likely to use a device that is on the smaller end ( I'm interested in putting electronics in LPR and MPR, thus the minimal size ). But, a larger device would certainly be easier. If there's interest, I may look into it. And then there's the kicker. What would be a good target price for a DIY module, assuming you had the tools to build it, but none of the parts, how much would people be willing to spend?

Cheers,
Martin Jay McKee
I, too, am ONLY after the addition of all-axis orientation recording at a much lower cost than now available for use in dynamic stability analysis. THAT is what I've wanted forever and that would be the single addition that would set a new project apart from the many other altimeters already available. Two power MOSFET channels would be just fine for me.

LSM9DS0 (I2C, SPI)- 3-axis accelerometer (16g), gyro, and magnetometer
MMA6555KW (SPI) because it's cheaper than the ADXL375 and good enough for Altus Metrum to use in its hardware - higher (105g) readings on the longitudinal axis once the LSM9DS0 saturates on that axis
MS5611 (I2C, SPI) barometer

ADXL375 - $10.62 in unit quantities
200g 3-axis

https://www.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeyADXL375BCCZ

MMA6555KW - $5.82 in unit quantities
105g 1-axis

https://www.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeyMMA6555KW

LSM9DS0 - 3-axis accelerometer (16g), gyro, and magnetometer - $7.50 in unit quantities

https://www.mouser.com/ProductDetail/STMicroelectronics/LSM9DS0TR

Adafruit LSM9DS0 breakout module (somewhat overpriced IMO, but just for development):

https://learn.adafruit.com/search?q=LSM9DS0&

On the topic of sample rates and, therefore, memory requirements, borrow from the best:

https://comments.gmane.org/gmane.technology.rocketry.altusmetrum/415

About cost, please let me know if I'm wrong, but I believe that the lowest cost unit right now with gyros is the Altus Metrum EasyMega which retails for $300. What I'd want is something that's basically just one of these:

StratoLoggerCF

https://www.perfectflite.com/SLCF.html

which can also record the on-board gyro output, perhaps upping the sample rate quite a bit in exchange for a lower number of stored flights.
 
Last edited:
About cost, please let me know if I'm wrong, but I believe that the lowest cost unit right now with gyros is the Altus Metrum EasyMega which retails for $300.

A few people have taken our hardware designs and made their own; all of our software, firmware, hardware designs and tools are freely available. We're always tickled when it happens!
 
Our first family computer, and the one that I learned to program on was a Tandy 1000, with ( a massive! ) 640kB of system RAM (fully upgraded), two 5 1/4" floppy drives, an ~8MHz processor, and no hard drive. Just about every time I sit down to work on microcontroller based projects, I am amazed at the fact that the system I'm working with is the size of my thumb, cost less than a single restaurant meal, and is -- in terms of computational grunt -- substantially more powerful than that old $3000 behemoth. The amount that things have changed in the past 30 years is insane when you really think about it.

A few notes.... I did know that the MPU6050 doesn't have SPI ( though I certainly didn't make that clear! ). My redesigned boards will likely be built for the `9250, so that I can have an integrated magnetometer. And that does ( also ) have SPI. And yes, ignoring seven out of eight makes perfect sense on the accelerometer; certainly, the gyro updates quickly enough for the ~8kHz rate. And, again, using microSD as a storage medium makes sense. It's designed continuous write rates well in excess of the memories I'm using. It does seem that, if minimal size isn't the object, it would be hard to beat microSD as a storage medium ( ultra convenient to be able to remove it, as well ).


If I'm not careful, I'll get myself sidetracked into another project, but I do like the idea of a low-cost DIY altimeter design. The trick is really to find a source of inexpensive breakout boards for the "correct" sensors. There are lots of things available, but high-rate accelerometers and the like could be difficult to find. Even then, if you do find them one place, they aren't likely to have second and third sources, and so won't have the advantage of large volume and low cost. It's clearly a doable project, of course. And, I would think, doable for around the $60-$75 mark even purchasing in unit quantities. I think that for a general system the MMA6555KW is a good choice ( and, yes, a nice cost savings ). I specifically wanted a high-rate accelerometer on all three axes because I have some future design goals that may ( hopefully not! ) run into those types of accelerations. In general, the device that I'm using is overkill ( then again, that's the order of the day, when I'm designing something it seems ).

I do wish I could find a barometer with a less annoying sampling than the MS5611 and similar quality of readings. It gives you absolutely beautiful readings, but it causes way too much traffic on the bus for my taste. It really wouldn't take much more circuitry on the chip itself to handle self-timing of the sampling. Oh well. It does its job.

Cheers,
Martin Jay McKee
 
My redesigned boards will likely be built for the `9250, so that I can have an integrated magnetometer.

The 9150 has a horrible magnetometer and the 9250 is worse. This bit me because I failed to look at the data sheet closely enough to see that the sensitivity was inadequate for my needs. But perhaps noisy and with low resolution is good enough for you.
 
The trick is really to find a source of inexpensive breakout boards for the "correct" sensors. There are lots of things available, but high-rate accelerometers and the like could be difficult to find.
More like impossible for the high-g sensors as there's not much of a market for them among hobbyists wanting mostly Arduino modules. We're the relative few cursed with that need. And the Chinese have learned to charge an arm and leg for the latest sensors even though they're not only more capable, they're usually cheaper than what they replace. An example:

LSM9DS0 IMU 9DoF High precision integrated 9 axis attitude sensor I2C SPI Module - $35.09! shipped

https://www.ebay.com/itm/LSM9DS0-IM...-attitude-sensor-I2C-SPI-Module-/161912904660

A nice, very reasonably priced module with older tech, but even more capability (an altimeter) than the above. No high-g sensor, of course:

10DOF IMU MS5611 HMC5883L MPU6050 Flight Control Sensor Module - $13.80 shipped

https://www.ebay.com/itm/10DOF-IMU-...light-Control-Sensor-Module-MWC-/281687691135
 
I had noticed how awful the magnetometer is on the 9250... very disappointing. For this project, however, I would be perfectly happy with its specs. When I design the "full-version," I would need better sensitivity though.

@winston
I'm actually using a version of the second board. I'm using it, particularly because of the low cost and its inclusion of the MS5611. I was interested in the Tau when I first saw it. I really should get a few to play with. I've just gotten in the habit of designing a board for a new project. Most of my projects are pretty laid-back builds, so waiting a bit for a PCB is easy.

I absolutely love programming for the ARM Cortex-M series. I'm something of a computer architecture geek, and it's just a very clean architecture. Plus, the amount of processing power that you get -- in a small package -- is amazing compared to the more typical AtMega328 based Arduinos. So many options! ( except, as we've said, in appropriate breakout boards )

Cheers,
Martin Jay McKee
 
The 9150 has a horrible magnetometer and the 9250 is worse. This bit me because I failed to look at the data sheet closely enough to see that the sensitivity was inadequate for my needs. But perhaps noisy and with low resolution is good enough for you.
I'm not really up to speed on IMUs. Is the magnetometer used to correct for gyro drift and that's why high accuracy is important? In R/C aircraft with IMUs not equipped with GPS, they're also used for a very rough return to home capability.
 
I had noticed how awful the magnetometer is on the 9250... very disappointing. For this project, however, I would be perfectly happy with its specs. When I design the "full-version," I would need better sensitivity though.

@Winston
I'm actually using a version of the second board. I'm using it, particularly because of the low cost and its inclusion of the MS5611. I was interested in the Tau when I first saw it. I really should get a few to play with. I've just gotten in the habit of designing a board for a new project. Most of my projects are pretty laid-back builds, so waiting a bit for a PCB is easy.

I absolutely love programming for the ARM Cortex-M series. I'm something of a computer architecture geek, and it's just a very clean architecture. Plus, the amount of processing power that you get -- in a small package -- is amazing compared to the more typical AtMega328 based Arduinos. So many options! ( except, as we've said, in appropriate breakout boards )

Cheers,
Martin Jay McKee
This neat little thing just popped up today (unfortunately with a 9250 and, as expected, no high-g accelerometer; plus, the barometric sensor is "only" good to 300mbar (~30k feet), but that would be good enough for the vast majority):

https://www.tindie.com/products/Fusion/10dof-mpu9250ms5637-sensor-addon-for-teensy/

It's meant to be soldered to this extremely capable little thing:

https://www.pjrc.com/store/teensy32.html

I, too, love the topic of computer architectures. If you haven't read it already and are interested in computer history, this book by MIT Press is fantastic:

The First Computers--History and Architectures (History of Computing)


https://www.amazon.com/dp/0262681374/?tag=skimlinks_replacement-20
 
Last edited by a moderator:
In a typical IMU application, the magnetometer is used primarily to find the heading of an aircraft ( its yaw ). In flight, it would be the roll around the longitudinal axis of the rocket. Magnetometers could be used to track roll in a rocket but they are typically pretty slow ( compared to the accelerometers and gyroscopes ). It is also possible to use the magnetometer and accelerometer to set the initial orientation of the craft and then, in flight, correct for gyro drift ( as mentioned ), but much of the gyro correction actually comes from the accelerometer. Again, this is in standard aircraft AHRS ( attitude and heading reference systems ). During much of a rocket's flight, the accelerations on a rocket just don't allow for the correction that you can get with an aircraft because you need a constant gravity vector for that.

I don't really use the Arduino much, but I absolutely love the Teensy 3.2s that I have. They are massively powerful little devices, and quite easy to use ( as they use most of the same Arduino libraries and the a modified version of the IDE ). I hadn't seen that add-on board. It's quite neat, especially how compact it is. Not quite right for a rocket altimeter though, is it?

It would be quite easy to design a breakout board for just the sensors that aren't easily acquired ( maybe just the high-rate accelerometer ). Would there be any interest in that? It would be a fun, quick, project to just design something like that. Still have the problem of soldering the QFN packaged sensors in a DIY friendly manner though.

"The First Computers" isn't one I've read. I may have to get myself a copy, looks fun!
Martin Jay McKee
 
In a typical IMU application, the magnetometer is used primarily to find the heading of an aircraft ( its yaw ). In flight, it would be the roll around the longitudinal axis of the rocket. Magnetometers could be used to track roll in a rocket but they are typically pretty slow ( compared to the accelerometers and gyroscopes ). It is also possible to use the magnetometer and accelerometer to set the initial orientation of the craft and then, in flight, correct for gyro drift ( as mentioned ), but much of the gyro correction actually comes from the accelerometer. Again, this is in standard aircraft AHRS ( attitude and heading reference systems ). During much of a rocket's flight, the accelerations on a rocket just don't allow for the correction that you can get with an aircraft because you need a constant gravity vector for that.

I don't really use the Arduino much, but I absolutely love the Teensy 3.2s that I have. They are massively powerful little devices, and quite easy to use ( as they use most of the same Arduino libraries and the a modified version of the IDE ). I hadn't seen that add-on board. It's quite neat, especially how compact it is. Not quite right for a rocket altimeter though, is it?

It would be quite easy to design a breakout board for just the sensors that aren't easily acquired ( maybe just the high-rate accelerometer ). Would there be any interest in that? It would be a fun, quick, project to just design something like that. Still have the problem of soldering the QFN packaged sensors in a DIY friendly manner though.

"The First Computers" isn't one I've read. I may have to get myself a copy, looks fun!
Martin Jay McKee

I just want paired femtobeacons with a GPS module at each end running kalman filters off of lipos... is that so much to want? :)
 
I'm not really up to speed on IMUs. Is the magnetometer used to correct for gyro drift and that's why high accuracy is important? In R/C aircraft with IMUs not equipped with GPS, they're also used for a very rough return to home capability.

It has nothing to do with using it in an IMU. The sensor is poor. I found that it had a range of about +/-160 counts with a distressingly high level of noise. To even have a chance at 1 degree accuracy you have to filter the data. This works only if the sensor is stationary long enough. Long enough depending on how many data points you feed the filter.
 
In a typical IMU application, the magnetometer is used primarily to find the heading of an aircraft ( its yaw ). In flight, it would be the roll around the longitudinal axis of the rocket. Magnetometers could be used to track roll in a rocket but they are typically pretty slow ( compared to the accelerometers and gyroscopes ). It is also possible to use the magnetometer and accelerometer to set the initial orientation of the craft and then, in flight, correct for gyro drift ( as mentioned ), but much of the gyro correction actually comes from the accelerometer. Again, this is in standard aircraft AHRS ( attitude and heading reference systems ). During much of a rocket's flight, the accelerations on a rocket just don't allow for the correction that you can get with an aircraft because you need a constant gravity vector for that.
Thanks for that explanation. Do you have any links handy to anything on-line that is a good introduction to IMU theory of operation? I've went looking, but haven't found anything that I'm much impressed with.

It would be quite easy to design a breakout board for just the sensors that aren't easily acquired (maybe just the high-rate accelerometer). Would there be any interest in that? It would be a fun, quick, project to just design something like that. Still have the problem of soldering the QFN packaged sensors in a DIY friendly manner though.

Martin Jay McKee
I use the (dedicated) hot plate reflow method and, from what I've read, so do others making smallish PCB runs for sale on sites like Tindie:

https://www.google.com/search?q=ele...+skillet+smd#q=electric+skillet+hot+plate+smd

I use one of these. The glass lid is perfect for PCB viewing and as an IR reflector:

https://www.walmart.com/ip/22301248

The emissivity of polytetrafluoroethylene (PTFE) aka Teflon is 0.92 (ideal black body = 1), so I used a non-contact IR digital thermometer (Raytek MT4 Mini Temp Non-Contact Thermometer Gun with Laser Sighting - already had one on hand initially bought for R/C aircarft hobby use; the same unit was seen in use in barely disguised form by the Enterprise Chief Engineer Trip Tucker as a troubleshooting tool) to get a good approximation of an ideal SMD reflow temp profile with skillet manual on/off actions at 30 or 60 second intervals, and since I don't do a lot of reflow, I just use a stop watch. The four minutes required isn't a such a long time to spend on that.

About laser cut stencils:

https://learn.adafruit.com/smt-manufacturing/laser-cut-stencils

Kapton film is preferred for laser cut stencils, but it's not cheap. I've created some test stencils using a not as readily available as it used to be local library laser cutter (but haven't actually used them; I use the soda can stencil creation method I linked to above due to the small PCB size of everything I make) and this much cheaper material:

Grafix Clear .003 Dura-Lar Film, 9-Inch by 12-Inch, 25 Sheets

https://www.amazon.com/dp/B002544NHA/?tag=skimlinks_replacement-20

It's a matter of getting the laser power and speed settings just right by doing a series of tests. The same mode used for image etching is used. The slight curl round the laser cut holes can be quickly sanded away using 1000 grit sandpaper. The holes aren't enlarged much by the laser heat induced melt-back (most of the material is vaporized once you get the laser settings right) and you can tweek for that in your cream setting anyway as described in the Adafruit laser stencil article linked to above.

The tiny size of the breakout boards would mean they'd probably require a panelized layout to be economical to be manufactured even by one of the cheap sources like:

https://www.seeedstudio.com/service/index.php?r=pcb

I've seen some stuff on-line about hobbyist depaneling of such boards, but I can't find it right now. I recall someone mentioning the use of a cheap harbor freight tile saw with diamond grit blade:

https://www.harborfreight.com/4-12-in-portable-wet-cut-tile-saw-69230.html

If the PCB layout artwork was designed to be single sided (which should be easy to accomplish) with the standard 0.1" pin headers, the artwork could be made available and DIY home etching easily done. Do you plan on making this a project?

EDIT: I just did some searching and if one was going to bother making a high-g accelerometer breakout board, correct me if you disagree, but I'd go with this:

H3LIS331DL Low-Power, High-g, Full-Scale, 3-Axis Digital Accelerometer (+-100, 200, 400g)

https://www2.st.com/content/ccc/res...df/jcr:content/translations/en.DM00053090.pdf

https://www.digikey.com/product-detail/en/stmicroelectronics/H3LIS331DLTR/497-13903-1-ND/4311636

A bit more expensive ($10.20 in unit quantities), but it's readily available in small and large quantities, is high resolution (16 bit), has 3-axis capability with g-range select, and is I2C/SPI capable.

A reasonably priced breakout/adapter is already offered by ST, they even make the Gerbers available for download, but it's in an unnecessarily large 24-pin dual in-line configuration, too big with many more header connections than actually needed:

https://www.digikey.com/product-search/en?mpart=STEVAL-MKI153V1&vendor=497

https://www.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeySTEVAL-MKI153V1
 
Last edited by a moderator:
@UhClem
I don't want to flog a dead horse, but given that the only thing I had planned on using the magnetometer on the TinyTIM for is to get an initial orientation while the rocket is on the pad. For that, I'd be perfectly happy with +-10 degrees accuracy. I absolutely agree that the 9000 series have terrible magnetometers but TinyTIM is designed specifically for recording the launch phase of the flight, during which the high sample rate that the gyros provide is much more useful than the ( orders-of-magnitude lower ) sampling rate of a magnetometer. Size, for better or worse, has been the overriding factor in the design of TinyTIM, that and the ability to assemble it by hand ( which has precluded making it denser or using more QFN packages ). Is there a better set of sensors that could be used? I have no doubt. But, for what I'm wanting to do, This seems like it'll work fine.

Having said all that, I do want to make a much more capable general purpose IMU system later ( with the addition of GPS, actually ), and I'd welcome options for magnetometers that are clean and allow for relatively high sample rates. I haven't had nearly as much chance to read through datasheets on those.

I haven't looked much at the H3LIS331DLTR yet, but in passing it looks nice. I especially like the fact that it has a +-100 gee range. The +-200 gee range that the ADXL375 has is much higher than I need for data acquisition at launch.

I'm working on the TinyTIM and preparing for an L2 attempt the first week of June, but yes, I like the idea of the DIY flight computer project. Indeed, I'd like to move forward with it, just not this month! ( I've decided that I've got some more electronics to design for my L2 e-bay before the launch... Oy. )

Designing the sensor board single-sided is an interesting idea. I agree, it's certainly possible. I wonder how much interest there would be in building one up?

Right now, I'm thinking a set of different components that could be interchanged would be an interesting approach. For instance,
Sensors:
1. 10-dof sensor board with high-rate altimeter, gyro, magnetometer and baro
2. 3-dof sensor board with high-rate altimeter and baro
3. others?

Processor:
1. Teensy 3.2
2. Neutrino or Tau
3. Arduino Micro
4. processor on Motherboard


Mother Boards:
1. Basic 2 ignition channels
2. 2 ignition channels with GPS
3. "Full House" 2 channel with GPS and Transceiver

If the code were written using Arduino libraries and good design practices, it should be possible to mostly plug-and-play new combinations and just configure the software ( either at compile-time or run-time ) to work properly. Boy, I'm thinking about this too much.... I need to focus on the L2!

Cheers,
Martin Jay McKee
 
I haven't looked much at the H3LIS331DLTR yet, but in passing it looks nice. I especially like the fact that it has a +-100 gee range. The +-200 gee range that the ADXL375 has is much higher than I need for data acquisition at launch.
I've got some really thin PCB material meant to be cut with scissors that I've never used. I've decided to use it to make a PCB to piggyback (epoxy) a H3LIS331 on the unpopulated side of one of these:

10DOF IMU MS5611 HMC5883L MPU6050 Flight Control Sensor Module (GY-86)

https://www.ebay.com/itm/10DOF-IMU-...light-Control-Sensor-Module-MWC-/281687691135
 
Let us know how it works!

I'm using precisely that module ( the GY-86 ) for the current version of the TinyTIM ( and the next, I just received my version 0.3 boards ). I've found it works well so far. I'm happy with the noise level of the sensors chosen ( well, the accel/gyro and barometer at least... I haven't really done any noise analysis of the magnetometer yet ). I also found that interfacing to the sensors was pretty easy, except the MS5611, it's got some pretty annoying timing constraints. If you don't meet them, it just gives you garbage. Then again, I was pushing trying to see how fast I could sample. It would be easy to "play-it-safe" and not run into any problems.

Martin Jay McKee
 
Let us know how it works!

I'm using precisely that module ( the GY-86 ) for the current version of the TinyTIM ( and the next, I just received my version 0.3 boards ). I've found it works well so far. I'm happy with the noise level of the sensors chosen ( well, the accel/gyro and barometer at least... I haven't really done any noise analysis of the magnetometer yet ). I also found that interfacing to the sensors was pretty easy, except the MS5611, it's got some pretty annoying timing constraints. If you don't meet them, it just gives you garbage. Then again, I was pushing trying to see how fast I could sample. It would be easy to "play-it-safe" and not run into any problems.

Martin Jay McKee
Hey, that's great! Now I know who to consult if I run into problems. :D

I've already noticed that the schematics of the GY-86 I've found on-line have errors. 4.7k I2C pullup resistors are shown in the schematic:

GY-86_SCH.jpg


but the close-up photos of module show that 2.2k resistors are used which is a good thing since this document indicates that 4.7k resistors would be too large for I2C fast mode:

https://www.ti.com.cn/cn/lit/an/slva689/slva689.pdf

Also, the only 1k resistor I see in the board is the current limiter for the LED. So, the fsync line on the MPU605 is not tied to ground with a 1k resistor as shown in the schematic.

After a metric ton of digging I managed to find sample code for using the GY-86 within the Arduino IDE. This Thai site link was nowhere to be found in the discussions of the GY-86 found in Ardunio forums, at least within those I found. It contains code examples for all members of the apparently very large family of GY-XX sensor modules:

https://www.thaieasyelec.com/downloads/GY_sensor_example/Example_Code.rar
 
I like what you've found for the GY-86. I also noticed that the available schematics are... well... less than ideal. Which is a shame. I feel that clear documentation is one of the absolutely most important pieces of a successful technical device -- the reference web-site and community are almost certainly >50% of the success of Arduino, for instance. The AVR microcontroller ( and a C++ capable, GCC compiler ) had been around for at least a few years before it was wrapped in a nice package.

The code collection is particularly nice. At a cursory glance, it's even pretty well written. It's not using blocking delays, but actually using timestamps to control reads on the MS5611 ( lots of Arduino code I've seen, uses blocking delays ). It should be an excellent start to using it.

Back to the TinyTIM. I've not been able to do much work recently between work, some rocketry classes at one of the local Boys' and Girls' Clubs, a major launch, and working around the house, but I expect to have a bit more time in the coming week. I have gotten to the point that I can communicate with all the external components as expected ( sensors and memory ), and have tested my drivers to the point that I more or less trust them ( I've got a list of tests I want to run before I actually use the board for dual-deployment flights ). The next order of business, code wise, is probably to start building the kalman filter so that I can implement launch detection.

Launch detect is slated to be based upon two, configurable parameters. The system will have both a threshold velocity and a threshold acceleration. Launch is detected when both are exceeded. Both thresholds will be configurable. The kalman filter is going to be implemented in fixed point. I've already built a simple C++ class to do arithmetic with s16.16 formatted fixed-point numbers. In basic tests, it comes in much smaller and faster than using floating-point numbers.

The final development is that I received my version 0.3 boards. I changed the voltage regulator ( to a device capable of more current, I had some free space ), as well as the microcontroller ( I'd run out of pins ), and moved the high-rate acclerometer onto the board; and, I fixed some mistakes. I can't wait to build it up. I'm amazed how much could be fit in without making the board any larger. Even keeping it basically hand-solderable, it remains about the size of an EggTimer Quark. It does still use the GY-86 for most of its sensors though. An upcoming version is going to have to move those sensors on the board. I'm not sure if I'll be able to stay with a 2-layer board at that point. I might move to 4-layer for some solid ground and power planes.

Martin Jay McKee
 
The kalman filter is going to be implemented in fixed point. I've already built a simple C++ class to do arithmetic with s16.16 formatted fixed-point numbers.

How did you handle multiply?

If you stick to C (or C++) then you have to cast the arguments into 64 bit types in order to get the full 64 bits of your 32X32 multiply so that you can pick out the 32 bits that you need.


I soldered my board the other week and it didn't work out well. Besides the solder bridges on both the TSOP and QFN packages, I discovered that I had somehow failed to note which side of the micro-SD socket the card was inserted from. My assumption that it was opposite the contacts was wrong. So I can't insert a card because of interference with other parts.

While trying (and mostly failing) to clean up the solder bridges just to salvage something out of it, I decided to order a MPU-9250 breakout. While I can't use the magnetometer (too slow) I can work on some code. I find the 32KSPS mode particularly intriguing. That was a mode of the MPU-6500 that I didn't know about because it doesn't appear in the data sheet.

Something else not mentioned in the data sheet is anything about the DLPF other than bandwidth. Poking around the Invensense forums suggests that filter is pretty weak at only first order. Which means that in order to keep Nyquist happy you need to set the filter much lower than your sample rate or hope that the signal is naturally band limited.
 
Since I'm sticking to s16.16 ( for now ), the multiply is quite simple -- despite the slightly ugly syntax. The actual functional method is,
Code:
        ref_t& operator *= (const ref_t& _other) {
            storage_ = static_cast<storage_t>( ( (static_cast<calc_t>(storage_) * _other.storage_) >> FRAC_BITS) );
            return *this;
        }
Here I'm doing the cast to 64-bit precision and back with the static casts. The calc_t type is defined, at the moment, as a 64-bit signed integer while the storage_t type is 32-bit signed integer. FRAC_BITS is actually a template parameter, so the class could work with other fixed_point formats, but I haven't actually set it up to properly align values yet, so I'm just treating it as a constant, and all the numbers have the same format.

There's also a global operator overload that allows direct multiplication of fixed-point numbers,
Code:
template<class _storage_type>
FixedPoint<_storage_type> operator * (const FixedPoint<_storage_type>& _a, const FixedPoint<_storage_type>& _b) {
    FixedPoint<_storage_type> temp = _a;
    temp *= _b;
    return temp;
}

I've almost decided that my final version is going to use microSD rather than memory chips. It is more convenient, just as fast ( or faster... I've got a weird problem with my write speeds at the moment -- my erase is over 400kB/s and page write only 90kB/s, weird ), and ( byte for byte ) cheaper. It's going to require quite a redesign of the whole system however, which is a bit of a pain. I had a bunch of silly bumbles in my v0.1 board layout, but nothing mounted backward ( this time! ). It's amazing how many revisions it takes, even when you're really careful.

While I'm generally happy with the documentation of register functions on the Invensense devices ( given the slow start for DMP information availability, I haven't even looked at it ). I don't like the minimal information on many of the filters and such. I don't have enough information to actually trust them. It's a shame to hear that the DLPF is only first-order. I'm just as glad that I don't need super-high bandwidths, in the end. The 32ksps mode is interesting. I don't know what I would use that much information for though! Well, it would be nice for flight control, but I certainly don't see much point ( myself ) in storing every last sample. It's worth looking into though. I always like to know what the tools are able to do.

Cheers,
Martin Jay McKee
 
Here's the approach to a very capable DIY flight data recorder that I'd love to see:

1. No SMD parts, all through hole, just a motherboard for widely available, low cost China sourced (eBay) Arduino compatible MCU and sensor modules; a hi-G sensor module would be made available on a site like Tindie (there's one there now, but it is significantly overpriced IMO); PCB files would be open hardware; Gerbers would be made available on-line allowing anyone to have a batch made at one of the very low cost Chinese PCB manufacturers to sell to others at slightly over cost to compensate for their time spent. Kits could even be offered.

2. Barometric, accelerometer (including a Hi-G option), magnetometer, AND gyro sensors would be included in the design.

3. Power would supplied by a single cell lipo. A spot for a China-sourced lipo charger module powered via a USB connection could be included on the system motherboard.

4. The flight data recorder functioning of flight hardware could be "dumb"; it would simply record raw sensor data to a microSD card module in a published data format at a decent rate. ARM boards can do far more than Atmel based boards and are becoming amazingly cheap, but Arduino Pro Mini boards sell for $2 each. The power consumption of far more capable ARM boards is also an issue although there are, of course, lower power modes.

5. All data processing would be accomplished in the open source, ground-based software written in Java for multiOS compatibility. Besides the usual graphing function, an animated 3D graphic presentation of a generic rocket would be shown at adjustable time step rates with key data like altitude, acceleration, velocity, etc., also being displayed in sync with the animation.

EDIT: No deployment function (pyro channels) allows the lack of on-board processing, avoids any safety liability, and the need for a LEUP. This would simply be a low cost device providing a great deal of flight data for the curious and those wanting to do aerodynamic and dynamic stability experiments.
 
Last edited:
Back
Top