I don’t know what I was thinking before. Now, that you have explained this so clearly - it became very obvious! With FETs resistance close to zero - the circuit is pretty much the main battery and motor’s EMF source in series supplying voltage to motor’s internal resistance, thus almost doubling stall current at the beginning.
However, I have some questions about your results:
-
What was your exact setup? I assume you plugged motor into MC29 and not 2-wire port on Cortex. Did you measure angle with quad encoder or IME?
-
Do you have an explanation for samples 271 and 272 or they look to you like instrumentation error due to some sort of delay in receiving sensor value?
-
It took about 60 msec to fully decelerate, but probably less time, assuming delay in sending command to motor controller. Then there was about 60 msec of no apparent movement, then 50 msec of acceleration but to a slower velocity.
It looks to me like it was picking gear slop when the readings were around zero, and then smaller steady velocity was achieved as a result of the reduced PTC conductivity. Did it achieve faster speed (around -34) later?
- If you are going to conduct more experiments - you may want to log both IME and quad encoder values. The the difference between those readings could give additional insights into how motor’s internal gears behave.
Also, here is a great thread that describes RobotC firmware timing in respect to tasks and how it relates to sensor input (an important topic that still gets me confused). You will probably, find it very interesting: