MKS 901p

Every fusor and fusion system seems to need a vacuum. This area is for detailed discussion of vacuum systems, materials, gauging, etc. related to fusor or fusion research.
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

MKS 901p

Post by Pablo Llaguno »

Hey guys,

So I bought a high vacuum gauge (finally) and I have been working on getting it to work. I bought it from eBay http://www.ebay.com/itm/MKS-901P-11040- ... SwTA9X7FWb and I think the transducer they sold me does work, but I've had bad luck lately with getting correct readings, so I want to ask for help in case I got a malfunctioning gauge and have to return it.

Here is the setup

Image

As you can see I am not using the d-sub 15 connector I should be using, I stripped an old female VGA I had, only to find that pin 4 does not have a cable. Why does pin 4 matter, well here is the 4 pins I need from the gauge and what they do.

Pin 3: Power + (9-30 VDC)
Pin 4: Power return -
Pin 5: Analog Output +
Pin 6: Analog Output -

So I already have that problem, any idea on how could I get pin 4 in the VGA cable to work? As you can see at the moment I am using jumper wires, which isn't that much of a problem.

My main problem is with the readings, so a little info on the output setup.

I bought an Arduino UNO in hope to use it as an A/D converter so I can have the data displayed in a LCD, at the moment I just have it connected to my computer and use the serial monitor which works fine. As you know the A/D converter only works from 0 to 5 volts, and my gauge output anywhere from 0 to 9volts, so I am using a voltage divider that consists of a 3.9 and a 4.7 kilohm resistor, this way my voltage is scaled down to approximately 0 to 4.91 volts. I have it connected so the positive output goes to the 3.9 resistor and the negative to the 4.7, also in the breadboard I connected a ground to the Arduino from the 4.7 resistor rail. So anyway, here is the Arduino software code:

Code: Select all

/*
 MKS901p Vacuum Transducer 0-9VDC, 1VDC per Decade. Using a voltage divider of 4.7kΩ and 3.9kΩ to get the analog signal down to 0-5VDC.
*/

//the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023);
  //Convert to scale of 0-9 volts
  float realvoltage = ((voltage / 0.53472184347873) - 6);
  //Convert the voltage signal to presure
  float pressure = pow(10, realvoltage); 
  //We print accordingly to the range of the pressure
  //First we define Torr above 0.99
  if (pressure > 0.99) {
    Serial.print(pressure, 2);
    Serial.println(" Torr"); }
  //In the latter we print only milliTorr (also known as microns)
  else if (pressure > 0.00099) {
    Serial.print(pressure * (pow(10, 3)), 2);
    Serial.println(" milliTorr");
    }
  //For smaller than microns we preffer to use exponents in Torr (e.g 1.2EE-6 Torr)
  else if (pressure > 0.000099) {
    Serial.print(pressure * (pow(10, 4)), 2);
    Serial.println("e-04 Torr");
  }
  else if (pressure > 0.0000099) {
    Serial.print(pressure * (pow(10, 5)), 2);
    Serial.println("e-05 Torr");
  }
  else {
    Serial.print(pressure * (pow(10, 6)), 2);
    Serial.println("e-06 Torr");
  }
}
As you can see it works very similar to the AnalogVoltageRead example, it starts out by reading the voltage then converting it to the real voltage it was before the divider, this was done using the formula Vout = Vin (Bottom Resistance / Total Resistance). Then I subtract 6 volts from the real voltage because my formula for pressure is: P = 10^(Vout - 6), after that I proceed to calculate the pressure and then it is just some if/else commands so it either prints "Torr" "milliTorr" or "-e0X Torr".

So I said I used formulas to convert the "divided voltage" to the real voltage, and while I did, I also used some trial and error until I got the Serial Monitor to display around 760 Torr. What worries me is how accurate will this be? If it is missing by a few Torr, then it will not serve its purpose, which is being a precision high vacuum gauge.

Any tips or critics would be appreciated.

Thanks!

PS. What is your favorite photo uploader, I am using photo bucket and it is slow and laggy, so I want to change.
John Futter
Posts: 1848
Joined: Wed Apr 21, 2004 10:29 pm
Real name: John Futter
Contact:

Re: MKS 901p

Post by John Futter »

No photo
use Irfanview to "resize/resample to 1024 by 768.
then upload the file directly to this site.

I have no idea why people use photobucket
and when it dissappears it leaves a post like yours dead in the water - a pointless post with no photo to view
Andrew Seltzman
Posts: 814
Joined: Sun Feb 01, 2004 8:02 pm
Real name: Andrew Seltzman
Contact:

Re: MKS 901p

Post by Andrew Seltzman »

If you have matlab, here is code to interface directly with the mks901p over rs232. I set my gauges to run at 115200 baud, so you would need to reset that number to the 9600 baud default in the code or change it on the gauge. Note that this matlab code should work with most MSG gauges that use RS232 (only verified with the 901p and the quattro999).

Also try interfacing with the gauge over serial through teraterm.
Attachments
IEC_vacuum_rs232.zip
(1.38 KiB) Downloaded 733 times
Andrew Seltzman
www.rtftechnologies.org
User avatar
Richard Hull
Moderator
Posts: 14975
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: MKS 901p

Post by Richard Hull »

I use the Arduino in all my digital display GM counters that I make and sell. I scale my 10 bit results to display the 9 volt battery voltage displayed permenantly in one corner of the display so the user knows when he is getting low on voltage and to be prepared to put in a new battery.

We assume that your gauge is totally linear so you do not need an Arduino lookup table for non-linear interpolation and can go directly to pressure data. What is the low end of this gauge? (manufacturers spec sheet). I assume it will go into the low micron range, at least! If it does and is linear in its pressure vs. voltage span, it would be virtually impossible to be in error by a torr. Most gauges rated to the low microns are in error at the bottom end by a few microns plus or minus.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Image

John, unfortunately I am stuck with MAC OS X, and Irfanview isn't available to download.

Andrew, I don't have matlab, nor any experience with it. Is it similar to the Arduino software or Python? Also I looked on eBay for RS232 connectors and they appear to be 9 pin, where can I get 15 pin? Or should I stick to my jumper wires, or even better, is there something I can do to get that VGA working? I am thinking of opening it up and wiring another cable that isn't in use to pin 4.

Richard yes my gauge is totally linear, the low end of this gauge as the manual -> https://www.mksinst.com/docs/R/901-MAN-RJ.pdf and the setup pdf say -> https://www.mksinst.com/docs/R/901PStan ... up-MAN.pdf it goes from 1 x 10^-5 Torr to 1500 Torr. It has both a piezo differential sensor and a micro Pirani sensor, so the error varies but it should be about 5% per the manual.

The main problem as I said, could be with my voltage divider, and the code, of course.

Thanks,
Pablo
User avatar
Finn Hammer
Posts: 298
Joined: Sat Mar 05, 2016 7:21 am
Real name: Finn Hammer
Contact:

Re: MKS 901p

Post by Finn Hammer »

Pablo,

Since you need less than 8 wires to get your reading in analogue, you can use a cat-5 network patch cable as basis for the interface cable. Then you need to get the right plug, which is a female Dsub-15. If you are unable to order it from Mouser, Digikey et al. you can unsolder one from an old video card, although it may not fit into a housing very nicely.
I bought a similar transducer lately, so I am interested in your results, PM me if you need help sourcing the right plugs/housings etc.
Cheers, Finn Hammer
User avatar
Richard Hull
Moderator
Posts: 14975
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: MKS 901p

Post by Richard Hull »

Your text in the top of your program claims 0-9 volts full range with 1 volt per decade. I assume you picked this up from the manual. with 1500 torr as its stated top end, 9 volts would be coming out near two ATM. with 9 to 8 volts covering 1500 torr to 150 torr. If all of this is the case, with the device placed on a table, using a simple volt meter, you must read about 8.4 volts. Forget the arduino in this instance. Power up the transducer, use a voltmeter to test for atmosphere and ~8.4 volts out. If this is not the case then you have announced you range data incorrectly or the transducer is defective.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Rex Allers
Posts: 570
Joined: Sun Dec 30, 2012 3:39 am
Real name:
Location: San Jose CA

Re: MKS 901p

Post by Rex Allers »

These MKS 901P sensors seem great for a fusor, though the logarithmic output might give a bit less resolution in the 1 to 100 millitorr range that we care most about. Should be way better than an old sensor like a thermocouple gauge.

Someone (maybe Andrew) mentioned using them. I bought one on eBay around the beginning of June but haven't had time to try it at all, yet. Hope it works because by the time I try it, it will be too late to go back to the seller. I paid $45 and there seemed to be many listed, so others may want to look at eBay.

The manual is not difficult to find. I think you can get it from the MKS site, but they want me to register (I may have already done that) and login to get the manual. It is out there elsewhere without a login. Here's a link at Idealvac:
http://idealvac.com/files/manuals/901manual.pdf

The 901P has two internal sensors: a micro pirani that goes down to 1E-5 torr, and a piezo at the high end. Switchover is in the 50 - 100 torr area. Yes, the analog voltage output is 1V at 1E-5 torr, with max at 9V = 1000 torr. Richard is right about the output at atmosphere; table says 760 torr = 8.881 V. That formula of pressure = 10^(V-6) seems right.

Some models have RS232 serial and some have RS485; some have relays that can be configured.

Using the serial interface, one can set the device to emulate many different other models of vacuum sensors, so if the analog output looks strange, it may be necessary to talk to the serial port and see if it is configured for default output or some other curve.

There's lots of detailed stuff in the manual including serial commands. You can read pressure via serial as another option.

The connectors are easy to find. Digikey and mouser should have them but I bought 10 from eBay for about $6. Search for: 'D-SUB HD15 15-Pin'. The HD makes it the 3-rows of pins vs non-HD which can be D-sub 15-pin but 2 rows. A lot of the connectors mention the term VGA too.
Rex Allers
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: MKS 901p

