plpetrov said:
1. The error "e: 8 Comms" can not be cleared by turning the system on and off. It behaves like its value is saved somewhere in a non-volatile memory perhaps at turning off the display. One way to clear the error, that can be reproduced in 100 % of the tests, is to change the asset level and then to turn off and on the system. Another approach is display settings reset.
The motor controller firmware checks here:
Code:
// check for communications fail or display master fail
// can't fail more then 1000ms
if (ui8_comm_error_counter > 10) {
motor_disable_pwm();
ui8_m_motor_enabled = 0;
ui8_m_system_state |= ERROR_FATAL;
}
The ui8_comm_error_counter is set to 0 every time a communication package is received. It is incremented when a packages was received but CRC fails or at every 100ms. Note that every 100ms a package should be received, the display should send it every 100ms.
The ui8_m_system_state is a RAM variable as is initialized to ERROR_NOT_INIT. When you power off the display it should power off also the motor controller and then at start again the display, the motor controller should start again... unless there SW102 firmware for some reason has a bug....
plpetrov said:
3. Inconsistent motor torque at the same power level. This is not something new but I never reported that, as it is not easy to reproduce. So while changing the assist levels e.g. for asset level 13, I have experienced two completely different motor responses.
- the first from which I have always complaining. With the motor power burst at the place where we read the maximum of the torque sensor.
- the second is the one it should be. Very smooth and powerful response without any peaks caused by the max values of the torque sensor. I do not know what is happening but if we can reproduce this error forever this will be my favourite motor assist calculation algorithm.
The entry and exit conditions could not be identified for the moment. What is for sure, that if I enter the second scenario, power off and on does not clear it. Also changing the asset level up and down. However after many changes of the asset level we may go back to the first.
I hope we can find the source of this issue...
plpetrov said:
4. I saw in your code that there is an error related to the handbrake. I tried switching on the display with the brake applied. There was no error shown in the display no mater how long I waited. However the system will start only after I release the brake. Again nothing shown as a reason for the delay.
As far as I remember this should have been fixed and I see in the display code related errors. Experimenting I could not find any condition to invoke it.
I don't know if anything of what I am reporting could be of any help. However if there is another way for better troubleshooting using some tools or methodology could make cense.
You will find on common/state.c motor_init() function - check the logic there!!
The motor controller sends continuous an "alive" a package every 100ms to display, but only after startup. Once it receives a package from the display, will never more send that alive package.
The display waits for that alive package and after 5 seconds (ui16_motor_init_command_error_cnt = 500

shows the error but keeps trying to receive it:
Code:
switch (g_motor_init_state) {
case MOTOR_INIT_GET_MOTOR_ALIVE:
ui16_motor_init_command_error_cnt = 500;
g_motor_init_state = MOTOR_INIT_WAIT_MOTOR_ALIVE;
// not break here to follow for next case
case MOTOR_INIT_WAIT_MOTOR_ALIVE:
// check timeout
ui16_motor_init_command_error_cnt--;
if (ui16_motor_init_command_error_cnt == 0) {
fieldPrintf(&bootStatus2, _S("Error brakes", "e: brakes"));
g_motor_init_state = MOTOR_INIT_GET_MOTOR_ALIVE;
}
break;