by yang » Mon Jul 21, 2014 9:00 pm
I have started to make my first changes in the code. Basically it is a mixture of the servo mode and the startup sequence with START_STEPS_NUM.
In RPM mode the startup sequence does the align but stops here. ESC state remains in ESC_STATE_NOCOMM. When I now enter the command rpm 1, the runRpm() method starts rotating the field using the servo logic. Once it reaches 100rpm, I would start with the commutation and bring the state in ESC_STATE_STARTING and therefor RUNNING. And if the rpms are set below 100, I am back in the NOCOMM logic.
That's the idea, it is not working yet. Some sideeffect I haven't found yet. From my point of view I am still in the NOCOMM state and hence the behavior should be the same as what the servo mode does. Align the motor and then increase the degrees. Need to find out why it is not. At the moment imemdiately after the ALIGN the motor starts making high frequency noises, the rpm in the status screen is 25'000 and although the fetServoAngle is increasing slowly, the motor does not turn. As said, from my point of view I am doing the same thing as the servo mode does. Obviously there is something overriding my fet settings which doesn't when mode=ESC_SERVO_MODE. Will find out.
Other issues I have with my CooCox development environment
* in one out of 10 compilations the serial port does not work. Not even the first serialPrint() does something. ESC Led is toggling, so systick works and the initial fetbeep is produced as well. No idea.
* Had major issues with the gnu compiler around stdio and floats. At the moment I am using the full C library and everything works here except the sscanf(). for example I can successfully execute the command set FF1TERM 1 or FF1TERM 2.0 but a FF1TERM 1.1 does cause the ESC to freeze, a value of 2.4e-8 of course as well. I have no idea. As setting the FF1TERMs manually is time consuming anyway, I had modified the defaults instead for now.
Next step, once above works, would be to check if the transition from NOCOMM to fetStartCommutation() works smoothly. But should as it is in the regular startup sequence as well. But the way back to NOCOMM will be harder, I need to find out the starting angle.
The SERVO_DUTY config value concerns me a bit. If it is too high it will overheat the FETs and the motor, I assume. If it is too low it will not create enough momentum to start the motor. Keep in mind, my use case is not a propeller but a car like application. Much more resistance or even a full blocking motor in worst case.
The space vector and sinusoidal field implementation might be worth implementing for regular commutational movement as well. But then the RUN_FREQ needs to be increased, 2kHz is not enough steps at high rpms. I am not sure I am brave enough to do that myself. But frankly, this is actually all I am trying to implement. A rotating space vector aligning to the BackEMF communtation commands and if the BackEMF is too low, keep rotating the field at the targetRpm value.