示例#1
0
/**
 * Common initialization code called by all constructors.
 *
 * Note that the Victor uses the following bounds for PWM values.  These values were determined
 * empirically and optimized for the Victor 888. These values should work reasonably well for
 * Victor 884 controllers as well but if users experience issues such as asymmetric behavior around
 * the deadband or inability to saturate the controller in either direction, calibration is recommended.
 * The calibration procedure can be found in the Victor 884 User Manual available from IFI.
 *
 *   - 206 = full "forward"
 *   - 131 = the "high end" of the deadband range
 *   - 128 = center of the deadband range (off)
 *   - 125 = the "low end" of the deadband range
 *   - 56 = full "reverse"
 */
void Victor::InitVictor() {
	SetBounds(2.027, 1.525, 1.507, 1.49, 1.026);

	SetPeriodMultiplier(kPeriodMultiplier_2X);
	SetRaw(m_centerPwm);

	LiveWindow::GetInstance()->AddActuator("Victor", GetChannel(), this);
}
示例#2
0
/**
 * Constructor for a SD540
 * @param channel The PWM channel that the SD540 is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
SD540::SD540(uint32_t channel) : SafePWM(channel) {
  SetBounds(2.05, 1.55, 1.50, 1.44, .94);
  SetPeriodMultiplier(kPeriodMultiplier_1X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  HALReport(HALUsageReporting::kResourceType_MindsensorsSD540, GetChannel());
  LiveWindow::GetInstance()->AddActuator("SD540", GetChannel(), this);
}
示例#3
0
/**
 * @param channel The PWM channel to which the servo is attached. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
Servo::Servo(uint32_t channel) : SafePWM(channel) {
  // Set minimum and maximum PWM values supported by the servo
  SetBounds(kDefaultMaxServoPWM, 0.0, 0.0, 0.0, kDefaultMinServoPWM);

  // Assign defaults for period multiplier for the servo PWM control signal
  SetPeriodMultiplier(kPeriodMultiplier_4X);

  //	printf("Done initializing servo %d\n", channel);
}
示例#4
0
/**
 * Common initialization code called by all constructors.
 *
 * Note that the Talon uses the following bounds for PWM values. These values should work reasonably well for
 * most controllers, but if users experience issues such as asymmetric behavior around
 * the deadband or inability to saturate the controller in either direction, calibration is recommended.
 * The calibration procedure can be found in the Talon User Manual available from CTRE.
 * 
 *   - 211 = full "forward"
 *   - 133 = the "high end" of the deadband range
 *   - 129 = center of the deadband range (off)
 *   - 125 = the "low end" of the deadband range
 *   - 49 = full "reverse"
 */
void Talon::InitTalon() {
	// TODO: compute the appropriate values based on digital loop timing
	SetBounds(211, 133, 129, 125, 49);
	SetPeriodMultiplier(kPeriodMultiplier_2X);
	SetRaw(m_centerPwm);

	// TODO: Add Talon to Usage Reporting
	nUsageReporting::report(nUsageReporting::kResourceType_Talon, GetChannel(), GetModuleNumber() - 1);
}
示例#5
0
文件: Victor.cpp 项目: FRC2539/wpilib
/**
 * Common initialization code called by all constructors.
 *
 * Note that the Victor uses the following bounds for PWM values.  These values were determined
 * empirically and optimized for the Victor 888. These values should work reasonably well for
 * Victor 884 controllers as well but if users experience issues such as asymmetric behavior around
 * the deadband or inability to saturate the controller in either direction, calibration is recommended.
 * The calibration procedure can be found in the Victor 884 User Manual available from IFI.
 * 
 *   - 206 = full "forward"
 *   - 131 = the "high end" of the deadband range
 *   - 128 = center of the deadband range (off)
 *   - 125 = the "low end" of the deadband range
 *   - 56 = full "reverse"
 */
