Multiple test routines using a BS2 OEM board
Otaku1031
Posts: 34
Hi all,
I'm developing a system for testing small silicone catheter balloons (medical device components). The test involves inflating and deflating each balloon N times or until failure (burst). The system is simple - the BS2 controls a pneumatic solenoid that inflates the balloon until the balloon wall contacts a microswitch lever, shutting off the air flow. The program then waits a few seconds to allow the balloon to deflate. The cycle then repeats, until either the balloon fails or passes. In the event of a burst failure, a timeout will be coded to shut off the air flow after 10 seconds. The number of times the test is repeated is TBD right now.
Here's the question: I would like to be able to simultaneously test more than one balloon at a time. Each test fixture will have a separate solenoid and microswitch. If the balloon on test fixture A bursts, I want the testing to continue on fixture B until either that balloon passes or fails. Can this be done on a single BS2 or will I need to have two boards, each running an identical test program? All advice is appreciated.
Gary
I'm developing a system for testing small silicone catheter balloons (medical device components). The test involves inflating and deflating each balloon N times or until failure (burst). The system is simple - the BS2 controls a pneumatic solenoid that inflates the balloon until the balloon wall contacts a microswitch lever, shutting off the air flow. The program then waits a few seconds to allow the balloon to deflate. The cycle then repeats, until either the balloon fails or passes. In the event of a burst failure, a timeout will be coded to shut off the air flow after 10 seconds. The number of times the test is repeated is TBD right now.
Here's the question: I would like to be able to simultaneously test more than one balloon at a time. Each test fixture will have a separate solenoid and microswitch. If the balloon on test fixture A bursts, I want the testing to continue on fixture B until either that balloon passes or fails. Can this be done on a single BS2 or will I need to have two boards, each running an identical test program? All advice is appreciated.
Gary
Comments
What level of control do you have over the inflation solenoid?
Pretty basic, just on/off. The actual air flow rate (both inflate and deflate) is controlled with a needle valve. The BS2 controls a relay which switches 110VAC to the solenoid. When the microswitch is closed (balloon deflated) the relay sends power to the solenoid, inflating the balloon. When the balloon contacts the lever and opens the switch, the relay shuts off the solenoid and allows the balloon to deflate. Rinse and repeat...
It makes sense...in my head anyway. It's midnight, it's been a long stressful day after pathetic election returns...and I'm going to bed.
Test_balloon:
DO
IF (IN13 = 0) THEN 'check state of pin 13
HIGH 0 'turn on solenoid, inflate balloon until switch closes sending pin 13 high
DO
IF (IN13 = 1) THEN 'if high, shut off solenoid
LOW 0
PAUSE 6000 'allow balloon to deflate
GOTO Test_balloon 'repeat test
ENDIF
LOOP
ENDIF
LOOP
This routine will repeat ad infinitem, unless the balloon pops. The program stalls at that point because IN13 can't go high, but air still flows. I'm still working on how to insert a timeout function. I'm thinking that a FOR...NEXT loop, 50 iterations at 200ms per (total time 10s) bracketing the nested DO...LOOP would do the trick. If IN13 doesn't go high in 10s (plenty of time for the balloon to inflate), exit the loop. Additionally, I think I should be able to insert code for a second fixture into this framework, using different I/O pins, of course. Opinions are most welcome.
So far, so good. Next up is extracting the number of cycles run per balloon leading up to a failure. Max number of test cycles is still TBD but will likely be ~50 cycles. I'll be looking at how best to use the DEBUG window to display cycle count results. Thanks to all for the pointers!
A thought - do you have any way of detecting pressure?
I'm thinking that a working balloon will present a level of pressure in the feed line. Should that pressure drop below a set-point, one might assume presume that the balloon has ruptured.
You could forego the set number of loops for the timeout.
I did look at a pressure test initially. There is a LOT of variation among these balloons, some require just slightly over 2 psi to inflate, others take as much as 6 psi. I was considering using a pressure-activated switch to do the test until I started gathering the inflation pressure numbers. It seems to be due to very tiny variations in the wall thickness, I'm talking about just a couple thousandths of an inch. Since the supplier can't hold anything better than ± 0.002" we're stuck with it. In actual use, the inflation pressure is not an issue.
I was thinking down the path of checking for "is there pressure" vs "is there no pressure" as a quick means of detecting a ruptured balloon. That way, individual test sites could be shut down whilst the other sites continue. without incurring a multi-iteration-timeout loop.
Did that make sense?
Any chance of a video?
http://s73.beta.photobucket.com/user/Otaku1031/media/Balloontester_1.mp4.html
And some of those other Halloween dealies are pretty spooky! What controller(s) did you use?
Here's the code. The part I'm having the issue with is in red text. This part of the code runs the inflation test for fixture A. Thanks!
test_1 VAR Byte
Test_balloon_1:
DO
IF counter = 50 THEN GOTO Test_balloon_2
IF (IN12 = 0) THEN
DO
HIGH 0
FOR counter = 1 TO 50
IF (IN12 = 1) THEN
LOW 0
PAUSE 5000
test_1 = test_1 + 1
DEBUG "Test 1 ", test_1
GOTO Test_balloon_2
ENDIF
PAUSE 200
IF counter = 50 THEN
LOW 0
IF counter = 50 AND counter1 = 50 THEN GOSUB Start
GOTO Test_balloon_2
ENDIF
NEXT
LOOP
ENDIF
LOOP
...ahhhhh - change the DEBUG "Test 1", test_1 to DEBUG "Test 1", DEC2 test_1
The numbers being sent to the DEBUG window were probably interpreted as "unknown", so no output. Using the DEC2 formatter says "decimal numbers, 2 places please".
Look in the online help, or the Programming Reference manual in the chapter for DEBUG and you'll see all the related formatter info.
I believe the DEBUG chapter I referenced earlier will note all the codes. The SEROUT chapter also, since these two commands are practically the same thing.
***Edit: OK, just looked in the reference manual and on page 168 you'll find a number of direct control-codes for navigating about the DEBUG output window - even in X/Y!
There is no code for a plain carriage-return - my bad. You could use the CRSRXY, or the individual CRSRX and CRSRY controls to manually place the cursor and just overwrite the test_1 value.
One last thing, the only way I can get the DEBUG window to open is to first do a CTRL R, then start the program using the momentary button (I'm running a loop that looks for P15 to go high to start the program). If I just start the program with the button, the DEBUG window doesn't open. I looked through the Help for something about how to get the window to pop without doing a CTRL R, but couldn't find anything. This is mostly a "nice to have" feature. I'm thinking I musta missed something in the Help file that talks about this...
Glad to hear progress is being made.
Keep in touch,
Dave