Post by Jerry Biehler »

Oh geeze, you soldered right to the pins. Make sure you clean off the solder with wick before you try to mate with a connector.

http://www.mouser.com/ProductDetail/Kyc ... %2f%2fs%3d

The output is not linear, it is log-lin like most analog output gauges. I have a arduino sketch that will read the pfeiffer full range output and display it to a lcd panel if you want it. You would just need to modify the math function in it to what is in the manual. It also display in scientific notation which is more annoying to display than one would think.

For mac you can use the preview app or the built in photos app to resize a photo. In preview just go to the Tools menu and Adjust Size...
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Thanks for the tip Finn, I actually managed to take the had of the connector, and think it will be possible to solder cables to the D-Sub 15 pin head, so in theory I am making my own cable, but it should work just fine. Also Jerry, I didn't solder anything, I just used jumper wires, which conveniently fit just right in the connector. Richard, I have read most of the manual (except the interface part, because I won't be doing any) and it does say the formula to convert voltage to pressure is that: 1VDC per decade, or P = 10^ (Vout - 6), so atmosphere should be 8.881 Volts, it is actually mentioned in the manual. And thanks for the tip, I will try to get a nice volt meter (my multimeter doesn't have the accuracy for this).

Rex thanks for the heads up on the manual, I already read the electrical installation and of course the analog output part. I also got it for $45, which is a great price, though the adapter to fit it to my vacuum chamber where another $45, but I will a good vacuum gauge for less than $100 is well worth it, plus I am learning a lot.

Hey Jerry, thanks for the offer, I think it would be nice to read that arduino sketch of your vacuum pressure, PM me or post it here, thanks!

Also guys, I think my main "inaccuracy problem" lays in the voltage divider I use so the arduino can read the analog voltage, in my code I have the arduino read the voltage and then "convert it" to the actual voltage of the output pins. The code is

Code: Select all

  float realvoltage = ((voltage / 0.53472184347873) - 6);
and I just solved for Vin in the formula that is used for voltage dividers: Vout = Vin (Rb/ Rb + Rt). The main problem is that my resistors are claimed to be 3.9 kilohm and 4.7 kilohm, though they have the gold ring so it means they have a 5% error, ideally my code should say

Code: Select all

voltage / 0.54651163
but that is if my resistors are exactly 3.9 and 4.7, I tried the arduino with those values and the pressure it displayed was about 480 Torr, at atmospheric pressure; so I solved for the (Rb / Rb + Rt) part and got 0.53472184347873 as my value, and now my gauge does read 760 Torr. My best bet, as Richard said, is to get a voltmeter and measure my real voltage from both the transducer and the voltage divider. If I get that right, the whole thing will be right. On a side note, does anyone think it is a good idea to use that voltage divider? If not, what should I do?

Also I have another problem, and that is that the pressure that is displayed, isn't exactly consistent, it is always either display 750 or 760 Torr, with 760 being more common. Can this be a problem with the 9600 bits per second?
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: MKS 901p

Post by Jerry Biehler »

Ah, ok, it looked like you soldered onto the pins.

The reason it bounces between 750/760 is probably just because of the resolution of the ADC inside the unit. Don't worry about it.

Code: Select all

#include <PID_v1.h>
#define ENCODER_DO_NOT_USE_INTERRUPTS
#include <Encoder.h>
#include <LiquidCrystalFast.h>

// initialize the library with the numbers of the interface pins
LiquidCrystalFast lcd(33, 32, 31, 30, 29, 28, 27);
         // LCD pins: RS  RW  EN  D4  D5  D6  D7
//Pressure Gauge Variables
const int numReadings = 10;
int readings[numReadings];      // the readings from the analog input
int indexr = 0;                  // the index of the current reading
int total = 0;                  // the running total
int average = 0;                // the average
int decade;
int exponent;
double torr;
float pa;
float volts;
float pressure;
float significand;
float x;
int error;
//Evap Controller Variables
const int chanA =  3;
const int chanB =  4;
const int chanC =  5;
const int chanD =  6;
const int buttonRight =  9;
const int buttonMid =  12;
const int ButtonLeft =  15;
Encoder knobLeft(13, 14);
Encoder knobMid(10, 11);
Encoder knobRight(7, 8);
int chanAvolt = A12;
int chanCvolt = A11;
int chanDvolt = A10;
int pressVolt = A8;
int pressIdent = A9;
int chanArem = A7;
int chanCrem = A6;
int chanDrem = A5;
int chanAfb = A4;
int chanCfb = A3;
int chanDfb = A2;
double SetpointA, InputA, OutputA;
double SetpointC, InputC, OutputC;
double SetpointD, InputD, OutputD;
PID PIDchanA(&InputA, &OutputA, &SetpointA,2,5,1, DIRECT);
PID PIDchanC(&InputC, &OutputC, &SetpointC,2,5,1, DIRECT);
PID PIDchanD(&InputD, &OutputD, &SetpointD,2,5,1, DIRECT);

void setup() {
    Serial.begin(9600);   
  // set up the LCD's number of rows and columns: 
  lcd.begin(24, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
  analogWriteFrequency(3,40000);
  analogWriteFrequency(4,40000);
  analogWriteFrequency(5,40000);
  analogWriteFrequency(6,40000);
  pinMode(chanA, OUTPUT);
  pinMode(chanB, OUTPUT);
  pinMode(chanC, OUTPUT);
  pinMode(chanD, OUTPUT);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
  pinMode(15, INPUT_PULLUP);
    //initialize the variables we're linked to
  InputA = analogRead(chanAfb);
  InputC = analogRead(chanCfb);
  InputD = analogRead(chanDfb);
  SetpointA = 100;
  SetpointC = 100;
  SetpointD = 100;

  //turn the PID on
  PIDchanA.SetMode(AUTOMATIC);
  PIDchanC.SetMode(AUTOMATIC);
  PIDchanD.SetMode(AUTOMATIC);
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:

  analogWrite(chanA, 51);
  analogWrite(chanB, 102);
  analogWrite(chanC, 153);
  analogWrite(chanD, 204);
  //Gauge loop
    // subtract the last reading:
  total= total - readings[indexr];         
  // read from the sensor:  
  readings[indexr] = analogRead(pressVolt); 
  // add the reading to the total:
  total= total + readings[indexr];       
  // advance to the next position in the array:  
  indexr = indexr + 1;                    

  // if we're at the end of the array...
  if (indexr >= numReadings)              
    // ...wrap around to the beginning: 
    indexr = 0;                           

  // calculate the average:
  average = total / numReadings;
  volts = average * .0097;   
  torr = pow(10,(1.667 * volts - 11.46));
  if torr 
  decade = floor(x);
  exponent = decade - 7;
  significand = pow(10,(x - decade));


  //Serial.println(x);  
  Serial.println(volts); 
  Serial.println(torr);
  //Serial.println(pressVolt);
  //Serial.println(decade); 
  //Serial.println(significand);
  if (volts >= 1.8 && volts <= 8.61) {
    lcd.setCursor(4, 1);
    // Print a message to the LCD.
    lcd.print("e");
    lcd.setCursor(0, 1);
    lcd.print(significand); 
    lcd.setCursor(5, 1);
    lcd.print(exponent);
    error = 0;
   lcd.setCursor(7, 1);
    lcd.print(" Torr");
  }
  
  
  else {
    if (volts > 8.61) {
      lcd.setCursor(0, 1);
      lcd.print(" Overrange     ");
      error = 1;
    }
    if (volts < 1.8 && volts > 0.5) {
      lcd.setCursor(0, 1);
      lcd.print(" Underrange     ");
      error = 0;
    }
    if (volts < 0.5) {
      lcd.setCursor(0, 1);
      lcd.print("Sensor Error   ");
      error = 1;
    }
  }
}
There is also this mess:

Code: Select all


#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(PIN_D0, PIN_B7, PIN_B3, PIN_B2, PIN_B0, PIN_B1);
const int numReadings = 10;
int readings[numReadings];      // the readings from the analog input
int index = 0;                  // the index of the current reading
int total = 0;                  // the running total
int average = 0;                // the average
int decade;
int inputPin = 9;
int exponent;
float torr;
float pa;
float volts;
float pressure;
float significand;
float x;
int error;
int state = HIGH;      // the current state of the output pin
int reading;           // the current reading from the input pin
int previous = LOW;    // the previous reading from the input pin
int state1 = HIGH;      // the current state of the output pin
int reading1;           // the current reading from the input pin
int previous1 = LOW;    // the previous reading from the input pin
// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0;         // the last time the output pin was toggled
long time1 = 0;         // the last time the output pin was toggled
long debounce = 200;   // the debounce time, increase if the output flickers
int state2 = HIGH;      // the current state of the output pin
int reading2;           // the current reading from the input pin
int previous2 = LOW;    // the previous reading from the input pin
long time2 = 0;         // the last time the output pin was toggled
int state3 = HIGH;      // the current state of the output pin
int reading3;           // the current reading from the input pin
int previous3 = LOW;    // the previous reading from the input pin
long time3 = 0;         // the last time the output pin was toggled
int state4 = HIGH;      // the current state of the output pin
int reading4;           // the current reading from the input pin
int previous4 = LOW;    // the previous reading from the input pin
long time4 = 0;         // the last time the output pin was toggled
int stateo = HIGH;      // the current state of the output pin
int readingo;           // the current reading from the input pin
int previouso = LOW;    // the previous reading from the input pin
long timeo = 0; 
int mvenab;
int pvenab;
int override = LOW;
int overridden = LOW;
void setup()
{
  // initialize serial communication with computer:
  Serial.begin(9600);   

  // initialize all the readings to 0: 
  for (int thisReading = 0; thisReading < numReadings; thisReading++)
    readings[thisReading] = 0;
  pinMode (PIN_F4, OUTPUT);  //Turbo Pump
  pinMode (PIN_F5, OUTPUT);  //Fore Pump
  pinMode (PIN_F0, OUTPUT);  //Main Valve
  pinMode (PIN_F1, OUTPUT);  //Probe Valve
  pinMode (PIN_D2, INPUT_PULLUP);  //Override Input
  pinMode (PIN_C7, INPUT_PULLUP);  //Main Valve Input
  pinMode (PIN_C6, INPUT_PULLUP);  //Probe Valve Input
  pinMode (PIN_D3, INPUT_PULLUP);  //Turbo In
  pinMode (PIN_D6, INPUT_PULLUP);  //Fore In
  pinMode (PIN_D1, INPUT_PULLUP);  //Mode Switch
  lcd.begin(24, 2);
  lcd.clear();
  lcd.setCursor(0, 0);
  // Print a message to the LCD.
  lcd.print("FP:   TP:   MV:   PV:");    

}

void loop() {
  reading = digitalRead(PIN_D3); // Turbo Control
  if (reading == HIGH && previous == LOW && millis() - time > debounce) {
    if (state == HIGH)
      state = LOW;
    else
      state = HIGH;
    time = millis();    
  }
  digitalWrite(PIN_F5, state); 
  previous = reading;
  reading1 = digitalRead(PIN_D6); // Fore Control
  if (reading1 == HIGH && previous1 == LOW && millis() - time1 > debounce) {
    if (state1 == HIGH)
      state1 = LOW;
    else
      state1 = HIGH;
    time1 = millis();    
  }
  previous1 = reading1; 
  digitalWrite(PIN_F4, state1);
  if (state == 0) {
    lcd.setCursor(10, 0);
    lcd.print(byte(0x95));
  }
  else {
    lcd.setCursor(10, 0);
    lcd.print(byte(0x94));
  }
  if (state1 == 0) {
    lcd.setCursor(4, 0);
    lcd.print(byte(0x95));
  }
  else {
    lcd.setCursor(4, 0);
    lcd.print(byte(0x94));
  }
  reading2 = digitalRead(PIN_D1); // Pressure Mode Switch
  if (reading2 == HIGH && previous2 == LOW && millis() - time2 > debounce) {
    if (state2 == HIGH) 
      state2 = LOW;

    else 
      state2 = HIGH;

    time2 = millis();    
  }
  previous2 = reading2; 
  

  // subtract the last reading:
  total= total - readings[index];         
  // read from the sensor:  
  readings[index] = analogRead(inputPin); 
  // add the reading to the total:
  total= total + readings[index];       
  // advance to the next position in the array:  
  index = index + 1;                    

  // if we're at the end of the array...
  if (index >= numReadings)              
    // ...wrap around to the beginning: 
    index = 0;                           

  // calculate the average:
  average = total / numReadings;
  volts = average * .0097;   
  if (state2 == 0)  torr = volts - 2.1249;
  else torr = volts - 2;
  x = torr - 1.5;
  decade = floor(x);
  exponent = decade - 7;
  significand = pow(10,(x - decade));


  //Serial.println(x);  
  Serial.println(volts); 
  Serial.println(average);
  //Serial.println(decade); 
  //Serial.println(significand);
  if (volts >= 1.8 && volts <= 8.5) {
    lcd.setCursor(4, 1);
    // Print a message to the LCD.
    lcd.print("e");
    lcd.setCursor(0, 1);
    lcd.print(significand); 
    lcd.setCursor(5, 1);
    lcd.print(exponent);
    error = 0;
    if (state2 == 0) {

    lcd.setCursor(7, 1);
    lcd.print(" Torr");
  }
  else {
    lcd.setCursor(7, 1);
    lcd.print(" mBar");
  }
  }
  else {
    if (volts > 8.5) {
      lcd.setCursor(0, 1);
      lcd.print(" Overrange     ");
      error = 1;
    }
    if (volts < 1.8 && volts > 0.5) {
      lcd.setCursor(0, 1);
      lcd.print(" Underrange     ");
      error = 0;
    }
    if (volts < 0.5) {
      lcd.setCursor(0, 1);
      lcd.print("Sensor Error   ");
      error = 1;
    }
  }

  if (volts < 6.5 && error == 0) pvenab = 1;
  else pvenab = 0;  
  if (volts < 6.5 && error == 0) mvenab = 1;
  else mvenab = 0;
  readingo = digitalRead(PIN_D2); // Overridee Switch
  if (readingo == HIGH && previouso == LOW && millis() - timeo > debounce) {
    if (stateo == HIGH) 
      stateo = LOW;   
    else 
      stateo = HIGH;    
    timeo = millis();    
  }
  previouso = readingo; 
  stateo = override;
  reading3 = digitalRead(PIN_C7); // Main Valve Switch
  if (reading3 == HIGH && previous3 == LOW && millis() - time3 > debounce) {
    if (state3 == HIGH) 
      state3 = LOW;   
    else 
      state3 = HIGH;    
    time3 = millis();    
  }
  previous3 = reading3; 
  //if (mvenab == 0 && override == 1) overridden = 1;
  if (override == HIGH || mvenab == 1) digitalWrite(PIN_F0, state3);
  else {
    digitalWrite(PIN_F0, LOW);
    state3 = 0;
  }
  reading4 = digitalRead(PIN_C6); // Probe Valve Switch
  if (reading4 == HIGH && previous4 == LOW && millis() - time4 > debounce) {
    if (state4 == HIGH) 
      state4 = LOW;   
    else 
      state4 = HIGH;     
    time4 = millis();    
  }
  previous4 = reading4; 
  if (pvenab == 1) digitalWrite(PIN_F1, state4);
  else {
    digitalWrite(PIN_F1, LOW);
    state4 = 0;
  }
  if ( state3 == HIGH && override == LOW) {
    lcd.setCursor(16,0);
    lcd.print(byte(0x3D));
  }
  else {
    if (state3 == HIGH && mvenab == 1) {
      lcd.setCursor(16,0);
      lcd.print(byte(0x88));
    }
    else {
      lcd.setCursor(16,0);
      lcd.print(byte(0x8D));
    }
  }
  if (state4 == HIGH) {
    lcd.setCursor(22,0);
    lcd.print(byte(0x3D));
  }
  else {
    lcd.setCursor(22,0);
    lcd.print(byte(0x8D));
  }


  delay(50);
}



Bruce Meagher
Posts: 148
Joined: Thu May 12, 2011 11:25 pm
Real name: Bruce Meagher
Location: San Diego

Re: MKS 901p

Post by Bruce Meagher »

Pablo,

Like Richard mentioned above just start with a cheap voltmeter (like the free ones we get at Harbor Freight). Nothing fancy required. What voltage do you measure on the analog output at atmosphere? One thing to note is that these gauges often read high (inaccurate) at atmosphere (close to 9V). I’d then recommend connecting the gauge to your chamber and pumping on it. Just watching the voltage will give you a reasonable idea if the gauge’s analog output has been set to emulate a different type of gauge by the previous owner (explained in the manual).

If you’ve been able to create a nice plasma ball then I’d expect the gauge’s analog output to be approximately 4V - 5V if it’s set to the factory default curve.

If you’re determined to start with the Arduino then having your program calculate and display the pressure will just make it harder to determine if the gauge is working properly. I would think the 750 Torr vs 760 Torr you're currently seeing ’s just your program reading between two ADC values. Printing the raw ADC values and hand calculating the voltages might be instructive. Measuring the voltage with a voltmeter at the divider should also be instructive. What you do not want to do is set constants in your code to match what you believe the pressure should be at atmosphere.

You can also use an inexpensive serial to USB adaptor to connect the serial link on the gauge to your Mac’s USB port (you could even jumper between the gauge and USB/Serial adaptor cable to test it without making a proper cable). This is assuming you have the RS-232 version. With OSX's Terminal app and the “screen" command you should be able to directly connect to the gauge and issue commands digitally over the serial port. Or just use one of the Arduino’s serial ports.

Bruce
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: MKS 901p

Post by Jerry Biehler »

The arduino's serial is ttl level so you will have to add in a MAX3232 (assuming 3.3v). You will need one of these: https://www.sparkfun.com/products/11189
User avatar
Richard Hull
Moderator
Posts: 14975
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: MKS 901p

Post by Richard Hull »

Your oscillation between 750 and 760 could be the Arduino's 10 bit resolution limit over the 0-9v range of the sensor. I would check it with a voltmeter and see what the wiggle is on voltage at atmosphere. If it is a resolution problem, then once in the low range of fusor pressures, you might have accuracy issues. You could get better resolution if you limit the Arduino to the voltage from a much narrower span of the decade voltages from 9 volts to say 2 or 3 volts in the 0-9v range of interest for fusor work.

Finally, 1% resistors are very common and inexpensive now. However, why fiddle with such a divider? Use two 1% resistors where the division point is say 4.8 volts and then insert a modern 10 turn pot in the middle of an appropriate ohmic span and put 9.000 volts on the divider and turn the pot until its wiper reads 5.000 volts. This should eliminate any error to the limit of the sensor and your ability to supply and read accurately 9.000 and 5.000 volts in the adjustment phase. Heck, you could probably just get a 10 or 20 turn pot of about 10k and ground one end and put 9.000 v on the other and tune it to 5.000 on the wiper. The elegance of the two resistor one pot solution offered up first is to be preferred.

Richard Hull

P.S. I posted late on this and others hit on the 10 bit resolution limit of the arduino. I did not see their posts. The updated divider idea and narrower reporting span is still a good one
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Thanks for all the help, it is a lot to process, but I think that I will understand it one day.

My multimeter doesn't even read decimals, but connected to my gauge it displays 8volts. Tomorrow I'll go with a friend that has a nice digital voltmeter and test the gauge output Sadly we don't have harbor freight here, so I would prefer to order one from amazon (does someone has any recommendations for one?).

Bruce I totally agree that I should not set constants in my code to match what I believe is the pressure, that is why I am trying to fix the thing with my voltage divider. Also I didn't fully understand this part
You can also use an inexpensive serial to USB adaptor to connect the serial link on the gauge to your Mac’s USB port (you could even jumper between the gauge and USB/Serial adaptor cable to test it without making a proper cable). This is assuming you have the RS-232 version. With OSX's Terminal app and the “screen" command you should be able to directly connect to the gauge and issue commands digitally over the serial port. Or just use one of the Arduino’s serial ports.
I haven't read anything about the serial user interface, would you mind PM me about this? Thanks

Richard so you are saying that I might get better resolution if I set the voltage divider to a narrower span of voltage, instead of 0-5, something like 0-3? Also your solution for the voltage divider using a potentiometer is very clever, I never thought of that. I've never used turn potentiometers, just normal 10k potentiometers, could I use a 10k potentiometer and adjust it while reading the voltage with a voltmeter until I get 5.000 V?
User avatar
Richard Hull
Moderator
Posts: 14975
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: MKS 901p

Post by Richard Hull »

You seem to insist on using the Arduino with 10 bit resolution. Within the prgramming language, you can instruct the full 10 bits to examine only a much narrower range of voltages (span). this span might be where the gauge is looking at ouputing voltages far less than 9 volts or 7 volts, where the pressure is in the lower ranges within the fusor's operational range.

Thus, your Arduino would not even report a pressure until you were under 1 torr or even under 100 microns. Why do you need to accurately display 123 torr of 396 microns? They are without any value to you. It isn't until you hit 100 microns that you might really be interested in what pressure to have in the chamber. All of that upper end pressure is a waste of bits.

Some rather fancy preconditioning of the 9 v to 0 v signal may be required.

i am working on this.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Rex Allers
Posts: 570
Joined: Sun Dec 30, 2012 3:39 am
Real name:
Location: San Jose CA

Re: MKS 901p

Post by Rex Allers »

Using the ADC on an Arduino to read the pressure from these 901P sensors seems like a pain unless you enjoy the project. If you learn how to talk to the serial interface of the 901P, it will send back the pressure. I'm sure they spent a lot of time getting that result, that they send back, as accurate as possible.

If you have a good DVM then measuring the analog signal to see how things are working is an easy way to start.

If you want to talk serial, first check your part number to be sure it has an RS232 interface, not RS485. (It probably does.) Talking serial from the Arduino pins, the signals are inverted TTL so you need to get a little converter board. There are many on eBay. Try searching for 'rs232 to ttl board'. Some of these little boards come with a DB-9 connector mounted on them, but that would just complicate things for this application. There are also boards with just solder tabs that probably would be easier for this. Just now, I saw one listing from china with 5 boards for $1.15.

You will have to learn to use the serial drivers for the arduino and write some code to send commands and process the results. To start, you can print to the debug port and see that on a PC attached through the USB cable. Actually, for 1st pass learning you could probably wire a DB-9 connector and talk to the sensor with a PC or Mac, no Arduino. You may need a USB to Serial adapter to get a serial port on the PC. Then just use some kind of serial terminal program. On a PC, XP and below gave you Hyper Terminal. Win 7 and newer dropped Hyper Terminal but there are ways to get it back or use a different program. I'm not a Mac guy but there must be something similar.

I gave a 901 manual link earlier. That manual describes using the serial port on pages 9-11. Then pages 15 & 16 talk about reading the pressure with commands. Simplifying out possible complications you would do something like this:
Send: @253PR4?;FF
Receive: @253ACK1.230E-3;FF

It's probably good to learn to talk on the serial interface to the 901P in case you need to change some nonstandard configuration that it may have or to program something that might be useful like relay outputs.

So that's what I think I will do when I have time to try the 901P sensor that I bought but haven't tried yet.
Rex Allers
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Richard Hull wrote:You seem to insist on using the Arduino with 10 bit resolution. Within the prgramming language, you can instruct the full 10 bits to examine only a much narrower range of voltages (span). this span might be where the gauge is looking at ouputing voltages far less than 9 volts or 7 volts, where the pressure is in the lower ranges within the fusor's operational range.

Thus, your Arduino would not even report a pressure until you were under 1 torr or even under 100 microns. Why do you need to accurately display 123 torr of 396 microns? They are without any value to you. It isn't until you hit 100 microns that you might really be interested in what pressure to have in the chamber. All of that upper end pressure is a waste of bits.

Some rather fancy preconditioning of the 9 v to 0 v signal may be required.

i am working on this.

Richard Hull
Thanks Richard for the clarification, I didn't understand you at first. You are right, I don't need to accurately display 120 Torr, the best range for me would be from the lower micron end to 1 Torr, if possible, but the most important pressure range is when I hit 100 microns as you say. So let me ask once again, because I am not sure I understand you correctly, but what you are telling me is that I will be better with the Arduino reading a shorter span of voltage, instead of reading 0-9, I would be better by reading 0 - 6 volts, or even smaller spans?

Rex, my part number does indicate I have a RS232 interface. I just started learning Arduino this week, so if I want to go serial the best option would be to get that USB to RS232 adapter, page 9 on the manual shows how it should be wired. In Mac it is literally called terminal.
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: MKS 901p

Post by Jerry Biehler »

The terminal app is a terminal for the OS, it is not a serial terminal. Download Zterm, that will talk to a serial port. You can set up macros with it to send the serial strings with a key combo, some devices will ignore manual typed in commands because it will time out if the time period between characters is too long.
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Jerry Biehler wrote:The terminal app is a terminal for the OS, it is not a serial terminal. Download Zterm, that will talk to a serial port. You can set up macros with it to send the serial strings with a key combo, some devices will ignore manual typed in commands because it will time out if the time period between characters is too long.
Thanks for the correction.

I don't even know where I got the idea of measuring the pressure with the ADC from the Arduino, I just thought it would work, I simply ignored the fact of the 10 bit resolution of the ADC and thought the voltage divider would do. So what I am going to do is check with the voltmeter, and then try to do some serial communication.

Thanks for the help,

Pablo
User avatar
Richard Hull
Moderator
Posts: 14975
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: MKS 901p

Post by Richard Hull »

I bread boarded a very simple circuit to get only 5 volts into the arduino until the sensor's output voltage drops down below 5 volts.

You place a 470 ohm resistor in series with a 4.8 volt precision zener diode. Feed a variable 9 volt to 0 volt positive voltage from a supply to the open end of the 470 ohm resistor and ground or return of the supply to the open end of the diode. (make sure the diode polarity is correct). Place a voltmeter between the ground point and the junction of the diode and resistor. Set the supply to 9 volts. You will read ~4.8 volts. As you lower the voltage to 7 volts. The meter will still read 4.8 volts, safe for the arduino. As you continue to lower the voltage, below 4.8 volts, you hit the "zener knee". At this point on to zero volts, from the supply, the meter reads exactly what the supply reads.

Thus, you have had 4.8 volts out of the this circuit regardless of input voltage until you go below 4.8 volts applied, at which time any lower voltage just passes by into the Arduino, safely, until you hit zero.

Note, you have obviated and failed to register the the first four decades of the device and can read the pressure with the arduino from about 4.6 volts down to zero. This jams more bits and resolution into the range that you need at fusion pressures.

Caveat!!**** Nothing is easy....Always remember that in electronics.... There is almost always a way to skin a cat, but that doesn't mean you won't get scratched doing it.

It turns out that at the zener knee there is a small "loopy zone" (leakage region) of about .4 volts where things and the voltages monkey about a bit. But once you are well below the zener voltage the lower voltage exactly tracks the input voltage ~4.6v or so to zero. You could use a precision zener at 5 volts which the Arduino would be happy with, but I like a safety zone afforded by a 4.8 volt zener.

If you do not follow this discussion perhaps you might go with the serial suggestions. This is just how I would do this if I was pressed to use the Arduino as an experimental effort and exercise for self-satisfaction.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Checked the voltage with a voltmeter and it said 9.6Volts, that doesn't sound good to me so I think the multimeter is wrong. Now I need to do some serial communication to see what the real pressure is. Talking about serial communication, zTerm is not free, I looked for other serial apps and found some but most aren't free and only give you a free trial. Any tips on what app to get?
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: MKS 901p

Post by Jerry Biehler »

ZTerm is shareware, pay if you want. http://www.dalverson.com/zterm/

The chances of the meter being wrong are almost zero. It just may need an atmospheric adjustment.
Pablo Llaguno
Posts: 104
Joined: Sun Feb 05, 2017 6:00 pm
Real name: Pablo Llaguno

Re: MKS 901p

Post by Pablo Llaguno »

Nice news!

Managed to do serial communication, got 720 Torr at atmospheric. Using my Robinair VacuMaster I managed to hit 150microns, problem is, I know the pump is capable of more vacuum than that. I am using refrigeration copper pipe (1/4")with flares to connect it to my chamber, my chamber has needle valves and Hysol1C in all fittings, except the NPT adapter to the KF16 flange of the transducer. I am also using the MAKE design (I know it is terrible), which means I "sandwiched" a glass jar between two plates, and to seal it I am using Nitrile gaskets.

I would think that my system is leaking because of the small diameter copper pipe, but I would like to hear your thoughts.
John Futter
Posts: 1848
Joined: Wed Apr 21, 2004 10:29 pm
Real name: John Futter
Contact:

Re: MKS 901p

Post by John Futter »

pablo
look up
vacuum conductance
Post Reply

Return to “Vacuum Technology (& FAQs)”