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.
Revision 205:5cfe6d7e08a3, committed 2018-02-12
- Comitter:
- bwang
- Date:
- Mon Feb 12 04:22:13 2018 +0000
- Parent:
- 204:74714d52a936
- Child:
- 206:5c848ea69028
- Commit message:
- 02/11/2018 21:21 - cmd_exit() checks that motor is not running
Changed in this revision
--- a/CHANGELOG.txt Mon Feb 12 04:12:07 2018 +0000 +++ b/CHANGELOG.txt Mon Feb 12 04:22:13 2018 +0000 @@ -45,4 +45,5 @@ 02/11/2018 02:54 - long commands can no longer be executed while control.enabled == true, invalid BREMS_src now sets control.user_cmd to 0 02/11/2018 03:16 - blocked switching modes when motor is running 02/11/2018 20:13 - scrambled the mode and error handling code in commutate() to be cleaner -02/11/2018 21:11 - further improvements to mode handling, output overrides and output disabling now live in their own functions \ No newline at end of file +02/11/2018 21:11 - further improvements to mode handling, output overrides and output disabling now live in their own functions +02/11/2018 21:21 - cmd_exit() checks that motor is not running \ No newline at end of file
--- a/CommandProcessor/cmd_mode.cpp Mon Feb 12 04:12:07 2018 +0000
+++ b/CommandProcessor/cmd_mode.cpp Mon Feb 12 04:22:13 2018 +0000
@@ -56,6 +56,10 @@
}
void cmd_exit(Serial *pc) {
+ if (control.user_cmd != 0.0f || control.torque_percent != 0.0f) {
+ pc->printf("%s\n", "Turn off motor first");
+ return;
+ }
BREMS_mode = MODE_RUN;
pc->printf("%s\n", "Run mode ON");
}
\ No newline at end of file
--- a/main.cpp Mon Feb 12 04:12:07 2018 +0000
+++ b/main.cpp Mon Feb 12 04:22:13 2018 +0000
@@ -96,7 +96,8 @@
va = va - voff;
vb = vb - voff;
vc = vc - voff;
-
+
+ /*some modes override the FOC outputs*/
switch (BREMS_mode) {
case MODE_CFG:
va = 0.0f;