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
Revision 10:9f5f4a22346c, committed 2016-12-21
- Comitter:
- benson516
- Date:
- Wed Dec 21 18:45:23 2016 +0000
- Parent:
- 9:d8157fbfcd2a
- Child:
- 11:31cd02611cd0
- Commit message:
- Closed-loop control for motor current reached the bandwidth beyond 50Hz
Changed in this revision
| CURRENT_CONTROL.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/CURRENT_CONTROL.cpp Wed Dec 21 17:39:56 2016 +0000
+++ b/CURRENT_CONTROL.cpp Wed Dec 21 18:45:23 2016 +0000
@@ -205,8 +205,9 @@
}
//////////////////////////////// end Speed_IterateOnce
+
// Control
-////////////////////////////////
+///////////////////////////////////////////////////////////
void CURRENT_CONTROL::Control(float curRef)
{
// Init check
@@ -226,7 +227,8 @@
pid.Compute_noWindUP(curRef, curFeedBack_filter);
// Voltage output with back-emf compensation
- voltage_out = -pid.output + func_back_emf(angularSpeed);
+ voltage_out = pid.output + func_back_emf(angularSpeed);
+ // voltage_out = 0.0 + func_back_emf(angularSpeed);
// Output saturation and unit changing
SetVoltage(voltage_out);
@@ -241,7 +243,9 @@
// Reset flag
Flag_SpeedCal_Iterated = false;
}
-//////////////////////////////// end Control
+/////////////////////////////////////////////////////////// end Control
+
+
// Back emf as the function of rotational speed
float CURRENT_CONTROL::func_back_emf(const float &W_in){
return (Ke*W_in);
