Forums

Welcome, Guest
You have to register before you can post on our site.

Search Forums

(Advanced Search)

Forum Statistics
» Members: 27
» Latest member: realboss475
» Forum threads: 231
» Forum posts: 824

Full Statistics

Online Users
There are currently 7 online users.
» 0 Member(s) | 7 Guest(s)

Latest Threads
Buying 3D printer
Forum: Neuro Technology Chat
Last Post: lewisoliver
04-06-2020, 08:18 AM
» Replies: 0
» Views: 7
Bpod v2.3 ports half work...
Forum: Hardware
Last Post: Josh
03-29-2020, 12:58 AM
» Replies: 2
» Views: 254
Assembly instructions Bpo...
Forum: Hardware
Last Post: ckopec
03-25-2020, 07:29 PM
» Replies: 1
» Views: 115
Simple TTL out help
Forum: Software
Last Post: k8flr
03-12-2020, 09:27 PM
» Replies: 4
» Views: 159
BNC input logic
Forum: Software
Last Post: Josh
03-11-2020, 08:28 PM
» Replies: 1
» Views: 79
I2C Messenger Module
Forum: Hardware
Last Post: Josh
03-11-2020, 07:52 PM
» Replies: 7
» Views: 3,686
Bpod Freezes after Set Am...
Forum: Software
Last Post: Adam
03-11-2020, 07:18 PM
» Replies: 4
» Views: 110
Calibrate valvemodules
Forum: Software
Last Post: Bowey
02-27-2020, 09:33 PM
» Replies: 2
» Views: 133
if statement
Forum: Software
Last Post: Ilja
02-27-2020, 06:25 PM
» Replies: 4
» Views: 188
Bpod becomes slower and s...
Forum: Software
Last Post: CharlesYin
02-26-2020, 11:33 PM
» Replies: 2
» Views: 105

 
  Buying 3D printer
Posted by: lewisoliver - 04-06-2020, 08:18 AM - Forum: Neuro Technology Chat - No Replies

Hi folks, I believe a lot of you are into 3D printing industry and I think I'll get the help I need in choosing my 1st 3D printer. Here's the link, would you take a look?


  Bpod v2.3 ports half working
Posted by: ckopec - 03-25-2020, 07:43 PM - Forum: Hardware - Replies (2)

Josh (or anyone who may know),

Just tried building the new v2.3 Bpod (hold up in a my garage trying to keep busy as Princeton is now shut down).  Everything seemed good except when I connect a nose port to jacks 1 and 4. Poke in events are not detected (other port functions, LED, water valve work fine in all jacks) and poke in events are detected if I connect the same nose port to jacks 2 and 3.  I've been trying to hunt around on the board for a short (seeedstudio did once send us a circuit board that was wired incorrectly with a hidden short in one of the layers) but so far can't seem to find anything.  The voltage input to IC12 seems off for those 2 jacks so I think IC12 is functioning fine, it's just getting a bad input and passing that along.  When I test the pins on the ethernet port on the Bpod board with a nose port connected everything looks identical between a functioning jack (2 or 3) and the non-functioning jacks (1 and 4).  Finally I measured the voltage across the phototransistor on the nose port itself.  When connected to a functioning jack I see a voltage of 0.15V when poked out and 4.55V when poked in.  However, when I connect the same nose port to a non-functioning jack I see a voltage of 0.15V when poked out but only 0.65V when poked in.  I get the same result after removing the new 22k pull-up resistors.  If I measure the voltage across the pads for the new pull-up resistors I get a similar behavior.  Functioning jack, poke out 4.85V, poke in 0.15V.  Non-functioning jack, poke out 4.85V, poke in 4.15V.  Any thoughts on what could be causing this? Any other tests I should run to try to find the source of the problem (teensy?, IC12?, PCB?)

Thanks
Chuck


  Assembly instructions Bpod 2.0-2.3
Posted by: Max - 03-11-2020, 02:50 PM - Forum: Hardware - Replies (1)

Hi,
I could not find the assembly instructions for the newer Bpod modules could someone point me in the right direction or share them with me  Smile

Best regards Max


  BNC input logic
Posted by: MarcoC - 03-10-2020, 01:54 PM - Forum: Software - Replies (1)

