Radio code appears to be interfering with other functions.

The server end consists of a geared motor connected to an esc which is in turn controlled by the pwm output from pin 6 on a Nano.
The output shaft on the motor has a disc with 36 slots and an LM393 slot type optocoupler connected to pin 2 of the nano.
A ping sensor is connected to pins 3 & 4.
There will be a relay and current sensor connected at some point but not yet.

Latest code.
Master:

/*
  Arduino Nano
  Pin allocation:
  D1
  D2 = speed sensor (interrupt 0)
  D3 = Ping trigger
  D4 = Ping Echo
  D5 = ESC relay
  D6 = ESC PWM out
  D7 = Radio CE
  D8 = Radio CSN
  D9 =
  D10 =
  D11 = Radio MOSI
  D12 = Radio MISO
  D13 = Radio SCK
  A0 = Current sensor
  A1 =
  A2 =
  A3 =
  A4 =
  A5 =
  A6 =
  A7 =
*/


//*********Height Sensor Stuff*********
#include <NewPing.h>
#define TRIGGER_PIN  3  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     4  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 400 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

int dist;

//*****Motor Controller Stuff******
#include <PID_v2.h>

//Define Variables we'll be connecting to
double Setpoint, Input, Output;
//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint, 0.4, 5.6, 0, DIRECT);

#define PWMpin  6

volatile unsigned long timeX = 1;
int PulsesPerRevolution = 36;
int MaxRPM = 400;
volatile int Counts = 1;
double PulsesPerMinute;
volatile unsigned long LastTime;
volatile int PulseCtr;
unsigned long Counter;
int startRamp;
unsigned long Time;
int rpm;
int printRpm; // Averaged over several readings to smooth it out.
volatile int rpmArray[5] = {0, 0, 0, 0, 0}; // For printRpm

//********Radio Stuff*******
#include <nRF24L01.h>
#include <RF24.h>
#include <SPI.h>

#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN   7
#define CSN_PIN 8

// NOTE: the "LL" at the end of the constant is "LongLong" type
// These are the IDs of each of the slaves
const uint64_t slaveID[2] = {0xE8E8F0F0E1LL, 0xE8E8F0F0E2LL} ;

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

int radioTxArray[2];

unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000;
int txVal = 0;
int radioRxArray[6];
//0 = motor on/off, 1 = setPoint, 2 = , 3 = Height, 4 = Cal, 5 = Dist
byte radioRxArrayLen = 12; // NB this 4 is the number of bytes in the 2 ints that will be recieved


bool isStarted = false;
bool isCal = false;
bool isDist = false;
bool go = false;

void setup() {
  // note that 1666666.67 = (60 seonds * 1000000 microseconds)microseconds in a minute / (36 / 9) pulses in 1 revolution
  PulsesPerMinute = (60 * 1000000) / (PulsesPerRevolution / Counts);

  pinMode(2, INPUT_PULLUP);
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("PID controlled Seeder Master R0");
  delay(1000);
  //Digital Pin 2 Set As An Interrupt for tacho.
  attachInterrupt(0, sensorInterrupt, FALLING);

  //Motor PID control stuff.
  startRamp = 10;//map(PulsesPerRevolution , 1, MaxRPM, MaxRPM, 2);
  myPID.SetSampleTime(1);
  myPID.SetOutputLimits(40, (int) 255);
  PulseCtr = 0;
  myPID.SetMode(AUTOMATIC);
  analogWrite(PWMpin, 60);
  myPID.Compute();
  delay(11);
  myPID.Compute();

  //Radio stuff.
  radio.begin();
  radio.setDataRate( RF24_250KBPS );
  radio.enableAckPayload();
  radio.setRetries(3, 5); // delay, count

}

void loop() {
  // put your main code here, to run repeatedly:
  exchangeData();
  getSetPoint();
  getStartStop();
  getHeight();
  readMotorCurrent();
  switchOnOff();
  readRpm();
  debug();
  static unsigned long SpamTimer;

}

