I haven’t posted anything here for a while. Initially I wanted to come up with some kind of excuse, like not having enough time. But actually I did have time, 24 hours per day, I just didn’t spend any of it on writing blog posts. Some of the time was wasted, some of it was spent on learning and doing stuff.
Continue reading Life update
I noticed that the microcontroller inside transmitter sends wrong values from I2C device when it’s disconnected and reconnected during operation. The microcontroller tries to read the sensor without initalizing it (because it was already initialized once during system startup). I added some code to detect when the device is disconnected and reconnected, so that it’s reinitialized. I also added software interface to the Compass and Accelerometer classes as they are kind of the same (“Disconnectable”), but the reading process is different for each device.
Digging a little deeper showed that the microcontroller also hangs sometimes when I connect and disconnect one of the I2C devices during operation. The hanging happens when the device is disconnected during I2C transaction – I suspect that Wire library is not implementing timeouts and it’s waiting for some kind of signal on I2C bus from the device.
I had two options: modify Wire library or add watchdog to reset the device. I assume that this hanging behaviour would never occur during normal operation (the connectors are pretty solid), but nevertheless it has to be eliminated somehow.
I chose to try the watchdog path. Found some article online, setup the watchdog, test it and… it hangs! It turns out that standard Arduino bootloader (not the optiboot one) does not reset some register regarding watchdog, so during execution of bootloader code after restart it restarts again. And again. And again.
I switched to optiboot bootloader. Uploaded the sample code and woohoo! it works. But after I upload my code (transmitter) and play with the I2C connector – it hangs again, resets and locks in bootloader section (just like before). And then something else broke, because the code hanged during NRF module initialization…
At that moment I’d had enough of this project and decided to call it a day. I’ll try to fix it tomorrow.
I’d like to start posting weekly updates to let you know about progess in projects I’m working on. It’ll also help me to see later how the project developed. The updates will be divided (one post for each project) and in each post I’ll describe what I did and what problems I encountered.
I’ve got three projects going on right now: Eboard, RLDAQ (finishing), DIAGSTAR (work). I’ll post weekly updates on Eboard and RLDAQ.
The exams are finished and all the study projects are done, so I can spend more time on my own creations. It’s high time I resumed my fantastic Eboard project. For the last 9 months the board was hidden under my desk, covered in dust. Not anymore!
I plan to us the Eboard project as my Bachelor’s Thesis. To do that I need to improve electronic systems on board. Right now they are a mess. Ugly protoboards, unreliable connectors, messy software, difficult debugging and so on.
The plan is as follows:
- assemble the board in its current form to test drive system once again (and to ride it as soon as possible, who am I trying to cheat 😉 )
- create solid overview of electrical and electronic systems. Decide what parameters should be measured, what should be displayed, what should be logged (and how) etc.
- select microcontrollers. STM32s are on my mind, tied together with CAN interface…
- electronics schematics, PCB design and manufacturing
- port code to STM (if selected instead of AVRs), refactor it, add useful logging
I hope to have the project finished by the end of summer holidays (new term starts in October), but it’s difficult to make any estimates now. We’ll see.
Right now I’m working on Rocket Launcher Data Acquisition System. There are a few things left to do and the project will be fully finished. It has already undergone its first field test during CanSat competition and it has proven effective (well, there are a few things to correct, but nothing lethal).
The biggest issue was magnetometer not working due to its placement in main case with all the electronics nearby. It turned out that batteries influence magnetometer’s readings so much that it’s impossible to calibrate the offset/perturbations. The compass module had to be moved somewhere else. I had two options: launcher rail (accelerometer’s case) or weather station’s arm. I chose weather station as I was afraid that launcher rail may introduce magnetic field distortions (as batteries did).
Here’s a photo of 3D-printed case and render from Inventor:
I still have to print modified main case, build receiver module (‘prototype’ version was used so far) and the project will be done!
just a quick update post. Recently I’ve finished working on my microcontroller-base digital filter. Full description can be found on http://lukemeyer.me/digitalFilter.php (in case you have any questions feel free to comment or write an email). Code is available on GitHub.
This project turned out really well – the Bode plots and step responses are really close to the simulations results. I was pleasantly surprised when I saw such a good correspondence 🙂
Now I move on to developing Rocket Launcher DAQ system. Cheers
2015 has come to an end so it’s time for a small summary 🙂
Previous year “milestones” (major projects/ events/ skills etc.):
- 3D printer purchase: this device improved my manufacturing capability. Great decision.
- Electric mountainboard: this project took a lot of time and effort. I learned new things about designing electronics (power systems, embedded systems), mechanical design and manufacturing (3D printing).
- First job: in the end of March I started working at Invenco as Embedded Systems Engineer. Good opportunity to gain experience.
- Highest grade average for 2014/2015 academic year (among people on my year), Dean’s Scholarschip.
- Starting this blog and personal website (lukemeyer.me).
2015 was pretty fruitful for me, I hope that 2016 will be even better and I bet it will (provided no unexpected problems occur, eg. health issues) – my belief is that one’s life is dependent mainly on person’s actions and decisions.
My main goal for the next year is to be consistent and disciplined. Other goals that I want to achieve (thanks to the first one):
- resume eboard project, hone the details and use it on daily basis
- keep getting good grades at University
- great summer – by going to some special place to gain even more experience and knowledge. I’ll keep that a secret for now. If everything goes allright there will be a post about it full of happiness 😀
- switch from AVR architecture toward more advanced solutions (STM32, PIC32)
- work: release project that we are currently working on
- other projects: data acquisition system for Students Astronautical Association (Rocketry Section), AutoBlinds, DSP filter.
- update website and blog regularly
I wish you all great 2016, cheers 🙂
I wanted to create a quick note on projects that I’m currently working on:
-digital low-pass filter – based on AVR microcontroller. This semester I’m taking Digital Signal Processing course and I asked the proffesor if I could make a project instead of writing an exam at the end of the semester. She agreed and that’s how this project begun. Right now I’m using ATmega328p @16MHZ with its internal ADC and an external DAC8571. For first tests I chose first order Butterworth filter designed with impulse invariant method. Communication with DAC is via I2C @ 400kHz, although I’ll may need to increase the bus speed (sending 16+2 bits to update the DAC takes 45us, which results in 22kHz update frequency, so in theory I should double the bus speed. In practice that speed should do as attenuation for 11kHz input signal is around 36dB).
Software is pretty simple: ADC is configured in Free Running Mode, triggered by Timer1 Compare Match B (Timer 1 runs in CTC mode @ 44kHz). ISR for interrupt generated on conversion finished calculates filter output. DAC is updated in main loop all the time – right now I use blocking while-loops, but I’ll probably switch to interrupt-driven control.
Now the most important thing: proof that it actually works. I assembled the test circuit on breadboard, hooked up audio output from my PC to circuit input and generated a few sine waves (maybe I’ll buy proper function generator someday). FFT on the output. Cut-off frequency is 200Hz.
f=50Hz (yellow signal is output):
f=200Hz (you can see slight attenuation, around 2.5dB):
f=400Hz (spot-on -6dB):
f=1600Hz (perfect -18dB, everything according to the plan: 1st order Butterworth filter has -6 dB/octave slope)
-second project I’m working on is electronics helping in setting up launch rail for rockets (I do it for Students Astronautical Association, Rocketry Section).
-AVR based (again…)
-MPU6050 to measure rail angle
-HMC5883L – orientation
-BMP180 – pressure
-TMP102 – temperature
-NRF24L01 with amplifier – communication with base
-anemometer and wind vane – wind parameters measurement
I’ll create separate post on that project in near future (hopefully 😉 ).
Just a quick post with announcement about my website (that is www.lukemeyer.me) – it’s finally online! It isn’t 100% ready – most projects lack description (actually, only digital thermometer is documented as of the moment), but I am planning to successively add documentation.
I hope you find new website interesting, in case you have any remarks or comments please let me know 🙂