Hello everyone!
I was wondering if the State Machine accepts a 0-5V logic (I want to use an arduino's digital input to trigger a new state) with 0 being the LOW level and 5V being the HIGH.

Thanks in advance!
Have a great day


  Bpod Freezes after Set Amount of Time
Posted by: Adam - 03-08-2020, 07:46 PM - Forum: Software - Replies (4)

Hello,

I am encountering a bug where Bpod freezes in the middle of a protocol: valves do not open/close, the trial does not advance, and the Bpod Console displays a single state with no transitions. This happens on only one of two Bpod machines that I have, despite the fact that they are running the exact same protocol. (They are, however, connected to different hardware, as I describe below.) I have to Ctrl+C in order to end the program, and when I do, the following error message is printed:

Code:
Operation terminated by user during ArCOMObject_Bpod/write (line 295)

In SendStateMachine (line 333)
                       BpodSystem.SerialPort.write(ByteString(i), 'uint8'); % send byte-wise, to avoid
                       HW timer overrun

In DistributionalRL_6Odours (line 236)
   SendStateMachine(sma); % With TrialManager, you can send the next trial's state machine while the
   current trial is ongoing

In run (line 91)
evalin('caller', strcat(script, ';'));

In NewLaunchManager>LaunchProtocol (line 748)
run(ProtocolPath);

Interrupt while evaluating DestroyedObject Callback.

It appears that Matlab is failing to write information to the serial port, but I have no idea why that might be. This Bpod receives TTLs from a microscope in order to perform synchronization. It also sends a voltage out to trigger the microscope. Interestingly, the problem appears worse when the microscope is running (and Bpod is receiving TTLs). In this case, Bpod almost always freezes after exactly 31 trials. (If I run a slightly different protocol, it becomes ~30 trials, but a similar amount of time and TTLs.) However, it is worth noting that every so often (perhaps 10% of attempted runs?), the program does run successfully until completion, even when the microscope is also running. When the microscope is not running, Bpod generally runs longer without errors, and tends to have a higher success rate, but nonetheless still sometimes fails in the same manner, after around 80 trials. The other Bpod, which runs without error, is not connected to a microscope and never receives TTLs, but is otherwise configured in exactly the same way.

Perhaps related to this issue, I sometimes get a different error on the same Bpod State Machine:

Code:
Error using ArCOMObject_Bpod/read (line 359)
Error: The USB serial port did not return the requested number of bytes.

Error in TrialManagerObject/startTrial (line 89)
           SMA_Confirmed = BpodSystem.SerialPort.read(1, 'uint8');

Error in DistributionalRL_6Odours (line 189)
   TrialManager.startTrial(); % Start next trial's state machine (call with no argument since it was
   already sent)

Error in run (line 91)
evalin('caller', strcat(script, ';'));

Error in NewLaunchManager>LaunchProtocol (line 748)
run(ProtocolPath);

359                 error('Error: The USB serial port did not return the requested number of bytes.')

Here, the problem is again with serial communication between Matlab and Bpod, but at the read step. I suspect these are related somehow, but I don't know in what way.

I have taken a variety of steps to debug (some of which are suggested in this thread), but none of them have been successful. They have been:

1. Re-installing the Bpod software
2. Re-uploading the firmware (v22). Verified that upload was successful through the USB native port.
3. Changing out the USB cable from Bpod to computer
4. Powering Bpod with a separate 12V DC adapter, as opposed to just the USB
5. Disabling unused inputs in the Bpod Console

I would greatly appreciate any help you could provide!

Specs:

Bpod State Machine version 0.8
Latest Gen2 Bpod software
Bpod firmware version 22
Matlab 2019b 
Inspiron 3847 desktop with an Intel i7 processor and 16 GB of RAM
64-bit Windows 10 Pro OS
PsychToolbox is installed
Bpod is communicating with an 8-channel valve driver module and a port interface + valve
Only port 1 is selected in Bpod Console > Settings > Ports, corresponding to the lick sensor input
Other USB input is disabled in Bpod Console > USB module configuration menu
Only other USB devices connected to the computer are standard keyboard, mouse, and speakers


  Simple TTL out help
Posted by: k8flr - 03-06-2020, 04:22 PM - Forum: Software - Replies (4)

Hello,

I am new to Bpod programming and running into some basic roadblocks as I learn to develop my own protocol. 

For now, I just want to generate a TTL pulse with a specific delay from a specific BNC port on my Bpod r2 state machine. I have managed to launch the code, however I keep getting error messages that do not indicate (to me) what I am doing incorrectly.


Code:
function TTLpulse
global BpodSystem

MaxTrials = 10;

S = BpodSystem.ProtocolSettings;
if isempty(fieldnames(S))
% no field names needed
end

