For this week, I decided to focus on an accelerometer since my ornithopter will likely appreciate to get input on acceleration forces as well as its orientation while flying. This means using the ADXL343 (mirror datasheet) component that requires reflow soldering for its pads.
After the reflow soldering recitation, I decided to try again using the tools in EDS, which includes a preheater pad with a nice setup for the heatgun. The board is the example one with 3.3V FTDI and a 3.3V logic using the ATTiny45V. Given the datasheet's soldering profile (page 34, I used 150 degC preheating for the back for a few minutes, and then triggered the heatgun at 250 degC for around a minute. The distance was probably not optimal (and it probably is more of a skill since the peak temperature is at the contact whereas the heatgun flows hot air), and so I manually went closer with the heatgun afterwards for a short time, which led to a quite clean result without the burning I had gone through during recitation.
At this point, I am much more efficient at soldering components. The main trick I learned was that post-processing the board after cutting is critical. If the board is not cleaned / scratched, then the solder goes straight to the components and it takes much longer for it to stick to the board. With post-processing (alcohol + soap + some rubbing / scratching), then it flows directly to both in a matter of a few seconds (instead of half a minute)! This reduced my board making time by quite a lot (around if not below 30min now) within the previous multiple iterations of my ornithopter board.
And we program and test, and ... it seems to be working!
At this point, I thought of different means to integrate the accelerator in my current ornithopter board.
The first attempt was to design a smaller extra board that I'd connect to the current one through the SPI header.
Given the spacing, this would require using a very short external board with holes and female headers.
For some reason, I also wanted to do allow using SPI instead of just I2C and so added a 2x2 header zone for adding a jumper switch for CS
to be either connected to GND
or VCC
.
I had also not realized at that point that one of the pins on the opposite side as the ground pins was not connected, and could thus be used to go through with ground.
This means that this extra small board was actually very complicated and could have been much simpler.
Then I started to tackle the problem of the IC require 3.3V supply and my main board is currently running at 5V. The first idea was to add some voltage regulators on that extra board, but this wouldn't work because they are not bidirectional.
Discussing with my colleagues, I learned of the existence of Logicl Level Shifters that would do exactly what I need here. While we may or not have such components in our lab, I realized that my main IC (ATTiny44A) could work at 3.3V, which would only require changing the regulator to a 3.3V version. The catch is that most (including specifically my current) servo motors require 4.8V to run. However, I read online that the logic part could still be done at 3.3V (and even as low as ~2V), so it would be fine as long as I'd run a different power line for these. This was a better solution because eventually I am thinking of adding a last component to the board which would be the BC832 castellated board for bluetooth communication which also require lower voltage.
I decided to thus redesign the entire servo+dc board to accomodate the accelerometer. I chose to settle for I2C which would remove the need for a switch and simplify the accelerometer wiring. The redesign meant moving quite a few pieces around. Notably, I moved the USB pads for power to the right to connect it directly to VBB since USB is 5V but my IC will not run at 3.3V. I now needed two different voltage regulators: one from VBB at 6-7V to 5V for the servo power, and one at 3.3V for the logic and accelerometer. Because I had one extra pin available, I also added an LED since this can be very useful for debugging (or just giving hope that things work). And now I have three 0 Ohm resistors to create bridges. Maybe I should start thinking about vias although if bridges are fine, they are much easier too!
It also meant figuring out how to edit the pads of the accelerometer (which I got from the adxl345 library for Eagle). I quickly found how to edit the pads (in board window, right click component, then use Open Package), but I missed the part on how to update the component back to the board and this took a few diggings. Supposedly there's an update button in the library package manager and at a few other places, but they didn't seem to have any effect on my board. When re-opening the package, I'd see the edit applied, but not in the board window. I eventually found a way by editing the library package from the Control Panel window, and then in the Board window, by replacing the component with the same component. For some reason, it seemed like the library would not update correctly otherwise. Maybe the linking was lost at some point?
I initially edited the size of the pads manually in their properties, and then read that it could be done much faster using the "Change Property" > SMD tool. Unfortunately the 32x16 size would only partially work and some pads would get merged and some not, which I assume is an issue with the alignment of the pads or some rounding at the limit of precision. I found that 24x12 worked for me with the default settings of Mods.
The final board integrates the same accelerometer (with many other components). The result video is on the project development, on Sunday 12/10.
I didn't end up using it for control because the main issue was not stability, but really having enough lift and weighing less. However, the fact that it works means that I could implement some more complex on-board control during flight.
I note that this was the component that had the most issues on the multiple boards I made. Two out of 5 could not talk to the accelerometer. I could not figure out why. This means that it may be a better solution in the future to separate the accelerometer and put it on a different smaller board to which I'd communicate with SPI/I2C.