MIMA software
I am still working on the new software, but with the holidays and everything, I think it will be next week before I can get in enough testing time to be comfortable releasing it. Why don't we shoot for the first of the new year, and that way I can enjoy the holidays a bit, and be testing the code as we do our Christmas visits.
Chisight has let me see the light as far as how to modularize the parts of the program, for easy of modification and clarity of function, so I am re working lots of the subroutines towards that end.
Present software has some changes, and some additions.
1. Pressing the joystick central switch will activate the AR2 outputs,
2. Charging at over 15 A will activate AR1 output.
3. ABC (Adjustable Background Charge) in mode 1, adjustment is 0 to 25A
4. The ABC charge mode will be disabled at less than 5MPH , and the mode 1 led flashes, but the mode is remembered, and as you acxcelerate past the 5MPH point, it is re-enabled.
5. Ramp generating code has been placed in the cmdpower processing code, so all changes of cmdpwr dutycycle (121 to 240 is the range of values) will proceed at a constant, adjustable rate of change from the present value to the new value. If the map control signal jumps from a high value to a low one quickly, with your present software, the IMA load could jump from +100A to -50 A pretty fast, causing a lurch as the load changes. The ramp can be adjusted to 63 different speeds, from almost as fast as now, to very slow.
The joystick has one setting for ramp speed, and the PIMA and ABC have another, so fast joystick response can be retained, while having a smooth gradual PIMA and ABC response where the step changes are more likely to occur.
6. Increased the delay on the keysampling code, so it will be easier to operate with gloves on.
7. Re-wrote the MPH measuring code, so it can present accurate speed information at the slow end of the MPH scale, 7mph to stopped.
8. If in PIMA, as you cross 19 MPH, I presently knock you out of that mode, back to IMA mode . On the new code, the system will switch out of PIMA, but the mode 2 led will now flash, and when you get over the 19 MPH, PIMA will automatically reactivate.
9. jsnable has found that his joystick needs to be nudged a bit on return to center, or the relay will not click. Others with two joysticks, are finding that they cannot reach full assist or charge, because of the loading effect of the two pots.
I am addressing both of these issues for the short term in this code, by increasing the sensitivity of the stick output so that the full range is covered, and also by opening up the deadband some more so that Jsnables stick will return to deadband properly.
Chisight is working on the real answer, a joystick calibration and assignment procedure in the Initial MIMA set up. You would do this calibration whenever you made a change in the mounting position, or went from one stick to two. The display would show a code telling you to pust the joystick in the direction you wanted for assist, then charge, then jog up, then jog down. You would repeat if you had a second stick.
The software records all and makes the appropriate configuration changes in the flash memory, and will from that point will be perfect.
Happy Holidays everyone :wink: