Anti-Sway Capstone 1.0
|
Sensor/Actuator (Input/Output) Interfacing Library Header. More...
#include <stdbool.h>
#include "TimerIRQ.h"
Go to the source code of this file.
Data Structures | |
struct | Angles |
A 2D Angle. More... | |
struct | Positions |
A 2D Position. More... | |
struct | Velocities |
A 2D Velocity. More... | |
Macros | |
#define | MOTOR_V_LIM_H 10.000 |
Motor Voltage High Limit (V) | |
#define | MOTOR_V_LIM_L -10.000 |
Motor Voltage Low Limit (V) | |
#define | R 0.0062 |
Pulley Radius (m) | |
#define | K_a 0.41 |
Current Constant (A/V) | |
#define | K_m 0.11 |
Motor Constant (Nm/A) | |
#define | FORCE_TO_VOLTAGE(force) (force) * R / (K_a * K_m) |
Force to Voltage Conversion. | |
#define | VOLTAGE_TO_FORCE(voltage) (voltage) * (K_a * K_m) / R |
Voltage to Force Conversion. | |
Typedefs | |
typedef float | Angle |
Alias for an Angle. | |
typedef float | Position |
Alias for a Position. | |
typedef float | Velocity |
Alias for Velocity. | |
typedef float | Voltage |
Alias for Voltage. | |
Functions | |
int | IOSetup () |
int | IOShutdown () |
void | Reset () |
int | GetReferenceVelocityCommand (Velocities *result) |
int | GetReferenceAngleCommand (Angles *result) |
int | GetAngle (Angles *result) |
int | GetTrolleyPosition (Positions *result) |
int | GetTrolleyVelocity (Velocities *result) |
int | GetUserPosition (Angles *angle, Positions *pos, Positions *result) |
int | GetUserVelocity (Angles *angle, Velocities *vel, Velocities *result) |
int | SetXVoltage (Voltage voltage) |
int | SetYVoltage (Voltage voltage) |
bool | PressedDelete () |
int | KeyboardControlFork () |
int | KeyboardControlJoin () |
Variables | |
MyRio_IrqTimer | timer |
The Timer. | |
Sensor/Actuator (Input/Output) Interfacing Library Header.
Force to Voltage Conversion.
force | An int/float/double expression, which represents the force to transmit (through the motor) |
Voltage to Force Conversion.
voltage | An int/float/double expression, which represents the voltage to transmit (through the motor) |
int GetAngle | ( | Angles * | result | ) |
Obtains the angle of the harness
result | A return parameter, which will become the angle along both directions |
int GetReferenceAngleCommand | ( | Angles * | result | ) |
Obtains the user command (for tracking)
result | A return parameter, which will become the desired angle requested by the user |
int GetReferenceVelocityCommand | ( | Velocities * | result | ) |
Obtains the user command (for anti-sway)
result | A return parameter, which will become the change in position requested by the user |
Setup discrete velocity commands, -1, 0, and 1
int GetTrolleyPosition | ( | Positions * | result | ) |
Obtains the Trolley Position
result | A return parameter, which will become the position of the trolley |
int GetTrolleyVelocity | ( | Velocities * | result | ) |
Obtains the Trolley Velocity
result | A return parameter, which will become the velocity of the trolley |
Obtains the User Position
angle | The rope angle |
pos | The trolley position |
result | A return parameter, which will become the position of the user |
int GetUserVelocity | ( | Angles * | angle, |
Velocities * | vel, | ||
Velocities * | result ) |
Obtains the User Velocity
angle | The rope angle |
vel | The trolley velocity |
result | A return parameter, which will become the velocity of the user |
int IOSetup | ( | ) |
Sets up the System-Sensor/Actuator Interface
Setup Timer
Setup Encoders Channels
Setup Potentiometer Voltage Channels (are swapped)
Setup Motor Channels
Setup Keyboard Channels & Resources
Setup Reset flag
Calibration Message
Set Reference Positions
Setup the holding
Calibrate voltage intercepts for potentiometer
int IOShutdown | ( | ) |
Shutsdown the System-Sensor/Actuator Interface
Dissasociate with Encoders
Dissasociate with Potentiometers
Disassociate with Motor
Destroy Keyboard Lock
int KeyboardControlFork | ( | ) |
Enables Keyboard Control for Anti-Sway (concurrently)
Begin Keyboard Thread
int KeyboardControlJoin | ( | ) |
Stops Keyboard Control for Anti-Sway (concurrent process)
Destroy Keymap Thread
bool PressedDelete | ( | ) |
Detects if the DEL key is pressed on the keyboard
void Reset | ( | ) |
Resets GetTrolleyPosition and GetTrolleyVelocity by setting the velocity to zero
int SetXVoltage | ( | Voltage | voltage | ) |
Sets the voltage of the X motor
int SetYVoltage | ( | Voltage | voltage | ) |
Sets the voltage of the Y motor
|
extern |
The Timer.
The Timer.