void exchangeData()//Send and receice radioTxArray and radioRxArray.
{

  currentMillis = millis();
  if (currentMillis - prevMillis >= txIntervalMillis) {

    radio.openWritingPipe(slaveID[0]); // calls the first slave
    // there could be a FOR loop to call several slaves in turn
    bool rslt;
    rslt = radio.write( radioTxArray, sizeof(radioTxArray) );
    Serial.print("\nRSLT (1 = success) ");
    Serial.println(rslt);
    Serial.print("Data Sent ");
    Serial.print(radioTxArray[0]);
    Serial.print("  ");
    Serial.println(radioTxArray[1]);
    if ( radio.isAckPayloadAvailable() ) {
      radio.read(radioRxArray, radioRxArrayLen);
      Serial.print("Acknowledge received: ");
      Serial.print(radioRxArray[0]); Serial.print("  ");
      Serial.print(radioRxArray[1]); Serial.print("  ");
      Serial.print(radioRxArray[2]); Serial.print("  ");
      Serial.print(radioRxArray[3]); Serial.print("  ");
      Serial.print(radioRxArray[4]); Serial.print("  ");
      Serial.print(radioRxArray[5]); Serial.print("  isStarted = ");
      Serial.println(isStarted);

    }
    prevMillis = millis();
  }

}

void getSetPoint()//Required rpm from hand controller
{
  if (isStarted == true) {
    Setpoint = radioRxArray[1];
    // Setpoint = 30;
  }
  else
  {
    Setpoint = 0;
    radioTxArray[0] = 0;
  }
}

void getStartStop()// Determine if motor should start on not using on/off and/or height switching from hand controller.
{
  if (radioRxArray[0] == 1) //On/off = on.
  {
    if (radioRxArray[3] == 0)//Height switching = off.
    {
      isStarted = true;
    }
    if (dist <= radioRxArray[5] == 1 && radioRxArray[3] == 1)// dist is less than switch point & Height switching = on.
    {
      isStarted = true;
    }
  }

  else
  {
    isStarted = false;
  }

}

void getHeight() //read ping sensor.
{

  unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
  dist = (uS / US_ROUNDTRIP_CM); //raw distance in cm.



}

void readMotorCurrent()
{

}

void switchOnOff() //activate relay on pin 5 to turn esc on and off.
{
  if (isStarted == true)
  {
    digitalWrite(5, HIGH);

  }
}

void sensorInterrupt() // for tacho.
{
  static int Ctr;
  unsigned long Time;
  Ctr++;
  if (Ctr >= Counts) { // 36 / 4 = 9 so we are taking an average of 9 readings to use in our calculations
    Time = micros();
    timeX += (Time - LastTime); // this time is accumulative ovrer those 9 readings
    LastTime = Time;
    PulseCtr ++;
    Ctr = 0;
  }
}

void readRpm()
{

  cli ();         // clear interrupts flag
  Time = timeX;   // Make a copy so if an interrupt occurs timeX can be altered and not affect the results.
  timeX = 0;
  sei ();         // set interrupts flag
  if (PulseCtr > 0) {
    Input =  (double) (PulsesPerMinute /  (double)(( (unsigned long)Time ) *  (unsigned long)PulseCtr)); // double has more percision
    //   PulseCtr = 0; // set pulse Ctr to zero
    // debug();
    if (!myPID.Compute()); //Serial.println();

    analogWrite(PWMpin, Output);
    //
    Time = 0; // set time to zero to wait for the next rpm trigger.
    Counter += PulseCtr;
    PulseCtr = 0; // set pulse Ctr to zero
    // we are automatically adjusting the diviser to preserve processor time after calculating last rpm
    // starting at 0 RPM ~ 400+RPM we adjust the division of the pulses per revolution

    // Counts = 100; constrain(map((int)Input, startRamp, MaxRPM, 1, PulsesPerRevolution), 1, PulsesPerRevolution);
    PulsesPerMinute = (60.0 * 1000000.0) / (double)((double)PulsesPerRevolution / (double)Counts);
    //Fill rpm array with rpm readings and average them for display.
    rpmArray[0] = rpmArray[1];
    rpmArray[1] = rpmArray[2];
    rpmArray[2] = rpmArray[3];
    rpmArray[3] = rpmArray[4];
    rpmArray[4] = Input;
    //Last 5 Average RPM Counts Eqauls....
    printRpm = (rpmArray[0] + rpmArray[1] + rpmArray[2] + rpmArray[3] + rpmArray[4]) / 5;

    radioTxArray[0] = printRpm;//average sent to hand controller

  }
}

void debug()

{
  
}

Next post.