void Victor::InitVictor() {
	// TODO: compute the appropriate values based on digital loop timing
	SetBounds(206, 131, 128, 125, 56);
	SetPeriodMultiplier(kPeriodMultiplier_2X);
	SetRaw(m_centerPwm);

	LiveWindow::GetInstance()->AddActuator("Victor", GetModuleNumber(), GetChannel(), this);
	nUsageReporting::report(nUsageReporting::kResourceType_Victor, GetChannel(), GetModuleNumber() - 1);
}
示例#6
0
/**
 * Constructor for a VictorSP
 * @param channel The PWM channel that the VictorSP is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
VictorSP::VictorSP(uint32_t channel) : SafePWM(channel) {
  SetBounds(2.004, 1.52, 1.50, 1.48, .997);
  SetPeriodMultiplier(kPeriodMultiplier_1X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  HALReport(HALUsageReporting::kResourceType_VictorSP, GetChannel());
  LiveWindow::GetInstance()->AddActuator("VictorSP", GetChannel(), this);
}
示例#7
0
/**
 * Common initialization code called by all constructors.
 * 
 * Note that the Victor uses the following bounds for PWM values.  These values were determined
 * empirically through experimentation during the 2008 beta testing of the new control system.
 * Testing during the beta period revealed a significant amount of variation between Victors.
 * The values below are chosen to ensure that teams using the default values should be able to
 * get "full power" with the maximum and minimum values.  For better performance, teams may wish
 * to measure these values on their own Victors and set the bounds to the particular values
 * measured for the actual Victors they were be using. 
 *   - 210 = full "forward"
 *   - 138 = the "high end" of the deadband range
 *   - 132 = center of the deadband range (off)
 *   - 126 = the "low end" of the deadband range
 *   - 56 = full "reverse"
 */
void Victor::InitVictor()
{
	// TODO: compute the appropriate values based on digital loop timing
	SetBounds(210, 138, 132, 126, 56);
	SetPeriodMultiplier(kPeriodMultiplier_2X);
	SetRaw(m_centerPwm);

	nUsageReporting::report(nUsageReporting::kResourceType_Victor, GetChannel(), GetModuleNumber() - 1);
}
示例#8
0
/**
 * Common initialization code called by all constructors.
 *
 * InitServo() assigns defaults for the period multiplier for the servo PWM control signal, as
 * well as the minimum and maximum PWM values supported by the servo.
 */
void Servo::InitServo()
{
	m_table = NULL;
	SetBounds(kDefaultMaxServoPWM, 0.0, 0.0, 0.0, kDefaultMinServoPWM);
	SetPeriodMultiplier(kPeriodMultiplier_4X);

	LiveWindow::GetInstance()->AddActuator("Servo", GetChannel(), this);
	HALReport(HALUsageReporting::kResourceType_Servo, GetChannel());
}
示例#9
0
/**
 * Constructor for a Spark
 * @param channel The PWM channel that the Spark is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
Spark::Spark(uint32_t channel) : PWMSpeedController(channel) {
  SetBounds(2.003, 1.55, 1.50, 1.46, .999);
  SetPeriodMultiplier(kPeriodMultiplier_1X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  HALReport(HALUsageReporting::kResourceType_RevSPARK, GetChannel());
  LiveWindow::GetInstance()->AddActuator("Spark", GetChannel(), this);
}
示例#10
0
/**
 * Common initialization code called by all constructors.
 *
 * Note that the Victor uses the following bounds for PWM values.  These values were determined
 * empirically and optimized for the Victor 888. These values should work reasonably well for
 * Victor 884 controllers as well but if users experience issues such as asymmetric behavior around
 * the deadband or inability to saturate the controller in either direction, calibration is recommended.
 * The calibration procedure can be found in the Victor 884 User Manual available from IFI.
 *
 *   - 206 = full "forward"
 *   - 131 = the "high end" of the deadband range
 *   - 128 = center of the deadband range (off)
 *   - 125 = the "low end" of the deadband range
 *   - 56 = full "reverse"
 */
void Victor::InitVictor() {
    SetBounds(2.027, 1.525, 1.507, 1.49, 1.026);

    SetPeriodMultiplier(kPeriodMultiplier_2X);
    SetRaw(m_centerPwm);

    LiveWindow::GetInstance()->AddActuator("Victor", GetModuleNumber(), GetChannel(), this);
    nUsageReporting::report(nUsageReporting::kResourceType_Victor, GetChannel(), GetModuleNumber() - 1);
}
示例#11
0
/**
 * Common initialization code called by all constructors.
 *
 * Note that the Talon uses the following bounds for PWM values. These values should work reasonably well for
 * most controllers, but if users experience issues such as asymmetric behavior around
 * the deadband or inability to saturate the controller in either direction, calibration is recommended.
 * The calibration procedure can be found in the Talon User Manual available from CTRE.
 *
 *   2.037ms = full "forward"
 *   1.539ms = the "high end" of the deadband range
 *   1.513ms = center of the deadband range (off)
 *   1.487ms = the "low end" of the deadband range
 *   0.989ms = full "reverse"
 */
