Project guidance - Arduino

Hi All,

I’m a processing users and this is my first OF project, I’d love some of your input regarding the best approach for this. I’m using Windows 10 with VS2015.

Using some video processing with openCV I’d like to control a stepper and a servo motor attached to my Arduino. My goal is achieve 200 fps and to get the motors to respond between 50 and 100 millisecond, actually 20 would be ideal!

I understand there’s two ways to do this:

  1. Install standard firmata on Arduino and control using ofxArduino
  2. Upload “response” code to Arduino and control using ofxSerial

Which of these two options is best suited? Any further advice to achieve this kind of response time are much appreciated! :slight_smile:

Thanks, Charles

Hi, you’ll need some 200fps video source…
ofxSerial should be faster.
firmata might have to much over head because of the way its messages are stuctured.
how do you intend to measure the motors response time?

The 200fps camera is proving difficult to find, we’re currently using the Kinect (60fps) for testing. We may move onto this but it’s still only 120fps.

Firmata is definitely much friendlier, but I wouldn’t be surprised if you’re right.

As for the measuring reponse time we have two ideas which we’ve yet to test. First is to send back a message to openframeworks as soon as the limit switch was activated. The other is to send a timestamp of when the information was received on the arduino.

I dont know of any low price range, usb camera with higher fps. Maybe you’ll need to jump to a pricier specialized high fps camera using some video capture device.

sure. firmata is easier, although it is not that hard to make a custom protocol.
Take a look at ofxSerial as it has some handy stuff that could be useful.

The ping pong method should work. Just make sure that you send a lightweight message, probably a single byte, to test.
I dont see how useful it could be to send the timestamp, asi you’ll need a shared time reference between the computer and the arduino in order to get the response time.