Week 11: 24th October to 30th OctoberEdit
Prof Yung was out of office for an unknown period of time. As such, I went to work on eliminating the transient effect issue when moving from one magnet to another. Several methods were tested. This include using a counter to time the period in which the elctromagnets were off. That proved to be difficult to implement with one microcontroller because there was no possible way I could have the counter and the turning off and on of the magnet running at the same time. The microcontroller can only run one instruction at a time. When I turn off the electromagnet and implement a counter, that counter will always be the same value when the electromagnet is turned on again. To illustrate, we have:
The counter must work independently of the electromagnet pulse operation. While I was testing the aforementioned implementation, I found that that when the ADC values are within the threshold range, I can actually hold the magnet in the off position indefinitely. This means, when I turn off the electromagnet and the hall effect sensor happens to be positioned above it, I can emulate the “pressing” of a button. As long as the hall effect sensor remains positioned above the electromagnet, it will remain off and will only turn back on when the hall effect sensor is taken away. This is reminiscent of having to depress a button and having to actually remove the finger before the desired effect can be actuated. If I were to implement a counter during this “depress” stage, I can check how long the button has been “pressed” and implement an output. Depending on how long the button has been “pressed”, I can even initiate during visual effects. This flow chart illustrates the new operation I have in mind.
The video here shows the aforementioned implementation in action.thumb|300px|right
The video here shows the oscilloscope readings of the hall effect sensor during operation.
thumb|300px|rightEssentially, instead of detecting the hall effect sensor straight away, the user has to move the hall effect sensor out of the working range of the electromagnet before the note can be actuated. This is analogous to pressing a button and letting go before getting any actuation. Depending on how long I “press” the button, I can come up with different actuations. As the system has to probe each electromagnet one by one(check 1st magnet, then check 2nd magnet and so on), it will take some time before the note can be played. Another problem stems from the working range of each electromagnet or the distance above the electromagnet before they can be detected. It is a lot more forgiving than the previous implementations I have come up with, but it is far from perfect and there will be instances when the system will be unable to catch on to the hall effect sensor’s presence. The plus side to it is that the user can discern whether he or she has correctly “pressed” the button. If the electromagnet stays off (no visible spikes) while the hall effect sensor is positioned above it, the button has been “pressed”. Otherwise, spikes will remain which indicates that the button hasn’t been pressed. I have also managed to iron out the issues pertaining to accidentally sounding other notes if the hall effect sensor is too far from the electromagnet. That said, the more checks I implement to prevent unexpected behaviour, the slower the system becomes.
Later in the week, Kasun and I ran the setup with the ferofluid. I discovered a huge setback. The height of the spikes are pretty high, up to 2.5 cm high. All the while, I have been running experiements at close to 0.3 cm to the electromagnet. The voltage drop at 0.3cm is significantly higher than that at more than 2.5 cm. The smaller the voltage drop detected by the hall effect sensor, the more difficult it is for the system to detect. While I can adjust the threshold range to suit the smaller voltage drop, the downside to this is the higher occurrence of unexpected behaviour. This is because the act of simply moving from one magnet to another will generate a voltage drop that may accidentally trigger a note that was not intended to play.The previous setup was able to work because the presence of the neodymium was able to initiate a large voltage drop in the hall effect sensor from about 5V to 1V due to the repulsion of like poles. This is as opposed to the voltage drop from 5V to 2.5V I was able to achieve by simply turning off the magnet.
- Meet up with Jeffrey to obtain his feedback on my current progress.