void Talon::InitTalon() {
	SetBounds(2.037, 1.539, 1.513, 1.487, .989);
	SetPeriodMultiplier(kPeriodMultiplier_1X);
	SetRaw(m_centerPwm);
	SetZeroLatch();

	HALReport(HALUsageReporting::kResourceType_Talon, GetChannel());
	LiveWindow::GetInstance()->AddActuator("Talon", GetChannel(), this);
}
示例#12
0
文件: Servo.cpp 项目: 0xacf/wpilib
/**
 * Common initialization code called by all constructors.
 *
 * InitServo() assigns defaults for the period multiplier for the servo PWM control signal, as
 * well as the minimum and maximum PWM values supported by the servo.
 */
void Servo::InitServo()
{
	m_table = NULL;
	SetBounds(2.27, 1.513, 1.507, 1.5, .743);
	SetPeriodMultiplier(kPeriodMultiplier_4X);


	LiveWindow::GetInstance()->AddActuator("Servo", GetModuleNumber(), GetChannel(), this);
	nUsageReporting::report(nUsageReporting::kResourceType_Servo, GetChannel(), GetModuleNumber() - 1);
}
示例#13
0
/**
 * Common initialization code called by all constructors.
 */
void Jaguar::InitJaguar()
{
	/*
	 * Input profile defined by Luminary Micro.
	 * 
	 * Full reverse ranges from 0.671325ms to 0.6972211ms
	 * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
	 * Neutral ranges from 1.4482078ms to 1.5517922ms
	 * Proportional forward ranges from 1.5517922ms to 2.3027789ms
	 * Full forward ranges from 2.3027789ms to 2.328675ms
	 */
	SetBounds(251, 135, 128, 120, 4);
	SetPeriodMultiplier(kPeriodMultiplier_1X);
	SetRaw(m_centerPwm);
}
示例#14
0
/**
 * @param channel The PWM channel that the Jaguar is attached to.
 */
Jaguar::Jaguar(uint32_t channel) : SafePWM(channel)
{
	/*
	 * Input profile defined by Luminary Micro.
	 *
	 * Full reverse ranges from 0.671325ms to 0.6972211ms
	 * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
	 * Neutral ranges from 1.4482078ms to 1.5517922ms
	 * Proportional forward ranges from 1.5517922ms to 2.3027789ms
	 * Full forward ranges from 2.3027789ms to 2.328675ms
	 */
	SetBounds(2.31, 1.55, 1.507, 1.454, .697);
	SetPeriodMultiplier(kPeriodMultiplier_1X);
	SetRaw(m_centerPwm);

	LiveWindow::GetInstance().AddActuator("Jaguar", GetChannel(), this);
}
示例#15
0
/**
 * Constructor for a Jaguar connected via PWM
 * @param channel The PWM channel that the Jaguar is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
Jaguar::Jaguar(uint32_t channel) : PWMSpeedController(channel) {
  /**
   * Input profile defined by Luminary Micro.
   *
   * Full reverse ranges from 0.671325ms to 0.6972211ms
   * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
   * Neutral ranges from 1.4482078ms to 1.5517922ms
   * Proportional forward ranges from 1.5517922ms to 2.3027789ms
   * Full forward ranges from 2.3027789ms to 2.328675ms
   */
  SetBounds(2.31, 1.55, 1.507, 1.454, .697);
  SetPeriodMultiplier(kPeriodMultiplier_1X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  HALReport(HALUsageReporting::kResourceType_Jaguar, GetChannel());
  LiveWindow::GetInstance()->AddActuator("Jaguar", GetChannel(), this);
}
示例#16
0
文件: Jaguar.cpp 项目: FRC2539/wpilib
/**
 * Common initialization code called by all constructors.
 */
