Waynemarlow
10 kW
Sounding good guys, keep the updates going.
Thanks on behalf of us all for your time.
Thanks on behalf of us all for your time.
typedef struct
{
uint16_t ui16_assist_level_factor_x1000;
....
uint8_t ui8_battery_current_min_adc;
uint8_t ui8_eMTB_factor; // <-- NEW
uint8_t ui8_eMTB_exponential; // <-- NEW
} struct_config_vars;
typedef struct rt_vars_struct {
uint16_t ui16_adc_battery_voltage;
...
uint8_t ui8_street_mode_throttle_enabled;
uint8_t ui8_eMTB_factor; // <-- NEW
uint8_t ui8_eMTB_exponential; // <-- NEW
} rt_vars_t;
typedef struct ui_vars_struct {
uint16_t ui16_adc_battery_voltage;
...
uint8_t ui8_street_mode_throttle_enabled;
uint8_t ui8_eMTB_factor; // <-- NEW
uint8_t ui8_eMTB_exponential; // <-- NEW
uint16_t var_speed_graph_auto_max_min;
...
uint8_t var_motor_foc_threshold_min;
} ui_vars_t;
static Field assistMenus[] =
{
FIELD_EDITABLE_UINT(_S("Num assist levels", "Num Levels"), &ui_vars.ui8_number_of_assist_levels, "", 1, 20),
FIELD_EDITABLE_UINT("Level 1", &ui_vars.ui16_assist_level_factor[0], "", 1, 65535, .div_digits = 3),
...
FIELD_EDITABLE_UINT("Level 20", &ui_vars.ui16_assist_level_factor[19], "", 1, 65535, .div_digits = 3),
FIELD_EDITABLE_UINT(_S("eMTB exponential", "eMTB exp"), &ui_vars.ui8_eMTB_exponential, "", 1, 3), // <-- NEW
FIELD_EDITABLE_UINT(_S("eMTB factor", "eMTB factor"), &ui_vars.ui8_eMTB_factor, "", 1, 100), // <-- NEW
FIELD_END };
void copy_rt_to_ui_vars(void) {
ui_vars.ui16_adc_battery_voltage = rt_vars.ui16_adc_battery_voltage;
...
rt_vars.ui8_street_mode_throttle_enabled = ui_vars.ui8_street_mode_throttle_enabled;
rt_vars.ui8_eMTB_factor = ui_vars.ui8_eMTB_factor; // <-- NEW
rt_vars.ui8_eMTB_exponential = ui_vars.ui8_eMTB_exponential; // <-- NEW
}
So, first you should add them to ui and rt vars as you did, as also to EEPROM so they will be saved.silvocross said:Can anyone please give me some advice on how to properly set up the UART communication between LCD and Motor in order to include the 2 additional parameters for eMTB mode?
1. on controller side, I added and using the two following variables defined in ebike_app.h:
Code:typedef struct { uint16_t ui16_assist_level_factor_x1000; .... uint8_t ui8_battery_current_min_adc; uint8_t ui8_eMTB_factor; // <-- NEW uint8_t ui8_eMTB_exponential; // <-- NEW } struct_config_vars;
while on LCD side I also included the two variables in rt_vars and ui_vars:
Code:typedef struct rt_vars_struct { uint16_t ui16_adc_battery_voltage; ... uint8_t ui8_street_mode_throttle_enabled; uint8_t ui8_eMTB_factor; // <-- NEW uint8_t ui8_eMTB_exponential; // <-- NEW } rt_vars_t;
Code:typedef struct ui_vars_struct { uint16_t ui16_adc_battery_voltage; ... uint8_t ui8_street_mode_throttle_enabled; uint8_t ui8_eMTB_factor; // <-- NEW uint8_t ui8_eMTB_exponential; // <-- NEW uint16_t var_speed_graph_auto_max_min; ... uint8_t var_motor_foc_threshold_min; } ui_vars_t;
I then added two additional entries in configscreen.c:
Code:static Field assistMenus[] = { FIELD_EDITABLE_UINT(_S("Num assist levels", "Num Levels"), &ui_vars.ui8_number_of_assist_levels, "", 1, 20), FIELD_EDITABLE_UINT("Level 1", &ui_vars.ui16_assist_level_factor[0], "", 1, 65535, .div_digits = 3), ... FIELD_EDITABLE_UINT("Level 20", &ui_vars.ui16_assist_level_factor[19], "", 1, 65535, .div_digits = 3), FIELD_EDITABLE_UINT(_S("eMTB exponential", "eMTB exp"), &ui_vars.ui8_eMTB_exponential, "", 1, 3), // <-- NEW FIELD_EDITABLE_UINT(_S("eMTB factor", "eMTB factor"), &ui_vars.ui8_eMTB_factor, "", 1, 100), // <-- NEW FIELD_END };
I also updated the EEPROM configurations for ui_vars in order to load the defaults and then store the new settings.
finally in state.c I copy the values of ui_vars to rt_vars:
Code:void copy_rt_to_ui_vars(void) { ui_vars.ui16_adc_battery_voltage = rt_vars.ui16_adc_battery_voltage; ... rt_vars.ui8_street_mode_throttle_enabled = ui_vars.ui8_street_mode_throttle_enabled; rt_vars.ui8_eMTB_factor = ui_vars.ui8_eMTB_factor; // <-- NEW rt_vars.ui8_eMTB_exponential = ui_vars.ui8_eMTB_exponential; // <-- NEW }
So I think I am now ready to send and receive the two additional variables to the controller over UART. what is the proper method in order not to break the communication interface?
thanks a lot
Silvio
casainho said:So, first you should add them to ui and rt vars as you did, as also to EEPROM so they will be saved.
Them go to configurations and add a menu for emtb and add there that 2 new configurations.
As this 2 new variables need to be configured only on configurations menu, they can be added to configurations UART package. This package is sent to motor controller at system startup on motor init and everytime leaving the configurations menu.
You will need to expand the configurations package, increment the buffers also.
// eMTB
ui8_usart1_tx_buffer[80] = rt_vars.ui8_eMTB_factor; // <-- NEW
ui8_usart1_tx_buffer[81] = rt_vars.ui8_eMTB_exponential; // <-- NEW
Now you only need to increment ui8_usart1_tx_buffer size as also increment the Len of the package as the crc will be done for the package len.silvocross said:casainho said:So, first you should add them to ui and rt vars as you did, as also to EEPROM so they will be saved.
Them go to configurations and add a menu for emtb and add there that 2 new configurations.
As this 2 new variables need to be configured only on configurations menu, they can be added to configurations UART package. This package is sent to motor controller at system startup on motor init and everytime leaving the configurations menu.
You will need to expand the configurations package, increment the buffers also.
Hi Casainho, thanks for the quick reply. I am adding them to FRAME_TYPE_CONFIGURATIONS as:
Code:// eMTB ui8_usart1_tx_buffer[80] = rt_vars.ui8_eMTB_factor; // <-- NEW ui8_usart1_tx_buffer[81] = rt_vars.ui8_eMTB_exponential; // <-- NEW
but I believe I'll have to change the CRC parameters as well?
casainho said:Now you only need to increment ui8_usart1_tx_buffer size as also increment the Len of the package as the crc will be done for the package len.
i follow the thread from time to time and if i understand and remember it correctly, geeksville was working on it in the past. A first test version didn't work though and after that geeksville was privately busy for some time and then apparently lost interest in the project and hasn't been developed since the end of last year.Nfer said:ilu said:...phm2000 said:
Are you sure?
I asked Eco Ebike about the bluetooth update of their SW102 display on January and they told me:
"The initial OSF upload by Bluetooth is not available yet. It is still a work in progress. For now, you have to open it, and do it manually. We recommend using the OSF 850c until the Bluetooth OSF update is available for the SW102, and then you can swap displays."
I think that is because a motor wrong firmware version. For some reason that error is wrong in the beta version as it was corrected on previous version.gatorsean said:I was curious about the latest beta and after flashing, i just get an error on the display: e:brakes
I do have brake sensors installed, but did not have any issues before the new beta firmware. Is it possible to go back a rev with SW102?
casainho said:Field weakening: increase motor speed / pedal cadence over battery voltage limit
I use a 52V battery with a 48V motor and usually I get this speeds when riding at city on a road with a a lot of cars then I go as fast as possible because I fell safe at high speeds on this street due to the stress the cars do on me if I go slow:vshitikov said:casainho said:Field weakening: increase motor speed / pedal cadence over battery voltage limit
Hi Casainho, very interesting. I'm curious when do you use the cadence over 90rpm? Is it on the steep hills using your lowest gear to climb a hill on your MTB?
I personally stay most of the time at 60-80 rpm as recreational and utility cyclists Wikipedia explains. But I changed the front chainring for the 50t . The original one coming with the TSD2Z is very small and you have to pedal like a hamster to get to 25km/h
My back wheel is only 20inch though...
casainho said:I think that is because a motor wrong firmware version. For some reason that error is wrong in the beta version as it was corrected on previous version.gatorsean said:I was curious about the latest beta and after flashing, i just get an error on the display: e:brakes
I do have brake sensors installed, but did not have any issues before the new beta firmware. Is it possible to go back a rev with SW102?
I moved from Fitbit watch to Garmin watch recently. Garmin watch broads cast user HR over ANT+ and I would like to have my HR on the 860C display while riding. I think TSDZ2 ESP32 / NRF52 BLE and ANT+ project is a good idea, it can be seen like a gateway in the middle of an ebike motor and display, and that connect to external sensors as also a mobile app. Also the TSDZ2 ESP32 Android app seems to have active development.AZUR said:Hi,
I have a friend who has a Specialized Turbo Levo (TL).
It uses a Gramin Edge 1030 GPS. The 1030 has a specific application to connect to the Turbo Levo.
TL connects to Garmin via ANT + and sends the instantaneous engine power and human instantaneous power data to the 1030.
Garmin records data for each activity.
At the end, or during the activity, it is possible to know the average engine power and the average human power.
I also use a Garmin and I have no experience with similar applications for Android smartphone.
I have the following questions to ask the forum.
1 - Which Android applications allow you to show and record activity data. Data such as speed, power, distance, cadence, etc? And also record GPS locations?
2 - What is the format of the activity files? Garmin .FIT file format? GPX format?
3 - Which android applications will allow to develop applications to connect other peripherals, such as cadence sensors, power sensors? etc. Or connect to TSDZ2 firmware? using bluetooth.
Thanks
I tough it would work. I will focus on next version and test that on my side.gatorsean said:Hi casainho. I flashed the sw102-otaupdate-0.9.0.zip and the TSDZ2-v0.58.0.hex and get this error. Can you tell me which motor firmware to use as this is what was posted together on Github for the Beta.
casainho said:I tough it would work. I will focus on next version and test that on my side.gatorsean said:Hi casainho. I flashed the sw102-otaupdate-0.9.0.zip and the TSDZ2-v0.58.0.hex and get this error. Can you tell me which motor firmware to use as this is what was posted together on Github for the Beta.
vshitikov said:casainho said:Field weakening: increase motor speed / pedal cadence over battery voltage limit
Hi Casainho, very interesting. I'm curious when do you use the cadence over 90rpm? Is it on the steep hills using your lowest gear to climb a hill on your MTB?
I personally stay most of the time at 60-80 rpm as recreational and utility cyclists Wikipedia explains. But I changed the front chainring for the 50t . The original one coming with the TSD2Z is very small and you have to pedal like a hamster to get to 25km/h
My back wheel is only 20inch though...
Yes, I hope to be able to do it and will be last big feature on the project.jbalat said:Casainho I am so glad you finally have some time to work on field weakening. Good luck and let me know if there is any way I can help keeping in mind that I still have the ktlcd3
Why do you need to go above 90rpm. It is not a common practice to ride above 80 but if you were overtaking someone or taking a run up to get up a hill or over a jump then the last thing you want to do is have to change up a gear. This way you can keep your power and momentum going until it is a better time to change gears. Hope I explained it well. You will only be above 90 for just a few seconds so even if it is really inefficient it is still a much better option than having to play around with your gears in some circumstances.
casainho said:And what is the mas cadence RPM for you? Maybe the 125 is to much?
I saw your video but I don't remember now. But you value 128 max RPM? Do you expect to use it or you think you hit 128 just because was a test but on regular basis you use a lower value?jbalat said:casainho said:And what is the mas cadence RPM for you? Maybe the 125 is to much?
I think 125 would be awesome. Not sure if you saw my last video but I was able to get to 128 with a 36v motor using 14s and high cadence setting and only 115 on 10s which is my normal ride. Currently power drops off quite a bit at these higher speeds so you need to put in lots of effort which is very disappointing. Would be great if power could be maintained for a little longer.
Thanks for your efforts![]()
I am interested on this max value of cadence because current 125 value seems a bit high for me and if it can be lower, I expect to increase a bit the efficiency. Like why not 110 instead of 125? From 90 to 110 is already a good increase... or maybe to 115...Waynemarlow said:120 rpm cadence over an extended time, is really in that young and very fit rider zone, if we are fitting these engines then I would suspect that the age group and fitness may well be represented by the fact we are fitting enginesDo we really need to worry too much about the benefits of upper 120's, probably not as most of those young and fit riders will be riding analogue bikes and still keeping up with us.
As previously stated I run 80 - 95 rpm cadence on a regular basis, but age is now meaning 100's are out.