Tetrapod Project
make_can_msg.h
Go to the documentation of this file.
1 #ifndef make_can_msg_h
2 #define make_can_msg_h
3 
4 #include "Arduino.h"
5 #include "motor_constants.h"
6 #include "utilities.h"
7 
12 namespace make_can_msg
13 {
17  void readPIDParameters(unsigned char* _can_message);
18 
28  void writePIDParametersToRAM(unsigned char* _can_message,
29  unsigned char _k_p_position,
30  unsigned char _k_i_position,
31  unsigned char _k_p_speed,
32  unsigned char _k_i_speed,
33  unsigned char _k_p_torque,
34  unsigned char _k_i_torque);
35 
46  void writePIDParametersToROM(unsigned char* _can_message,
47  unsigned char _k_p_position,
48  unsigned char _k_i_position,
49  unsigned char _k_p_speed,
50  unsigned char _k_i_speed,
51  unsigned char _k_p_torque,
52  unsigned char _k_i_torque);
53 
57  void readAcceleration(unsigned char* _can_message);
58 
62  void writeAccelerationToRAM(unsigned char* _can_message, int32_t _acceleration);
63 
67  void readEncoderPosition(unsigned char* _can_message);
68 
73  void writeEncoderPositionOffset(unsigned char* _can_message, uint16_t _encoder_offset);
74 
78  void writeCurrentPositionToROM(unsigned char* _can_message);
79 
83  void readMultiTurnAngle(unsigned char* _can_message);
84 
89  void readCircleTurnAngle(unsigned char* _can_message);
90 
94  void motorOff(unsigned char* _can_message);
95 
99  void motorStop(unsigned char* _can_message);
100 
104  void motorRunning(unsigned char* _can_message);
105 
109  void readMotorStatus1AndErrorFlag(unsigned char* _can_message);
110 
114  void clearMotorErrorFlag(unsigned char* _can_message);
115 
119  void readMotorStatus2(unsigned char* _can_message);
120 
124  void readMotorStatus3(unsigned char* _can_message);
125 
130  void torqueCurrentControl(unsigned char* _can_message, int16_t _torque_current);
131 
136  void speedControl(unsigned char* _can_message, int32_t speed);
137 
143  void positionControl1(unsigned char* _can_message, int32_t _multiturn_angle);
144 
152  void positionControl2(unsigned char* _can_message, int32_t _multiturn_angle, uint16_t _max_speed);
153 
161  void positionControl3(unsigned char* _can_message, uint16_t _singleturn_angle, uint8_t _spin_direction);
162 
171  void positionControl4(unsigned char* _can_message, uint16_t _single_turn_angle, uint8_t _spin_direction, uint16_t max_speed);
172 }
173 
174 #endif
The functions within this namespace converts the incomming 8-byte arrays to CAN data messages for RMD...
Definition: make_can_msg.h:13
void readMotorStatus1AndErrorFlag(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
void motorStop(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to stop its controller ...
void positionControl3(unsigned char *_can_message, uint16_t _singleturn_angle, uint8_t _spin_direction)
The function creates a CAN data message that can be used to set the motor's single turn position with...
void readAcceleration(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
void readMotorStatus2(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
void torqueCurrentControl(unsigned char *_can_message, int16_t _torque_current)
The function creates a CAN data message that can be used to set the motor's torque current....
void speedControl(unsigned char *_can_message, int32_t speed)
The function creates a CAN data message that can be used to set the motor's speed....
void writeAccelerationToRAM(unsigned char *_can_message, int32_t _acceleration)
The function creates a CAN data message that can be used to set the acceleration of the motor.
void positionControl1(unsigned char *_can_message, int32_t _multiturn_angle)
The function creates a CAN data message that can be used to set the motor's multi turn position....
void motorRunning(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to resume its control o...
void readCircleTurnAngle(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
void positionControl4(unsigned char *_can_message, uint16_t _single_turn_angle, uint8_t _spin_direction, uint16_t max_speed)
The function creates a CAN data message that can be used to set the motor's single turn position with...
void motorOff(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to turn off its control...
void clearMotorErrorFlag(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to clear its error stat...
void readMultiTurnAngle(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
void readPIDParameters(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
Definition: make_can_msg.cpp:3
void writePIDParametersToROM(unsigned char *_can_message, unsigned char _k_p_position, unsigned char _k_i_position, unsigned char _k_p_speed, unsigned char _k_i_speed, unsigned char _k_p_torque, unsigned char _k_i_torque)
The function creates a CAN data message that can be used to set the PI parameters of the motor....
void readEncoderPosition(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...
void writePIDParametersToRAM(unsigned char *_can_message, unsigned char _k_p_position, unsigned char _k_i_position, unsigned char _k_p_speed, unsigned char _k_i_speed, unsigned char _k_p_torque, unsigned char _k_i_torque)
The function creates a CAN data message that can be used to set the PI parameters of the motor in RAM...
Definition: make_can_msg.cpp:9
void writeCurrentPositionToROM(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to set the current posi...
void writeEncoderPositionOffset(unsigned char *_can_message, uint16_t _encoder_offset)
The function creates a CAN data message that can be used to request the motor to set the encoder posi...
void positionControl2(unsigned char *_can_message, int32_t _multiturn_angle, uint16_t _max_speed)
The function creates a CAN data message that can be used to set the motor's multi turn position with ...
void readMotorStatus3(unsigned char *_can_message)
The function creates a CAN data message that can be used to request the motor to send back a CAN mess...