Brick
Loading...
Searching...
No Matches
linear_motor_ff.h
Go to the documentation of this file.
1/**
2 * @file linear_motor_ff.h
3 * @brief A control loop that uses static friction, velocity, and acceleration to get an output
4 * voltage
5 *
6 * This determines the output voltage for a linear motor to reach a specific reference state given
7 * static friction, motor acceleration, and motor velocity
8 */
9
10#pragma once
11
12#include <math.h>
13
15#include "core/math/units.h"
16
18 units::Acceleration accel;
19 units::Velocity vel;
20};
21
22class LinearMotorFF : public FeedForward<FFMotorState, units::Voltage> {
23 public:
24 void reset() override;
25 /**
26 * @brief Linear Motor FeedForward object contructor
27 *
28 * @param kS the voltage needed to overcome the motors static friction
29 * @param kV the volatage needed for the motor to cruise at a constant velocity
30 * @param kA the voltage needed to induce a given acceleration to the motor
31 */
32 LinearMotorFF(const units::Voltage& kS, const units::LinearVelocityFeedforward& kV,
33 const units::LinearAccelerationFeedforward& kA);
34
35 /**
36 * @brief updates the linear motor feedforward output
37 *
38 * @param reference the reference state for the motor
39 */
40 units::Voltage calculate(const FFMotorState& reference) override;
41
42 units::Voltage kS_;
43 units::LinearVelocityFeedforward kV_;
44 units::LinearAccelerationFeedforward kA_;
45};
pure virtual class for generic feedforward control systems.
Definition feedforward.h:19
void reset() override
Resets the internal state of the control system.
LinearMotorFF(const units::Voltage &kS, const units::LinearVelocityFeedforward &kV, const units::LinearAccelerationFeedforward &kA)
Linear Motor FeedForward object contructor.
units::Voltage calculate(const FFMotorState &reference) override
updates the linear motor feedforward output
A pure virual class to function as an interface for all feedforward control systems.
Definition linear_motor_ff.h:17