mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Add 2020 speed controllers (#2188)
Add CTRE TalonFX (PWMTalonFX) Add Playing with Fusion Venom (PWMVenom)
This commit is contained in:
committed by
Peter Johnson
parent
635882a9f7
commit
1ce24a7a2f
45
wpilibc/src/main/native/include/frc/PWMTalonFX.h
Normal file
45
wpilibc/src/main/native/include/frc/PWMTalonFX.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "frc/PWMSpeedController.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* Cross the Road Electronics (CTRE) Talon FX Speed Controller with PWM
|
||||
* control.
|
||||
*
|
||||
* Note that the Talon FX 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 FX User
|
||||
* Manual available from Cross The Road Electronics.
|
||||
*
|
||||
* \li 2.004ms = full "forward"
|
||||
* \li 1.520ms = the "high end" of the deadband range
|
||||
* \li 1.500ms = center of the deadband range (off)
|
||||
* \li 1.480ms = the "low end" of the deadband range
|
||||
* \li 0.997ms = full "reverse"
|
||||
*/
|
||||
class PWMTalonFX : public PWMSpeedController {
|
||||
public:
|
||||
/**
|
||||
* Construct a Talon FX connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon FX is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
*/
|
||||
explicit PWMTalonFX(int channel);
|
||||
|
||||
PWMTalonFX(PWMTalonFX&&) = default;
|
||||
PWMTalonFX& operator=(PWMTalonFX&&) = default;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
43
wpilibc/src/main/native/include/frc/PWMVenom.h
Normal file
43
wpilibc/src/main/native/include/frc/PWMVenom.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "frc/PWMSpeedController.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
/**
|
||||
* Playing with Fusion Venom Smart Motor with PWM control.
|
||||
*
|
||||
* Note that the Venom 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.
|
||||
*
|
||||
* \li 2.004ms = full "forward"
|
||||
* \li 1.520ms = the "high end" of the deadband range
|
||||
* \li 1.500ms = center of the deadband range (off)
|
||||
* \li 1.480ms = the "low end" of the deadband range
|
||||
* \li 0.997ms = full "reverse"
|
||||
*/
|
||||
class PWMVenom : public PWMSpeedController {
|
||||
public:
|
||||
/**
|
||||
* Construct a Venom connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Venom is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
*/
|
||||
explicit PWMVenom(int channel);
|
||||
|
||||
PWMVenom(PWMVenom&&) = default;
|
||||
PWMVenom& operator=(PWMVenom&&) = default;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
Reference in New Issue
Block a user