void Jaguar::InitJaguar()
{
	/*
	 * Input profile defined by Luminary Micro.
	 * 
	 * Full reverse ranges from 0.671325ms to 0.6972211ms
	 * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
	 * Neutral ranges from 1.4482078ms to 1.5517922ms
	 * Proportional forward ranges from 1.5517922ms to 2.3027789ms
	 * Full forward ranges from 2.3027789ms to 2.328675ms
	 * TODO: compute the appropriate values based on digital loop timing
	 */
	SetBounds(251, 135, 128, 120, 4);
	SetPeriodMultiplier(kPeriodMultiplier_1X);
	SetRaw(m_centerPwm);

	nUsageReporting::report(nUsageReporting::kResourceType_Jaguar, GetChannel(), GetModuleNumber() - 1);
	LiveWindow::GetInstance()->AddActuator("Jaguar", GetModuleNumber(), GetChannel(), this);
}
示例#17
0
/**
 * Construct a TalonSRX connected via PWM
 * @param channel The PWM channel that the TalonSRX is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
TalonSRX::TalonSRX(uint32_t channel) : SafePWM(channel) {
  /* Note that the TalonSRX uses the following bounds for PWM values. These
   * values should work reasonably well for most controllers, but if users
   * experience issues such as asymmetric behavior around the deadband or
   * inability to saturate the controller in either direction, calibration is
   * recommended. The calibration procedure can be found in the TalonSRX User
   * Manual available from Cross The Road Electronics.
   *   2.004ms = full "forward"
   *   1.52ms = the "high end" of the deadband range
   *   1.50ms = center of the deadband range (off)
   *   1.48ms = the "low end" of the deadband range
   *   0.997ms = full "reverse"
   */
  SetBounds(2.004, 1.52, 1.50, 1.48, .997);
  SetPeriodMultiplier(kPeriodMultiplier_1X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  HALReport(HALUsageReporting::kResourceType_TalonSRX, GetChannel());
  LiveWindow::GetInstance()->AddActuator("TalonSRX", GetChannel(), this);
}
示例#18
0
/**
 * Constructor for a Talon (original or Talon SR)
 * @param channel The PWM channel number that the Talon is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
Talon::Talon(uint32_t channel) : SafePWM(channel) {
  /* Note that the Talon uses the following bounds for PWM values. These values
   * should work reasonably well for most controllers, but if users experience
   * issues such as asymmetric behavior around the deadband or inability to
   * saturate the controller in either direction, calibration is recommended.
   * The calibration procedure can be found in the Talon User Manual available
   * from CTRE.
   *
   *   2.037ms = full "forward"
   *   1.539ms = the "high end" of the deadband range
   *   1.513ms = center of the deadband range (off)
   *   1.487ms = the "low end" of the deadband range
   *   0.989ms = full "reverse"
   */
  SetBounds(2.037, 1.539, 1.513, 1.487, .989);
  SetPeriodMultiplier(kPeriodMultiplier_1X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  HALReport(HALUsageReporting::kResourceType_Talon, GetChannel());
  LiveWindow::GetInstance()->AddActuator("Talon", GetChannel(), this);
}
示例#19
0
/**
 * Constructor for a Victor
 * @param channel The PWM channel number that the Victor is attached to. 0-9 are
 * on-board, 10-19 are on the MXP port
 */
Victor::Victor(uint32_t channel) : SafePWM(channel) {
  /* Note that the Victor uses the following bounds for PWM values.  These
   * values were determined empirically and optimized for the Victor 888. These
   * values should work reasonably well for Victor 884 controllers as well but
   * if users experience issues such as asymmetric behaviour around the deadband
   * or inability to saturate the controller in either direction, calibration is
   * recommended. The calibration procedure can be found in the Victor 884 User
   * Manual available from IFI.
   *
   *   2.027ms = full "forward"
   *   1.525ms = the "high end" of the deadband range
   *   1.507ms = center of the deadband range (off)
   *   1.49ms = the "low end" of the deadband range
   *   1.026ms = full "reverse"
   */
  SetBounds(2.027, 1.525, 1.507, 1.49, 1.026);
  SetPeriodMultiplier(kPeriodMultiplier_2X);
  SetRaw(m_centerPwm);
  SetZeroLatch();

  LiveWindow::GetInstance()->AddActuator("Victor", GetChannel(), this);
  HALReport(HALUsageReporting::kResourceType_Victor, GetChannel());
}
示例#20
0
/**
 * Common initialization code called by all constructors.
 *
 * InitServo() assigns defaults for the period multiplier for the servo PWM control signal, as
 * well as the minimum and maximum PWM values supported by the servo.
 */
void Servo::InitServo()
{
	SetBounds(245, 0, 0, 0, 11);
	SetPeriodMultiplier(kPeriodMultiplier_4X);
}
/**
 * Common initialization code called by all constructors.
 * 
 * Note that the Victor uses the following bounds for PWM values.  These values were determined
 * empirically through experimentation during the 2008 beta testing of the new control system.
 * Testing during the beta period revealed a significant amount of variation between Victors.
 * The values below are chosen to ensure that teams using the default values should be able to
 * get "full power" with the maximum and minimum values.  For better performance, teams may wish
 * to measure these values on their own Victors and set the bounds to the particular values
 * measured for the actual Victors they were be using. 
 *   - 210 = full "forward"
 *   - 138 = the "high end" of the deadband range
 *   - 132 = center of the deadband range (off)
 *   - 126 = the "low end" of the deadband range
 *   - 56 = full "reverse"
 */
void Victor::InitVictor()
{
	SetBounds(210, 138, 132, 126, 56);
	SetPeriodMultiplier(kPeriodMultiplier_2X);
	SetRaw(m_centerPwm);
}