Skip to content

V1.0 RELEASE

Latest

Choose a tag to compare

@blakehourigan blakehourigan released this 19 Mar 14:54
· 163 commits to master since this release

Release Notes Version 1.0

Very much has changed from the initial pre-release version of this software. You can read the major improvements and fixes found in the first release version of this software below.

If you'd like to just install the new version of this software, the new Windows installer tool for the controller software can be found attached to this release below, along with the Arduino code update zip file.

Program Controller Code

  • Lick Details Renamed - What was previously called the Lick Details window was found to contain too much non-lick details to be accurate. As such, the window has been renamed to Event details.

  • More Data - More data fields have been added to the 'Event Details' window including lick duration (time from beam break until beam is restored), valve duration, event onset time relative to program start, and onset time relative to the trial start (TTC state begin time).

  • Valve Testing / Prime Valves Window - This window has been almost entirely redesigned, with much simpler and more versatile functions. It now features not only a target amount of micro-Liters per valve opening, but also the ability to choose how many openings (in other words how long a test is) are required per valve test.

  • Manual Valve Opening Time Fine-Tuning - Additionally, users can now manually fine-tune valve opening timings if desired, and can view past valve duration profiles. If only small adjustments are needed, or you'd like to restore valve timings to a previous valve timing profile, one has the option to do so by selecting the 'Manual Valve Duration Override' button just above the valve testing table inside the 'Valve Testing / Prime Valves Window'.

  • Valve Testing Profiles - To expand on this idea previously mentioned, valve timing profiles have been introduced in an effort to allow for a 'restore point' if the auto-generated durations fail for any reason, if valve timings are accidentally overwritten manually with improper or incorrect values, or any other reason! These are found in the 'Manual Valve Duration Override' window in the drop-down box that by default stores the 'last used' durations. Here you will find 3 of your most recently 'archived' durations, a 'default' profile which serves as a good valve-test starting point, and the last used profile which contains your currently active profile.

  • Selecting Valves to Test or Prime - A complaint in the previous version was that you needed to test or prime valves in pairs. Well, now you don't! You can select just 1, all 8, or any number in between on either side to test or prime. Just select the buttons corresponding to the valves you want to test or prime and hit 'Start Testing'/'Start Priming' and off you go.

  • Valve Control Window - This window was slightly redesigned to be easier to use. The logic underlying these operations is also far more efficient. Manual Door motor control still lives here.

  • Speed and Efficiency- Much of the codebase has been rewritten to use more efficient data structures (numpy arrays). Additionally, the controller program now utilized many threads threads (many CPU workers). This not only makes the user interface much snappier while an experiment is running, but does so while experience zero degradation in program logic performance. In other words, experiment critical operations occur exactly when they should, while the user interface feels smooth.

  • Logfiles Updates - Logfiles have been renamed, and the information that is logged has been pruned and reduced to that which will actually assist in debugging. I found that previously logs were not helpful at all and just produced more confusion. This update should substantially aid in the debugging process. Once installed, these logs can be found at your Documents directory under the subdirectory name 'Photologic-Experiment-Rig-Files/logfiles'.

Arduino Code Improvements

  • Physical Setup - The most notable change among the many for the Arduinos is the reduction from 2 down to 1 board. The previous setup required two Arduino boards paired to the PC and connected together via GPIO pins. This is no longer a requirement. It was found to be far more efficient and simpler in many respects to use one Arduino board for all motor/valve/lick detection tasks. The board contains a chip fast enough to accommodate all of these tasks while maintaining accurate timing of events. Instructions on how to migrate from the two Arduino setup to one board can be found here, or downloaded from the 'Assets' section below.

  • Data Accuracy - Event timestamps are measured on Arduino device and communicated to the controller later. This allows for the capture of event timestamps as they actually occur in time and not when the controller happens to have free time to mark them down.

  • Lick/Valve Prohibition - Lick detection and valve actuation have been decoupled. The interaction between licks and valve actuation is as follows, a lick onset (or beam break) initiates a valve actuation. This valve will open and close independent of what next occurs with the beam. Another lick CANNOT begin until BOTH the valve has been closed from previous actuation AND tongue has cleared the beam (beam has restored a connection). This helps to avoid licks too close in succession, as valve actuation are roughly 24-40 ms generally. This effectively works as a lick timeout for this amount of time. There IS NO OTHER lick timeout feature currently implemented. It would be simple to do so but it was unclear if this would be necessary, only testing will tell. Furthermore, a continued beam break does not result in a continuous stream from a valve. A lick initiation will result in a valve opening of the determined length. This will not occur again until beam is restored and broken again.

  • Garbage/Phantom Lick Removal - Due to potential equipment/electrical quirks, some licks with durations of 0,1, 2 ms were being detected. A 10ms minimum requirement has been implemented so that licks with lengths less than this are disregarded and not sent to the controller (PC).

  • Speed and Efficiency - The Arduino also improved massively in efficiency and speed when compared to the previous version of the Rig software. As discussed all functionality was unified into one board. Beyond this however, data structures and communications protocols were massively simplified. When possible, raw bytes are sent to the board for maximum speed and efficiency. The Arduino receives 'header' data that tells the board how much more data will arrive, and then reads exactly that much data. Data structures that relied on external libraries (Vector.h) were replaced with Arduino native arrays for reduced performance overhead and also clarity. It is far easier to understand what is happening with a native library than an external library.

  • Source Code Structure - The code structure was separated into many different header / implementation files in subdirectories of the project root. This allows for easy location of code that implements certain features.

  • Introduction of Makefile - The arduino-cli was used to facilitate quick command line development. A makefile simplified the compilation and upload process. For future developers who use command line editors, this is a great tool to use.

Both Programs Benefited From

  • Clarity - The vast majority of the codebase has been either re-written or re-worked in an effort to make it not only more efficient, but also more clear and understandable. Code is organized into subdirectories and classes that describe the responsibility it as in the overall structure of the code.