something missing when calculating Analog values?

Paul S. ,
Apologies for the sloppy indentation. I am still new to this type of code and in the learning process. Thank you for your time and the tip.
I do NOT know how many steps it takes to get to home If power is removed while the valve is off Home (closed )position. This is there in case of power interruption and the quarter turn valve is in partial or open position.
Disabling the drive is fine for this application. The stepper is coupled to a 50:1 gearbox which is coupled to the gear drive on a 350mm (14 inch) butterfly valve. It would require forces greater than what exists to move the valve by flow alone.

Robin,

Thank you for your time and advice. Most of those delays were in the original sketch I had adapted, and probably there for the authors driver. I have removed most of them with no ill effects and I will look into cleaning the rest of the delays up. the only one I do need to keep is the 10 second delay. that would be the rate at which the Arduino will look at the analog input for any changes.

The whole reason for this project is to control a diversion valve on a condenser water circuit, so we can close loop the water through the chiller during the spring, and fall months without damaging the compressors PaulS You seem to be in the same area, you would understand the climate. The cooling tower water is too cold at startup so we need to "preheat" the condenser circuit before introducing colder water. Our building management software measures the temperatures and provides the logic. We have it set to provide an analog output 0-5VDC.

So I made the changes to the code and still getting the same results. No motor movement with analog values. When I made the recommended changes this is the output on the serial monitor after 2 measurements at 5VDC :

Stepper is Homing . . . . . . . . . . . Homing Completed

1023
Moving stepper into position: 145266
1023
Moving stepper into position: 145266

this is the changed code;

/*  Valve Control with Analog input

  Created by Paul Wheeler

  Based on Motor Homing code using AccelStepper and the Serial Monitor

  Created by Yvan / https://Brainy-Bits.com

  designed to proportionally control large butterfly valve using 0-5VDC input
  from Building Management System

*/

#include "AccelStepper.h"

// AccelStepper Setup
AccelStepper stepperX(1, 2, 3);    // Pin 2 connected to PUL- pin of Driver PUL+ connected to 5v+
// Pin 3 connected to DIR- pin of Driver DIR+ connected to 5v+

// Define the Pins used
#define home_switch 9 // Pin 9 connected to Home Switch (MicroSwitch N/O)
#define ENA 13 //pin 13 is to drive ENA+ and ENA- connected to GND
#define ANALOG_IN A0 //analog 0-5VDC input + to A0 - to GND (External power source)

// Stepper Travel Variables
long TravelA;  // Used to store the first travel value
int move_finished = 1; // Used to check if move is completed
long initial_homing = -1; // Used to Home Stepper at startup


void setup() {
  analogReference(EXTERNAL); //reference external 5V power source
  Serial.begin(9600);  // Start the Serial monitor with speed of 9600 Bauds to monitor if needed


  pinMode(home_switch, INPUT_PULLUP);
  pinMode(ENA, OUTPUT);          // sets the digital pin 13 as output


  digitalWrite(ENA, LOW);       // sets digital pin 13 enabling drive

  //  Set Max Speed and Acceleration of each Steppers at startup for homing
  stepperX.setMaxSpeed(4000.0);      // Set Max Speed of Stepper (Slower to get better accuracy)
  stepperX.setAcceleration(2000.0);  // Set Acceleration of Stepper


  // Start Homing procedure of Stepper Motor at startup

  Serial.print("Stepper is Homing . . . . . . . . . . . ");

  while (digitalRead(home_switch)) {  // Make the Stepper move CW until the switch is activated
    stepperX.moveTo(initial_homing);  // Set the position to move to

    initial_homing--;  // increase by 1 for next move if needed
    stepperX.run();  // Start moving the stepper
  }

  stepperX.setCurrentPosition(0);  // Set the current position as zero for now
  stepperX.setMaxSpeed(4000.0);      // Set Max Speed of Stepper (Slower to get better accuracy)
  stepperX.setAcceleration(2000.0);  // Set Acceleration of Stepper
  initial_homing = 1;

  while (!digitalRead(home_switch)) { // Make the Stepper move CCW until the switch is deactivated
    stepperX.moveTo(initial_homing);
    stepperX.run();
    initial_homing++;
  }

  stepperX.setCurrentPosition(0);
  digitalWrite(ENA, HIGH);        // sets digital pin 13 disabling drive
  Serial.println("Homing Completed");
  Serial.println("");
  stepperX.setMaxSpeed(4000.0);      // Set Max Speed of Stepper (Faster for regular movements)
  stepperX.setAcceleration(2000.0);  // Set Acceleration of Stepper

}

void loop() {

  // Read new position after 10 seconds
  delay (10000);
  int analog_val = analogRead(ANALOG_IN);

  move_finished = 0; // Set variable for checking move of the Stepper
  Serial.println(analog_val); //for monitoring
  long TravelA = (analog_val * 142L); // need close to 146000 steps to get from home(closed) to full Open
  if (TravelA < 0 || TravelA > 146000) {  // Make sure the position calculated is not outside of the HOME or MAX position
  } else {
    Serial.print("Moving stepper into position: ");
    Serial.println(TravelA);


    digitalWrite(ENA, LOW);       // sets digital pin 13 enabling drive

    stepperX.moveTo(TravelA);  // Set new moveto position of Stepper


  }


  if (TravelA >= 0 && TravelA <= 146000) {


    stepperX.run();  // Move Stepper into position

  }

  // If move is completed display message on Serial Monitor
  if ((move_finished == 0) && (stepperX.distanceToGo() == 0)) {
    Serial.println("COMPLETED!");
    move_finished = 1; // Reset move variable
    digitalWrite(ENA, HIGH);       // sets digital pin 13 disabling drive
  }
}