remove simple_foc commander and monitor
This commit is contained in:
parent
f1d922bd34
commit
d1e918371c
4 changed files with 11 additions and 22 deletions
|
@ -1,17 +1,9 @@
|
|||
#include "config.h"
|
||||
|
||||
|
||||
void doMotor(char *cmd) {
|
||||
command.motor(&motor, cmd);
|
||||
digitalWrite(PC10, !digitalRead(PC10));
|
||||
delayMicroseconds(2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void setup_foc(MagneticSensorAS5045 *encoder, BLDCMotor *motor,
|
||||
DRV8313Driver *driver, LowsideCurrentSense *current_sense,
|
||||
Commander *commander, CommandCallback callback,FLASH_RECORD* pid_data) {
|
||||
FLASH_RECORD* pid_data) {
|
||||
encoder->init(&spi);
|
||||
|
||||
/* convert data from flash int value to float*/
|
||||
|
@ -38,8 +30,6 @@ void setup_foc(MagneticSensorAS5045 *encoder, BLDCMotor *motor,
|
|||
motor->linkSensor(encoder);
|
||||
motor->linkDriver(driver);
|
||||
motor->linkCurrentSense(current_sense);
|
||||
motor->useMonitoring(Serial);
|
||||
motor->monitor_downsample = 5000; // Default monitoring interval
|
||||
motor->controller = MotionControlType::angle;
|
||||
motor->torque_controller = TorqueControlType::voltage;
|
||||
motor->foc_modulation = FOCModulationType::SpaceVectorPWM;
|
||||
|
@ -66,7 +56,7 @@ void setup_foc(MagneticSensorAS5045 *encoder, BLDCMotor *motor,
|
|||
}
|
||||
|
||||
|
||||
void foc_step(BLDCMotor *motor, Commander *commander) {
|
||||
void foc_step(BLDCMotor *motor) {
|
||||
if (motor_control_inputs.target_velocity != 0 ||
|
||||
motor->controller == MotionControlType::velocity) {
|
||||
if (motor->controller != MotionControlType::velocity) {
|
||||
|
@ -82,6 +72,4 @@ void foc_step(BLDCMotor *motor, Commander *commander) {
|
|||
|
||||
motor->loopFOC();
|
||||
motor->move();
|
||||
motor->monitor();
|
||||
commander->run();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue