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
Diff: motion_control.h
- Revision:
- 5:91d905f8bef7
- Parent:
- 4:6509fec6a6fb
- Child:
- 6:41d7cf11fdb1
--- a/motion_control.h Sat Jul 18 05:52:56 2015 +0000 +++ b/motion_control.h Sun Jul 19 17:38:21 2015 +0000 @@ -12,45 +12,46 @@ int limit_motor(uint8_t dirction); int8_t position_control(uint16_t target); void calibration(); - + int GetLimitUp(); int GetLimitDown(); - + void SetMargin(int16_t data); int16_t GetMargin(); - + uint16_t GetMaxPosition(); uint16_t GetMinPosition(); - + void SetMaxPosition(uint16_t value); + void SetMinPosition(uint16_t value); uint16_t GetAnalog(); uint16_t GetPosition(); - + void stop(); private: uint16_t Scale(uint16_t data); - + MOTOR_RELAY motor; DigitalIn _limit_up; DigitalIn _limit_down; AnalogIn _position; - + int16_t error; int16_t MARGIN; - + uint16_t MAX_POSITION; uint16_t MIN_POSITION; - + const static uint16_t scale = 64; - - - float Kp; - float Ki; - float Kd; - float margin_pid; + const static uint16_t LOOP = 100; + + //float Kp; + //float Ki; + //float Kd; + //float margin_pid; };