Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed HX711 MotorModuleExample_copy
MotorModule/MotorModule.h
- Committer:
- kfmurph2
- Date:
- 2019-12-09
- Revision:
- 5:a2e3d0213315
- Parent:
- 3:f0d054d896f9
File content as of revision 5:a2e3d0213315:
#ifndef CAN_COM_H #define CAN_COM_H #include "mbed.h" #include "../math_ops.h" /// Value Limits /// #define P_MIN -95.5f // Radians #define P_MAX 95.5f #define V_MIN -45.0f // Rad/s #define V_MAX 45.0f #define KP_MIN 0.0f // N-m/rad #define KP_MAX 500.0f #define KD_MIN 0.0f // N-m/rad/s #define KD_MAX 5.0f #define I_MIN -18.0f #define I_MAX 18.0f /// Structs for organizing commands and data /// typedef struct { int id; float position, velocity, current; } StateStruct; typedef struct { int id; float i_ff, p_des, kp, v_des, kd; }ControlStruct; typedef struct { StateStruct state; ControlStruct control; CANMessage rxMsg; CANMessage txMsg; }MotorStruct; void pack_cmd(MotorStruct * motor); void unpack_reply(MotorStruct * motor); void enable_motor(MotorStruct * motor, CAN * can); void disable_motor(MotorStruct * motor, CAN * can); void zero_motor(MotorStruct * motor, CAN * can); #endif