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 X_NUCLEO_PLC01A1 ros_lib_melodic
ms-94bzb.h
- Committer:
- yamadola
- Date:
- 2020-08-15
- Revision:
- 1:ef4b86795d79
- Parent:
- 0:43eb9ccc1583
- Child:
- 3:ea5cfd721b53
File content as of revision 1:ef4b86795d79:
#ifndef MS94BZB_H
#define MS94BZB_H
#include "motor.h"
#include "can_controller.h"
class MS_94BZB: public Motor{
private:
/* CAN control commands */
static const uint16_t MOTOR_COMMAND = (0x03<<7);
static const uint8_t DRIVE = 1<<0;
static const uint8_t STOP = 0<<0;
static const uint8_t CCW = 0<<1;
static const uint8_t CW = 0<<1;
static const uint8_t SHORT = 0<<7;
static const uint8_t FREE = 1<<7;
static const uint16_t CTL_COMMAND = (0x09<<7);
static const uint8_t PWM_CTL = 0;
static const uint8_t CAN_CTL = 1;
/* Pointer of CAN controller */
CANController *_pCanController;
/* Gear ratio of the MS-94BZB gear head */
const float _gearRatio;
/* Turning speed of brush-less motor (60-3000[rmp]) */
uint16_t _refMotorAngularVelocity;
/* Turning direction (CW:0x02 CCW:0x00) */
uint8_t DIR;
/* Turning acceleration of brush-less motor (100-11,164[rpm/s])*/
uint16_t _accel;
public:
MS_94BZB( uint8_t motorID, CANController *pCanController);
virtual void motorInit();
virtual void drive();
virtual void stop();
virtual void free();
void setAngularVelocity(float avel);
void setAcceleration(uint16_t accel);
};
#endif