Basic Mid-Level control for the rebuilt MorphGI control unit, using PWM to communicate with the low level controllers.

Dependencies:   ros_lib_kinetic

MLSettings.h

Committer:
dofydoink
Date:
2021-06-24
Revision:
42:5a5ad23a4bb1
Parent:
41:0e3898b29230

File content as of revision 42:5a5ad23a4bb1:

// MLSettings.h

#ifndef MLSETTINGS_H
#define MLSETTINGS_H

// GENERAL SETTINGS
const unsigned short int N_CHANNELS = 3; // Number of channels to control
// 1-3: front segment; 4-6: rear segment; 7-8: mid segment
const int BAUD_RATE = 115200; //9600; //115200
const float PI = 3.14159265359;

// HL COMMUNICATION SETTINGS
const bool IS_DHCP = false;
const unsigned short int HL_COMMS_FREQ_HZ = 200; // Frequency at which communications can happen with HL, if messages are waiting

// REAL TIME FREQUENCIES
const short int SENSOR_FEEDBACK_HZ = 5; // Frequency at which sensor messages are queued / published to HL
const float LL_DEMANDS_FREQ_HZ = 5;
const unsigned int LOW_LEVEL_SPI_FREQUENCY = 1000000;
const double HHC_READ_FREQ_HZ = 50;

const float MAX_PRESSURE_LIMIT = 12.0;

// PATH GENERATION SETTINGS
const float MAX_ACTUATOR_LIMIT_MM = 40.0;
const float MAX_ACTUATOR_LENGTH_MM = 52.2;
const float MAX_SPEED_MMPS = 24.3457;
const float MAX_DRIVE_SEGMENT_POSITION = 8.0;//the maximum pressure attainable by LL
const double MAX_EXTENSION_PRESSURE = 6.0; //the desired maximum operating pressure.
const double MAX_DRIVE_SEGMENT_SPEED = 4.0;
const double SAFE_CONTRACT_SPEED = 2.0;
const double MAX_STEER_SPEED_RADpS = 1.3; //1.212 rad/s was calculated
const double SAFE_SPEED_MMpS = 8.0;
const double ANCHOR_POSITION = 25.0;
const double HOME_DRIVE_POSITION = 0.0;

// KINEMATIC LIMTS & CONSTANTS
const float MAX_THETA_RAD = 3.665191429; //210 degrees
const float ACTUATOR_OFFSET = 6.0; //mm
const double ACT_CONV = 6.055836122; // mm/mL convert injected volume in [mL] to actuator distance in [mm]

#endif