robot

Dependencies:   FastPWM3 mbed

Committer:
bwang
Date:
Tue Nov 13 17:46:23 2018 +0000
Revision:
252:38644631ed97
Parent:
251:4ba2f238066f
11/13/2018 12:45 - hitting <return> on empty line prints "\r>", so that hitting enter after intially connecting to the controller generates a prompt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bwang 130:639cd8586f86 1 04/30/2017 02:45 - added CHANGELOG.txt
bwang 131:031df63c7dbc 2 04/30/2017 04:51 - non-saturating tables, 8KW out to 600 rad/s. Extremely high top speed (1500 rad/s). code changes: removed a bunch of debug variables and commented-out code
bwang 132:101b74e4763a 3 05/01/2017 00:04 - added some decoupling terms, which may or may not work.
bwang 135:63ef59eb7f2a 4 05/01/2017 01:21 - driving code, 0.7g, achieved 40mph. Has throttle filtering
bwang 136:607bdeb17e2f 5 05/01/2017 03:17 - changed throttle limits to match 56k pulldown; relaxed THROTTLE_CRAZY bounds a bit
bwang 137:54c47ef47bbb 6 05/01/2017 06:40 - more tweaks to throttle limits
bwang 139:d5ef8d1936f8 7 05/01/2017 07:21 - rising edge from disabled state now resets usec count in PwmIn
bwang 140:170411d158b5 8 05/01/2017 07:58 - W_CRAZY limit bumped up, never an issue on the road but may behave strangely on the bench
bwang 142:0e0a164feb4c 9 05/01/2017 08:13 - enabled->disabled now resets usec count in PwmIn
bwang 143:a7a0c9d70e8a 10 05/01/2017 09:00 - bumped up THROTTLE_LOW from 1020 to 1050
bwang 144:a9e7fa1c98d7 11 05/02/2017 06:54 - fast logging is now back to logging vd, vq instead of decoupling terms
bwang 145:37ffa3ba3862 12 05/03/2017 08:24 - added circular buffer code
bwang 146:296bcc30e65d 13 05/03/2017 08:27 - CircularBuffer moved to its own .cpp file
bwang 147:c1b2379b8874 14 05/03/2017 08:36 - added median and moving average filters
bwang 148:9bca96f7be5c 15 05/03/2017 09:26 - added use_median option to circular buffers (since average filters may not want to recalculate the median every sample)
bwang 149:c51c0258c923 16 05/03/2017 09:39 - indexing bugfix in median code
bwang 151:5bbb15351798 17 05/04/2017 08:53 - added fast path for median-of-3
bwang 152:6877dceec871 18 05/04/2017 10:33 - removed throttle_crazy checks as these lead to dangerous behavior; beginnings of new filter code in main.cpp
bwang 154:0a22dcf91577 19 05/04/2017 11:14 - removed w_crazy checks, switched velocity to median filtering
bwang 155:7c6005933d4c 20 05/04/2017 12:44 - moved median filter objects to ControlStruct, is_driving() now checks % torque cmd instead of raw throttle value
bwang 156:cf92f967983d 21 05/04/2017 13:34 - changed logic in PwmIn::handle_fall, which no longer resets timer on invalid edges
bwang 157:a9b2002994d5 22 05/04/2017 17:16 - encoder class now sets TIM->ARR to CPR - 1
bwang 159:9dbc0657238c 23 05/07/2017 13:36 - added overmodulation option to config_loop
bwang 162:126dc3bc17f3 24 05/07/2017 13:42 - bugfix in constrain_norm(), which previously stepped from max to 1 magnitude when limiting kicked in
bwang 165:2463dbe52eee 25 07/01/2017 18:32 - added AutoMapper, AutoThrottleMapper classes for automated stall testing; parameters in this commit are currently connfigured for driving
bwang 166:4637785ba01e 26 09/04/2017 03:08 - added delay between startup and PwmIn creation in BREMSConfig.cpp to avoid power switch bounce induced lockups during logic power-on
bwang 177:f1aaaf0f9466 27 09/05/2017 04:57 - formatting fix
bwang 181:d3510c8beab6 28 02/07/2018 20:59 - new InvertingThrottleMapper, InterpolatingLutMapper classes. blended, smaller tables. BufferedLogger logging class
bwang 181:d3510c8beab6 29 02/08/2018 22:03 - integrated BufferedLogger into motor control code, logger and commutation both run (but validity of logged data is untested)
bwang 182:5ed20e4ce158 30 02/08/2018 22:48 - integrated CommandProcessor and PreferenceWriter (but code does not use dynamic config variables or set error flags yet)
bwang 183:73ff4a68565e 31 02/09/2018 14:28 - check for valid config in BREMSConfig.cpp is now 'if (PREFS_VALID != 1)', as flash bytes default to 0xFF
bwang 184:633119bb0b77 32 02/09/2018 15:22 - added functionality to disable logging during long UI operations (flash write)
bwang 187:523cf8c962e4 33 02/09/2018 16:01 - moved pinouts to layout.h
bwang 188:43f50a4cc040 34 02/09/2018 18:22 - moved hard-coded config values to defaults.h, started filling out errors.cpp and callbacks.cpp
bwang 189:760cd81a7633 35 02/09/2018 19:12 - changed object initialization order in BREMSConfig.cpp to read values back from flash first
bwang 190:01674f19f9ce 36 02/09/2018 21:45 - started switching code to run on flash-saved parameters instead of hardcoded ones; moved delay in BREMSConfig.cpp to avoid intermittent freeze after programming
bwang 191:66861311bdcd 37 02/09/2018 21:54 - removed extra delay in BREMSConfig as it does not seem to mitigate the freezing issue; migrated to dynamic loop gains
bwang 192:3152a86cd108 38 02/09/2018 22:41 - removed ROW, COLUMNS from configurable values, for now. removed a bunch of extra #include's
bwang 193:3abadeecf908 39 02/09/2018 22:58 - everything but main.cpp and friends moved to flash configuration
bwang 194:05e119bc5a78 40 02/10/2018 00:35 - added fancy masked error system
bwang 196:7172e6e28867 41 02/10/2018 01:05 - everything configured through flash variables, started adding support for operating modes
bwang 197:68fd01b73537 42 02/10/2018 01:35 - can now switch command source to terminal, added 'clear' command (which clears the screen on POSIX-compliant terminals)
bwang 198:7ee146427a0d 43 02/10/2018 17:00 - fixed a bug in BREMSConfig where the delay was in the wrong spot
bwang 199:c160a2c03781 44 02/11/2018 02:11 - added BREMS_mode. most modes are stubs right now (BREMS_CFG does a rudimentary encoder zero-ing, BREMS_CFG disables outputs)
bwang 204:74714d52a936 45 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
bwang 204:74714d52a936 46 02/11/2018 03:16 - blocked switching modes when motor is running
bwang 204:74714d52a936 47 02/11/2018 20:13 - scrambled the mode and error handling code in commutate() to be cleaner
bwang 205:5cfe6d7e08a3 48 02/11/2018 21:11 - further improvements to mode handling, output overrides and output disabling now live in their own functions
bwang 206:5c848ea69028 49 02/11/2018 21:21 - cmd_exit() checks that motor is not running
bwang 207:56ab30e84525 50 02/13/2017 20:33 - set serial RX interrupt to be lower priority than commutation interrupt
bwang 209:befed15596a7 51 02/13/2018 23:15 - cmd_flush() now works in all modes (otherwise the controller would only ever boot up in MODE_CFG)
bwang 218:13981deba5a8 52 02/20/2018 00:54 - moved modes.cpp to correct location
bwang 219:1cfd651eb2b2 53 05/29/2018 21:33 - microcontroller now resets resolver decode IC after voltages stabilize, to prevent position sensor from being off by pi radians
bwang 220:ff69c230aa6d 54 06/26/2018 15:47 - GetUnlimitedElecPosition() is now a private member of PositionSensorEncoder class (it is only used to compute mechanical position)
bwang 221:1e607c8d7d76 55 06/26/2018 15:57 - added induction machine CurrentModel, which is probably wrong
bwang 222:b58a95551632 56 10/02/2018 02:15 - PwmIn::get_throttle() returns 0, not -1, if throttle is disabled.
bwang 223:b986e7cee521 57 10/02/2018 02:21 - processCmd() now uses else-if statements, prints message if command is invalid
bwang 224:90172915d0fb 58 10/02/2018 03:10 - added overly-complicated LedBlinker class for blinking status codes over an LED, added blinker object to IOStruct, STATUS_LED to hardware.h
bwang 225:81b72a4bf18b 59 10/16/2018 22:59 - renamed CircularBuffer to fCircularBuffer to avoid conflict with new mbed libs
bwang 226:0e3fbbfea464 60 10/27/2018 19:12 - moved encoder object to use PA_1 and PA_15; removed some spurious analog registers in BREMSConfigRegisters which are no longer being used
bwang 227:e058e025c72d 61 10/28/2018 21:27 - added some explanatory comments to BREMSConfigRegisters
bwang 229:90c6892f4d3b 62 11/10/2018 00:50 - moved RESOLVER_RESET pin to PC_0 to match new hardware
bwang 230:7ac00598d366 63 11/10/2018 01:26 - renamed ia_supp_offset, ib_supp_offset to ad1, ad2_supp_offset to reflect the fact that they correspond to ADC channel offsets and not currents (which can be renamed in elsewhere)
bwang 231:753ec371b153 64 11/10/2018 01:32 - new pin mapping for new hardware
bwang 232:47f6cf4f9126 65 11/10/2018 01:50 - swapped ia and ib (back to what they were before 11/10/2018)
bwang 233:2ca26ab47b4f 66 11/10/2018 03:36 - restructured code to allow for proper encoder zeroing - MODE_ZERO and MODE_CHR execute run-once functions when they are entered, then drop to MODE_CFG
bwang 234:ad68d7f8eff1 67 11/10/2018 04:14 - 'some modes override FOC outputs' removed from commutate(), as it is no longer needed (ZERO, CHR have their own routines, CFG disables output anyway)
bwang 235:fe49ec4e9c97 68 11/10/2018 04:21 - cmd_setp() sets setpoint to zero if there are errors present (to avoid sudden start of motor if errors are cleared)
bwang 236:29ee9e1ccf61 69 11/10/2018 04:36 - bugfix to cmd_setp(), is_driving() now checks user_cmd and not torque_percent (i.e. if the pedal is down, the car is 'driving' regardless of the throttle map)
bwang 237:1a4591a0dd2d 70 11/10/2018 05:01 - bugfix to cmd_setp()
bwang 238:cf54cb197c8f 71 11/10/2018 06:18 - made PWM's non-inverting, swapped pins to match
bwang 239:09cd19ce7048 72 11/10/2018 06:20 - added cmd_clear() before startup message in BREMSInit()
bwang 240:2aaffa217627 73 11/10/2018 06:59 - changed the sign of the offset returned by calibrate_position(), since the signs of the PWM's have changed
bwang 240:2aaffa217627 74 11/10/2018 07:29 - is_driving() checks user_cmd and torque_percent (since 0 speed command may result in positive torque command)
bwang 240:2aaffa217627 75 11/10/2018 07:30 - typo in init_masks(), ERR_POS_INVALID should be enabled in MODE_CHR, not MODE_CFG, cosmetic typo in cmd_op()
bwang 240:2aaffa217627 76 11/10/2018 07:30 - enabled ERR_NOT_DRIVING in OP_SPEED
bwang 240:2aaffa217627 77 11/10/2018 07:32 - added speed loop related parameters in prefs, BREMSStructs
bwang 241:eec17042a009 78 11/10/2018 07:32 - added untested speed loop code
bwang 242:ac30f04fd6f7 79 11/10/2018 10:09 - cosmetic typo in errors.cpp
bwang 243:96b03b3bf3ef 80 11/12/2018 05:56 - added check for user_cmd < 0 in OP_DRIVING in cmd_setp - this disables motor if the user enters a cmd < 0, without screwing with error logic.
bwang 244:1c6c0af8508e 81 11/12/2018 06:16 - added W_LOOP_MAX_TQ parameter to limit acceleration in speed mode (actually, to make bench supplies not freak out when the motor ramps)
bwang 245:d97d09df3629 82 11/12/2018 07:33 - revert to old inverting, falling-edge-aligned code, since the Prius module is inverting
bwang 246:167b5d50d0f2 83 11/12/2018 07:42 - PWM configured to be non-inverting in BREMSConfigRegisters, moved inverting code to hardware.h like it should be
bwang 247:da647f7185b7 84 11/13/2018 10:05 - added io.cmd_busy flag to block execution of processCmd() during execution of processCmd()
bwang 248:c4539ee69052 85 11/13/2018 11:04 - added fast commands (which have command and data > 127 and aren't issuable from a terminal)
bwang 249:314c1b12d9c2 86 11/13/2018 11:20 - added COMMANDS.txt, added bounds check in OP_TORQUE
bwang 249:314c1b12d9c2 87 11/13/2018 12:00 - moved COMMANDS.txt to the right location
bwang 250:ef028cbd0749 88 11/13/2018 12:23 - changes to rxCallback() - fast commands no longer print "\r>" after completion; non-ASCII chars are no longer echoed
bwang 251:4ba2f238066f 89 11/13/2018 12:26 - bugfix to rxCallback()
bwang 252:38644631ed97 90 11/13/2018 12:36 - bugfix to processCmd(), hitting <return> on an empty line in terminal no longer prints 'Bad Command'
bwang 252:38644631ed97 91 11/13/2018 12:45 - hitting <return> on empty line prints "\r>", so that hitting enter after intially connecting to the controller generates a prompt