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: motor_relay
Dependents: dog_V3_3_testmotor
motion_control.h
- Committer:
- soulx
- Date:
- 2015-07-17
- Revision:
- 0:77ab14788110
- Child:
- 1:5b313fd2ca6f
File content as of revision 0:77ab14788110:
#ifndef MBED_MOTOR_RE_H #define MBED_MOTOR_RE_H #include "mbed.h" #include "motor_relay.h" class MOTION_CONTROL { public: MOTION_CONTROL(PinName dirA, PinName dirB, PinName limitUp, PinName limitDown, PinName vr ); int8_t limit_motor(uint8_t dirction); int8_t position_control(uint16_t current, uint16_t target); void calibration(); int8_t GetLimitUp(); int8_t GetLimitDown(); void SetMargin(int16_t data); private: MOTOR_RELAY *motor; DigitalIn _limit_up; DigitalIn _limit_down; AnalogIn _position; int16_t error; int16_t MARGIN; int16_t MAX_POSITION; int16_t MIN_POSITION; float Kp; float Ki; float Kd; float margin_pid; }; #endif