It's easier for you, but I'm still tangled up in my own shoelaces..It's faster to implement it, than to explain how to implement it![]()
It's easier for you, but I'm still tangled up in my own shoelaces..It's faster to implement it, than to explain how to implement it![]()
"Better" for EBike use.I would like to hear your detailed arguments on this issue.
Thank you for your efforts on documenting your improvements.Here's what I came up with:
Delete this while structure:the controller freezes occasionally upon startup
while(adcData[1]>THROTTLE_OFFSET)Delete this while structure:
#ifndef TORQUE_OVERRIDE
while(adcData[1]>THROTTLE_OFFSET)
{
//do nothing (For Safety at switching on)
}
#endif
Code:#ifndef TORQUE_OVERRIDE while(adcData[1]>THROTTLE_OFFSET) { //do nothing (For Safety at switching on) } #endif
@szupek had a similar issue. He solved it with some delays at startupНичего не изменилось.
but I discovered that after adding some delays and LED blinks at the beginning of main.c for newly downloaded sensorless branch, the hanging of controller when starting at 48.6V problem is gone
This is for Controllers from EBS Heidelberg, they are using a customized (old generation) Lishui hardware, that has a Pullup for NTC temperature reading on this ADC channel. It is not used, as long as you don't set a value different from zero for the Pullup resistor in the main.h.How does it work? And why is adcData[6] used here?
Mine is the same. As far as I understand, adcData[5] is not used for the temperature sensor anywhere in the firmware.I managed to replace the cloned STM32F103 with the original and flash it with open-source firmware. I had to reduce the SWD frequency to allow flashing using longer wires.
Some notes about the LSW12G-USAMK-F
The temperature sensor raw data is located on PB0 - adcData[5]
The output of the analog temperature sensor is pulled up to 3.3 V using a 3000 Ohm resistor.
The digital pin SS1 is pulled up to 3.3V with a 9300 ohm resistor (or close to it, according to my measurements).
Below is a picture of the traces underneath the microcontroller if anyone needs to follow the vias.
Asking the AI without having deep knowledge of the topic yourself is always difficult. All the stuff you have written about UART is strange. The processing of the incoming messages is triggered by the UART idle interrupt for example, so I'm sure, that the message was received completely....Seriously, express your opinion on these points.
I have exactly the same controller. As far as I understand, adcData[5] is not used anywhere in the firmware for the temperature sensor?I managed to replace the cloned STM32F103 with the original and flash it with open-source firmware. I had to lower the SWD frequency to allow flashing using longer wires.
A few notes about the LSW12G-USAMK-F
The temperature sensor raw data is located on PB0 - adcData[5]
The output of the analog temperature sensor is pulled up to 3.3 V using a 3000 Ohm resistor.
The digital pin SS1 is pulled up to 3.3V with a 9300 Ohm resistor (or close to it, according to my measurements).
Below is a picture of the traces underneath the microcontroller if anyone needs to trace the vias.
there are three analogue inputs available on the lishui hardware. Pin PA3 for the throttle and PB0 and PB1 (marked as AD1 and AD2 on the PBC header in the old generation) for general purpose.As far as I understand, adcData[5] is not used anywhere in the firmware for the temperature sensor?
The reason is simple: So far no one asked to use the motor temperature sensor on the new generation controllers. So I never changed that.we always see: MS.Temperature = T_NTC(adcData[6]);
This switches the torque signal input from the throttle input to AD1. Most generic controllers only have the Throttle and the PAS available on the external connectors by default. If you want to attach a torquesensor and don't want to open the controller to solder in an extra wire, you can use the throttle input.And in the Java configurator, there's a switch named PB1 = torque sensor
#if defined (ADC_BRAKE)
while ((adcData[5]>THROTTLE_OFFSET)&&(adcData[1]>(THROTTLE_MAX-THROTTLE_OFFSET))){HAL_Delay(200);
y++;
if(y==35) autodetect();
}
#endif
#endif
ui32_brake_adc_cumulated -= ui32_brake_adc_cumulated>>4;
ui32_brake_adc_cumulated+=adcData[5];//get value for analog brake from AD2 = PB0
ui16_brake_adc=ui32_brake_adc_cumulated>>4;
ui16_torque = ui32_torque_raw_cumulated>>3;
As long as you don't comment in the ADC brake in the config.h (or activate it in the Java Tool) it doesn't matter.What to do with this if adcData[5] is a thermistor?
What did you use for this? I think I managed to run debugging once, but it didn't work this time. Is the process described somewhere?You should use the debug function of the Eclipse IDE to see where the code stucks, like @szupek did.