Ejemplo n.º 1
0
void PIDArmControl()
{

    if((vexRT[Btn6D] - vexRT[Btn6U])!= 0)
    {  
      setArmSpeed((vexRT[Btn5D] - vexRT[Btn5U]) * maxArm);
      disable(PID);  
    }  
    else
    {  
      setArmSpeed(calcPID(PID));  
    }    
    if(vexRT[Btn7U] == 1)
    {  
      setSetpoint(PID, highScore);
      enable(PID);  
    }  
    else if (vexRT[Btn7D] == 1)
    {  
      setSetpoint(PID, lowScore);
      enable(PID);  
    }  
    else if (vexRT[Btn7L] == 1)
    {  
      setSetpoint(PID, midScore);
      enable(PID);
    }  
    else if (vexRT[Btn7R] == 1)
    {  
      disable(PID);  
    }
}
Ejemplo n.º 2
0
CHYSTBlock::CHYSTBlock(const char* configString)
    : CBlock(configString)
{
    CString tempString;
    float setpoint=0.0, delta=0.0, Min=0.0, Max=0.0;
    //Get HYST type and parameters
    m_LibIniReader.GetConfigParamString( configString, "TYPE", &tempString, "HYST");
    
    for (int i = 0; i < HYST_TYPE_NUM_TOT; i++)
    {
        if (tempString == HYST_Type_Strings[i])
        {
            m_HYSTType = (e_HYSTType)i;
	    m_LibIniReader.GetConfigParamFloat( configString, "SETPOINT", &setpoint, 0.0);
            m_LibIniReader.GetConfigParamFloat( configString, "DELTA", &delta, 0.0);
	    m_LibIniReader.GetConfigParamFloat( configString, "MIN", &Min, 0.0);
            m_LibIniReader.GetConfigParamFloat( configString, "MAX", &Max, 0.0);
	    setSetpoint(&setpoint);
            setDelta(&delta);
	    setLastOutput(&Min);
		
	    setMin(&Min);
	    setMax(&Max);
	}
    }
}
void AM3DCoordinatedSystemControl::updateSetpoint()
{
	if(globalXAxis_ && globalYAxis_ && globalZAxis_) {
		QVector3D globalSetpoints(globalXAxis_->setpoint(), globalYAxis_->setpoint(), globalZAxis_->setpoint());
		QVector3D primeSetpoints = globalAxisToPrime(globalSetpoints);

		double newSetpoint = designatedAxisValue(primeSetpoints);

		setSetpoint(newSetpoint);
	}
}
Ejemplo n.º 4
0
void pre_auton()

{
    startpoint = SensorValue[pot];
  goal_value = startpoint + change;
  //PID:
  init(test);

  setPIDs(test, k_P, k_I, k_D);
  setSetpoint(test, goal_value);
  enable(test);
}
Ejemplo n.º 5
0
void Manager::setSetpoint(uint8_t devid, int16_t setpoint) {
    // Lookup device
    auto dev = m_registry->getDevice(devid);
    if (dev == nullptr) return;

    // Get group and offset for device
    auto group = m_registry->getGroup(dev->getGroup());
    if (group == nullptr) return;
    auto offset = dev->getOffset();

    // Write new setpoint
    group->setSetpoint(offset, setpoint);
}
AMBeamlineFiducializationMoveAction::AMBeamlineFiducializationMoveAction(int fiducializationIndex, QObject *parent) :
		AMBeamlineControlSetMoveAction(AMBeamline::bl()->currentSamplePositioner(), parent)
{
	fiducializationIndex_ = fiducializationIndex;
	sampleDescription_ = "";
	if(fiducializationIndex_ < AMBeamline::bl()->currentFiducializations().count()){
		//Change 0-indexed source list to 1-indexed human-readable format
		sampleDescription_ = QString("Spot #%1").arg(fiducializationIndex_+1);
		setDescription(QString("Move to sample spot #%1").arg(fiducializationIndex_+1));
		setSetpoint(AMBeamline::bl()->currentFiducializations().at(fiducializationIndex_));
	}
	else{
		setDescription(QString("Error"));
		AMErrorMon::report(AMErrorReport(this,
				AMErrorReport::Alert,
				AMBEAMLINEACTIONITEM_INVALID_FIDUCIALIZATION_INDEX,
				"Error, fiducialization index is invalid. Please report this bug to the Acquaman developers."));
	}
}
Ejemplo n.º 7
0
int highScore = armGround// + value still to be tested; 


/////////////////////////////////////////////////////////////////////////////////////////
//
//                          Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////

void pre_auton()
{
    encoderConfigure(4,2,90,127,(14.375/12.0),(4.0/12.0));
    init(PID,potArm,port4);
    setSetpoint(PID, highScore);
    setPIDs(PID, KP, KI, KD);
    enable(PID);
}