|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <Arduino.h>#include <ESP32Encoder.h>#include <cstdio>#include <cstring>#include "EthernetHandler.h"Go to the source code of this file.
Functions | |
| void | motorCoast () |
| void | motorDrive (float u) |
| void | autoPolarityCal () |
| void | setup () |
| void | loop () |
Variables | |
| ESP32Encoder | enc |
| const int | ENA = 25 |
| const int | IN1 = 23 |
| const int | IN2 = 5 |
| const int | ENCA = 19 |
| const int | ENCB = 21 |
| float | Kp = 0.0015f |
| const int | CPR_4X_MOTOR |
| const float | GEAR_RATIO = 210.0f |
| const float | CPR_OUT = CPR_4X_MOTOR * GEAR_RATIO |
| const int | PWM_CH = 0 |
| const int | PWM_FREQ = 8000 |
| const int | PWM_BITS = 8 |
| const int | PWM_MAX = (1 << PWM_BITS) - 1 |
| const int | PWM_MIN = 45 |
| volatile int | dir_sign = +1 |
| long | target = 1000 |
| uint32_t | toggle_t0 = 0 |
| uint32_t | print_t0 = 0 |
| void autoPolarityCal | ( | ) |
| void loop | ( | ) |
| void motorCoast | ( | ) |
Definition at line 42 of file main.cpp.
References digitalWrite(), IN1, IN2, LOW, and PWM_CH.
Referenced by autoPolarityCal(), motorDrive(), and setup().
| void motorDrive | ( | float | u | ) |
| void setup | ( | void | ) |
Definition at line 96 of file main.cpp.
References autoPolarityCal(), delay(), EthernetConfig::dns, ENA, enc, ENCA, ENCB, EthernetInit(), EthernetConfig::gateway, getLocalIP(), IN1, IN2, IPAddress, EthernetConfig::localPort, motorCoast(), OUTPUT, pinMode(), EthernetConfig::pins, PWM_BITS, PWM_CH, PWM_FREQ, EthernetConfig::receiverIP, EthernetConfig::receiverPort, Serial, EthernetConfig::staticIP, and EthernetConfig::subnet.
| const float CPR_OUT = CPR_4X_MOTOR * GEAR_RATIO |
| volatile int dir_sign = +1 |
Definition at line 37 of file main.cpp.
Referenced by autoPolarityCal(), and loop().
| ESP32Encoder enc |
Definition at line 11 of file main.cpp.
Referenced by autoPolarityCal(), loop(), and setup().
| const int IN1 = 23 |
Definition at line 15 of file main.cpp.
Referenced by autoPolarityCal(), motorCoast(), motorDrive(), and setup().
| const int IN2 = 5 |
Definition at line 16 of file main.cpp.
Referenced by autoPolarityCal(), motorCoast(), motorDrive(), and setup().
| const int PWM_CH = 0 |
Definition at line 30 of file main.cpp.
Referenced by autoPolarityCal(), loop(), motorCoast(), motorDrive(), and setup().
| const int PWM_MAX = (1 << PWM_BITS) - 1 |
Definition at line 33 of file main.cpp.
Referenced by motorDrive().
| const int PWM_MIN = 45 |
Definition at line 34 of file main.cpp.
Referenced by motorDrive().
| long target = 1000 |
Definition at line 38 of file main.cpp.
Referenced by arm_frame(), attemptEntry(), sequencer::anonymous_namespace{ScriptRunner.cpp}::Interp::exec(), fsw::config::anonymous_namespace{Config.cpp}::from_table(), detail::int_to_string(), loop(), main(), main(), sequencer::SequencerService::makeScriptEnv(), radio_link::ArmGate::on_frame(), detail::dtoa_impl::reinterpret_bits(), fsw::control::resolvePWMTargets(), and fsw::control::ControllerService::sendPWMCommand().