I have pretty much figured out now that the combination of Arduino analog sampling, some scripting within the microcontroller, serial communication, and max interfacing yields significant lag. Even with changing baud rates there is no getting away from the rounding errors which occur from the two stage sampling process (one at the Arduino board, and the other from max). This essentially means that the setup will only deliver averaged heart beat values where the data errors increase the faster the heart is beating.
Variables:
1. Method of communication is Serial. Does the information captured from the BVP device need to go to MAX straight away?
// Yes, i cannot do the signal conditioning out of the MAX environment. It would also be incredibly difficult to achieve using script within the Arduino programming environment.
2. Change the microcontroller?
// Possibly, although a change like that would basically be a back to basics scratch meaning i would have to interface a different microcontroller with MAX/MSP and figure out its programming language. After all this it may not be any faster as baud rates are set within the serial protocol.
3. Change the method of microcontroller capture?
// This refers to digital sampling rather then analogue. This is much more reliable and faster yielding greater accuracy. I tested this out by combining a switch with the 3.3V output from the Arduino. I noticed that no matter how rapidly i pressed the switch i got accurate unrounded heartbeat values exceeding 300 bpm. This however was a direct relationship between the Arduinos power supply and its digital inputs with no electronics slowing things down.
//This does mean however that if the HRMI (heart rate monitor interface) device delivers a 3v pulse then i should be able to achieve accurate readings. The issue here is whether the microcontroller will 'see' the 1ms pulses as they are extremely short. Another output on the HRMI gives a 6ms pulse. This may be more useable. Awaiting delivery.
4. Use the HRMI to produce a graphical display outside the MAX environment and use the result to affect MAX.
// For example. Have the HRMI produce a flashing light accurate to the pulse rate and sample that using a LDR. This of course would have to use the analogue inputs of the Arduino so may not be any better. The other option is to try and build a digital switch of some kind. The issue with all these ideas are that i cannot intergrate the Maxuino (digital and analogue pin to Max interface) with any scripting i would need to control the HRMI through the microcontroller.
I have however seen application in processing that use an Arduino and the HRMI to produce an accurate bmp reading over serial communication. Perhaps using that application i can use OSC (open sound control) to relay the readings to Max. For this however i think i would need a little help.
Time is pressing.

No comments:
Post a Comment