BpodParameterGUI('init',S);

for currentTrial = 1:MaxTrials
  S = BpodSystem.ProtocolSettings;

  sma = NewStateMachine()
  sma = AddState(sma, 'Name', 'Trigger1', 'Timer', 0, 'StateChangeConditions', {'BNC1', 'High'}, 'OutputActions', {});
  sma = AddState(sma, 'Name', 'Delay', 'Timer', 10, 'StateChangeConditions', {'Tup', 'exit'}, 'OutputActions', {});
  SendStateMatrix(sma);  
  RawEvents = RunStateMatrix;

end

end

Thank you for any help, advice, or resources for programming BNC TTL pulses from a Bpod r2.


  Bpod becomes slower and slower as task code running
Posted by: CharlesYin - 02-25-2020, 10:40 PM - Forum: Software - Replies (2)

Hi Josh,

I'm using Bpod r2. I found my Bpod becomes slower and slower as the task code running. After 2 hours of running, there is an obvious gap between touching the sensor port and the start of the trial, which affects animal performance a lot. I'm wondering is this because of the problem inside Bpod or computer memory? How should I fix it?

Thanks,
Charles


  Serial Interface for PulsePalModule
Posted by: Jeff - 02-25-2020, 09:51 PM - Forum: Software - Replies (1)

Hi there...How can I run the Analog Output Module as a PulsePalModule using the serial interface? Is the syntax similar to running the module as a WavePlayer? Thanks in advance...


  Increasing max number of waveforms on AOM
Posted by: ckopec - 02-19-2020, 03:17 AM - Forum: Software - Replies (1)

Josh,

Basically I'm just tinkering so I can better understand how these things work.  I wanted to see if it was possible to increase the number of sounds (waveforms) the AOM can play running the BpodAudioPlayer_Live firmware.  I presume the two lines I need to adjust are:

const byte maxWaves = 20;
const uint32_t bufSize = 2000;

As currently configured almost all the teensy 3.6's memory is used up.  Therefore I figured if I wanted to increase the number of waves I'd need to decrease the buffer size.  And while I can decrease the buffer size to 1000 (things still play fine if maxWaves stays at 20), and I can decrease the maxWaves value below 20 (things play fine keeping maxWaves at 20 even if I increase bufSize above 2000), if I try to increase the maxWaves, say to 21 or 22 and decrease bufSize so a comparable amount of memory is used ~95%, the sounds simply don't play.  There are no errors in either Arduino when compiling and uploading, or matlab when running, just no sound output. Is there another variable or line I need to change?

Thoughts?

On a related note, are there any thoughts to upgrading Bpod and modules to run with teensy 4x at its core (high clock speed and more onboard memory could mean more sounds sampled at a higher rate than 44.1kHz)?

Thanks
Chuck


  System Reboot
Posted by: ckopec - 02-18-2020, 07:10 PM - Forum: Software - Replies (1)

We've found that occasionally rebooting the Bpod and AOM helps things run smoothly (occasionally the system can get in a non-functional state and this is the only way to get it out, though we're still trying to figure out exactly what's causing the non-functional state).  Since the power comes from the USB hub on the computer, rebooting or even powering the computer down does not cut power to the teensy.  So to force a reboot in the bpod we added the following code to the firmware in the section that starts

if ((PC.available() > 0) && (smaPending == false)) {
CommandByte = PC.readByte();

switch (CommandByte) {

case 'Q':  // SYSTEM RESET
          digitalWrite(GreenLEDPin, LOW);
          analogWrite(BlueLEDPin, 250);
          analogWrite(RedLEDPin, 128);
          delay(1000);
          SCB_AIRCR = 0x05fa0004;
      break;

Sending a Q causes the LED to turn magenta for 1s before it reboots and the LED goes back to blue flashing.

For the AOM we added the following in the section that starts

if (newOpCode) {
newOpCode = false;
switch(opCode) {

case 'Q': // SYSTEM RESET
        stopPlayback();
        SCB_AIRCR = 0x05fa0004;
      break;

Sending a Q will stop sounds and reboot the teensy causing the orange light to blink. 

We've added these commands to the function EndBpod.m after the write Z command

 BpodSystem.SerialPort.write('Z', 'uint8');
 pause(1);
 BpodSystem.PluginObjects.SoundServer.Port.write('Q','uint8')
 pause(1);
 BpodSystem.SerialPort.write('Q', 'uint8');
              


Just a thought to maybe include in other module firmware if people are having any issues.

Chuck