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.
Fork of CURRENT_CONTROL by
CURRENT_CONTROL.h
- Committer:
- adam_z
- Date:
- 2016-04-22
- Revision:
- 0:955aa05c968a
- Child:
- 1:c5973a56d474
File content as of revision 0:955aa05c968a:
#ifndef __CURRENT_CONTROL_H__
#define __CURRENT_CONTROL_H__
#include "mbed.h"
#include "PID.h"
class CURRENT_CONTROL
{
public:
void CURRENT_CONTROL(PinName curChannel, PinName PwmChannel1, PinName PwmChannel2, float Kp, float Ki, float Kd, float samplingTime);
void ControlCompute(float curRef, float curFeedback);
void ChangePwmPeriod(float microSeconds);
typedef enum {
PWM1;
PWM2;
} PWMIndex;
PID pid;
PwmOut MotorPlus;
PwmOut MotorMinus;
float controlOutput;
float currentOffset;
float currentFeedBack;
private:
float Ts;
AnalogIn currentAnalogIn;
};
#endif
