Basic design help Digital pressure regulator

I do not have the pressure sensor yet and wanted to test this setup using an external pot to simulate the sensor , I attached the pot to the servo motor shaft as feedback but when I change the PID setpoint it does not do what I expect ? I suspect I have some code wrong.

I think it is where I am sending the PID OUTPUT ? or the format may be wrong ?

CODE notes in RED

//Nanometer technologies Propreitary
//P-I-D pressure regulator

#include <Servo.h>
#include <PID_v1.h>

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double Kp=10, Ki=1, Kd=1;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object

Serial.begin(9600);

//initialize the variables we're linked to
Input = analogRead(potpin);
Setpoint = 1000; should this be in VOLTS or 0-1023 ??

//turn the PID on
myPID.SetMode(AUTOMATIC);

}

void loop() {
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 12); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there

Input = analogRead(potpin);
myPID.Compute();
analogWrite(potpin, 9); Should this be Output or 9 ?

// 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.0);
// print out the value you read:
Serial.println(voltage);
delay(500);

}