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: LSM9DS1 RangeFinder FastPWM
Dependents: PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board ... more
Diff: SpeedController.h
- Revision:
- 6:41dd03654c44
- Parent:
- 5:6cd242a61e4c
- Child:
- 10:fe74e8909d3f
--- a/SpeedController.h Tue Apr 06 12:19:29 2021 +0000
+++ b/SpeedController.h Wed Apr 07 12:13:45 2021 +0000
@@ -11,7 +11,8 @@
{
public:
- SpeedController(float COUNTS_PER_TURN, float KN, float KP, float MAX_VOLTAGE, FastPWM& pwm, EncoderCounter& encoderCounter);
+ SpeedController(float counts_per_turn, float kn, float max_voltage, FastPWM& pwm, EncoderCounter& encoderCounter);
+ SpeedController(float counts_per_turn, float kn, float kp, float max_voltage, FastPWM& pwm, EncoderCounter& encoderCounter);
virtual ~SpeedController();
@@ -22,19 +23,15 @@
private:
- static const float PERIOD;
- // static const float COUNTS_PER_TURN;
+ static const float TS;
static const float LOWPASS_FILTER_FREQUENCY;
- // static const float KN;
- // static const float KP;
- // static const float MAX_VOLTAGE;
static const float MIN_DUTY_CYCLE;
static const float MAX_DUTY_CYCLE;
- float COUNTS_PER_TURN;
- float KN;
- float KP;
- float MAX_VOLTAGE;
+ float counts_per_turn;
+ float kn;
+ float kp;
+ float max_voltage;
FastPWM& pwm;
EncoderCounter& encoderCounter;
@@ -48,8 +45,8 @@
Thread thread;
Ticker ticker;
+ void run();
void sendThreadFlag();
- void run();
};
#endif /* SpeedController_H_ */
\ No newline at end of file
