Shop OBEX P1 Docs P2 Docs Learn Events
BS2pe + 2 line scan cameras, plus some extras ... — Parallax Forums

BS2pe + 2 line scan cameras, plus some extras ...

peter.steelepeter.steele Posts: 16
edited 2014-11-12 07:51 in BASIC Stamp
Okay, so I've got an application here that I'm looking at using a BS2pe motherboard for.

Short version, I'm applying a coating to a thin film, and I'd like to use a BS2pe to monitor coating thickness in 2 ways. First, I'd like to have 2 linescan cameras (there are 2 strips of film getting done by a single machine). The cameras will monitor the average gray value in their field of view. The trimming of the machine to increase or decrease coating thickness is by means of a 0-10 VDC signal. As an additional data point, I'd like to use an LED + photoresistor combo on each film stream to monitor the light transmission properties. Last, I'd like to log the data to an SD card or USB stick.

Is all this feasible from a single BS2pe, or would I need separate units for each camera? Can I even effectively do data logging with them - all the SD card setups that I saw in the store were for propeller only?

I'd rather not go up to a propeller if I can avoid it - I've got a fairly decent base of experience with BS2's ...

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2014-11-11 13:06
    The Parallax Memory Stick Datalogger is based on the Vinculum chip from FTDI and can do datalogging from a BS2 (any model) to a USB memory stick. What linescan camera are you planning to use? Remember that the BS2 is a single threaded platform. It can only do one thing at a time so it would have to go through a cycle of / read from 1st camera / read from ADC for the 1st photoresistor / analyze data / log to Datalogger / adjust DAC for coating thickness / read from 2nd camera / read 2nd phototransistor / analyze data / log to Datalogger / adjust DAC for coating thickness /. Each of these steps will take more time than you might expect. How much data storage will be needed for the camera data? How much time do you have available for a cycle? If the available time is less than it would take for one cycle, then you will need at least to have one BS2pe for each strip of film. If there's way too little time available, then you'll have to go to a Propeller.

    Frankly, this sounds complex enough that you'd be better off using a Propeller to begin with. You wouldn't need a separate datalogger and the Propeller can do the ADC and DAC directly (with a few passive components). There's plenty of sample code in the Object Exchange for ADC, DAC, datalogging to SD card. I don't know what the camera needs, but that shouldn't be that hard.
  • peter.steelepeter.steele Posts: 16
    edited 2014-11-11 14:05
    Thanks for getting back to me.

    I did look at getting a propeller developer board, but I guess I'm a little intimidated by the added complexity over PBasic, but there's enough areas in this project that are likely to experience mission creep that I may have to go that way. Too many people are having too many brainstorms, so to speak ...

    My cycle time on this can be pretty slow - I have no huge speed requirement. If I'm making a correction every second or two then I'll be fine. (The process isn't that sensitive, and right now it might go hours or days between corrections, which are all done manually based on weighing samples and such.)

    The camera that I'm looking at using is the TSL1401, since it's already set up for the BS2pe motherboard. I guess the big question is on the subject of the expandability - I only see connections for 2 daughterboards on it. How many of them can I daisy chain together?


    I'll take another look at the Propeller stuff too.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-11-11 15:52
    There are two unused daughterboard pins that are brought out to the TSL1401-DB's mezzanine connector. They are pulled up to Vdd with 4.7K resistors on the MoBo, so are ideal for I2C interfacing. (If you don't jumper J2 on the TSL1401-DB for external triggering, there are actually three available pins on the mezzanine connector, plus another on the DB connector, P3, that's common to both DB connectors.) As far as the BASIC Stamp's single-task nature is concerned, that's not a problem with the MoBo, since the onboard AVRs handle all of the interfacing to the TSL1401 chip in parallel with the BS2pe's processing.

    -Phil
  • peter.steelepeter.steele Posts: 16
    edited 2014-11-12 07:23
    There are two unused daughterboard pins that are brought out to the TSL1401-DB's mezzanine connector. They are pulled up to Vdd with 4.7K resistors on the MoBo, so are ideal for I2C interfacing. (If you don't jumper J2 on the TSL1401-DB for external triggering, there are actually three available pins on the mezzanine connector, plus another on the DB connector, P3, that's common to both DB connectors.) As far as the BASIC Stamp's single-task nature is concerned, that's not a problem with the MoBo, since the onboard AVRs handle all of the interfacing to the TSL1401 chip in parallel with the BS2pe's processing.

    -Phil



    Okay, then, so 2 daughterboard connectors means 2 linescan cameras, and I can use the un-used pins for the photoresistor input .... but if I need control output (or anything extra) then I'm probably going to need 2 BS2pe's instead of just one. Or one propeller, I guess.

    Am I reading this correctly?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-11-12 07:51
    You can use the unused pins to connect to I2C peripherals, such as an ADC for the photoresistor inputs, or a port expander for the control outputs. But, yes, two MoBos or a Propeller might make life a little simpler.

    -Phil
Sign In or Register to comment.