mspider65 said:this week i had some test rides in the mountains with the new board installed in my Bike and everything went well.
A total of 60Km and 3000m uphill.
casainho said:I would like to invite you to read more about this idea of a Fully wireless TSDZ2 mid drive motor (like Specialized Turbo Levo) and I hope we can collaborate in future. As you can see, your board and Android app are a reference, I hope they can be reused on this new project: https://endless-sphere.com/forums/viewtopic.php?f=28&t=106346
Maybe the advantage of ANT+ is the cycling sensors (and ANT technology belongs to Garmin). And Garmin advantage is probably their advanced fitness algorithms and metrics, and all integrations between different devices - they even buy the fitness algorithms to FirstBeat.mspider65 said:casainho said:I would like to invite you to read more about this idea of a Fully wireless TSDZ2 mid drive motor (like Specialized Turbo Levo) and I hope we can collaborate in future. As you can see, your board and Android app are a reference, I hope they can be reused on this new project: https://endless-sphere.com/forums/viewtopic.php?f=28&t=106346
hello Casainho,
thanks, but I would have done nothing if your Open Source Firmware had not been there.
I don't have plan to add too many features to the Android App, my intention is to use the app mainly for the setup and monitoring of the motor.
I use the bike mainly for fun to ride in the mountains and normally i don't use nothing else than the switch to change assistance level .
The only advanced feature i use when i ride on new traks, is map navigation, and for this feature i prefer to have a rugged Android Phone. I had in past also Garmin devices but i think now an Android Phone give a lot more flexibility (my favorite navigation app is Oruxmaps).
In any case your idea is really interesting and i think also ANT+ is now a consolidated standard for the ebikes.
I will be glad to follow the thread and, if i can, i will also give help.
Massimo
pgwguk said:Thanks to mspider65, I got my ESP32 board a little while ago.
Unfortunately, I'd been unable to start the installation process until today, but I can also confirm how well made the board is!
I installed the board on an 8 pin controller, so slight difference on the colours referenced in the wiki - I can help to update this if needed.
As I've got an 8 pin controller, I also used the 1t4 cable from EcoCycles. This means I've modified my VLCD5 to use a bafang connector. I haven't finished the installation enough to ride the trike yet, but hope to get that done this weekend and take some pictures.
As well as testing the VLCD5 which worked great, I also tested the SW102 from EcoCycles.
This mini display has TSDZ2 compatible firmware pre-loaded, so my hope was it'd be compatible with the ESP32 setup.
The great news is, it does! All the functionality of the SW102 appears active, power level and power mode selection also works!
mspider65, you've done a great job and I'll do some further testing with the SW102 to confirm it's 100% compatible.
This could be a great option for others to use the SW102 with OSF without having to open up the display!
One quick question, are there any plans to make this work with Casainho's latest firmware? I'd like to test the force weakening, etc.
Happy to help with testing.
Beautiful mountainsmspider65 said:New TSDZ2 controller version (v4) released with the fix for the backward resistance when using the cadence sensor in "Advanced Mode".
Tested this morning on a short trip to "cima Vezzena".
Link to the new version:
https://github.com/TSDZ2-ESP32/TSDZ2-ESP32-Wiki/raw/master/bin/STM8/TSDZ2-v4.zip
P.S.
Thanks to mbrusa for the info about the fix!
hefest said:Any progress on supporting tsdz2 firmware v1.0.0?
This limit exists to make sure to get a proper sinusodial shape of the phase current. If you get two less PWM updates per electric revolution, you won't get an proper current shape. With the limit of 520 we get 30 points on the sine- curve per revolution at the PWM frequency of 15625 Hz.mspider65 said:For this reason, I think that by setting a higher value of max ERPS it will be possible
I really hope we can merge TSDZ2 wireless standard project and this one in the future, so everyone can enjoy the most updated firmware and features.mspider65 said:The Controller protocol and firmware parameters are different and the porting involves all the layers (ESP32 and Android app.), and since I am really satisfied with the current firmware, i don't have in plan (at least for now) to port the v1.0.0.hefest said:Any progress on supporting tsdz2 firmware v1.0.0?
imho is that what Jbalat did found already and what is implemented as "experimental high cadence"mspider65 said:...
Before to start the implementation of the "field weakening" feature I have also done some tests with the current new firmware at high cadence in order to have a baseline and i had an unexpected result.
In my current setup (36V motor and 36V battery) i'm able to have assistance up to a cadence of 97 RPM.
The images below also shows that the limit is not the duty cycle (always below the max value of 254) but the motor Max ERPS that hit the max value of 520 set in the Software. For this reason, I think that by setting a higher value of max ERPS it will be possible to have assistanace even above 100 RPM.
imho this could be one the reasons why Casainho increased the PWM to 19kHzstancecoke said:.... With the limit of 520 we get 30 points on the sine- curve per revolution at the PWM frequency of 15625 Hz....
casainho said:I really hope we can merge TSDZ2 wireless standard project and this one in the future, so everyone can enjoy the most updated firmware and features.
ui16_g_adc_battery_current = UI16_ADC_10_BIT_BATTERY_CURRENT;
ui16_g_adc_battery_current = ADC1->DRH;
ui8_temp= ADC1->DRL;
ui16_g_adc_battery_current = (ui16_g_adc_battery_current << 2) | (uint16_t)(ui8_temp & 0x03);
/*
* - New pedal start/stop detection Algorithm (by MSpider65) -
*
* Pedal start/stop detection uses both transitions of both PAS sensors
* ui8_pas_state stores the PAS1 and PAS2 state: bit0=PAS1, bit1=PAS2
* Pedal forward ui8_pas_state sequence is: 0x01 -> 0x00 -> 0x02 -> 0x03 -> 0x01
* After a stop, the first forward transition is taken as reference transition
* Following forward transition sets the cadence to 7RPM for immediate startup
* Then, starting form the second reference transition, the cadence is calculated based on counter value
* All transitions resets the stop detection counter (much faster stop detection):
*/
// cadence sensor variables
#define NO_PAS_REF 5
#define CADENCE_TICKS_STARTUP 6250 // about 7-8 RPM
#define CADENCE_SENSOR_STANDARD_MODE_SCHMITT_TRIGGER_THRESHOLD 350
volatile uint16_t ui16_cadence_sensor_ticks = 0;
volatile uint32_t ui32_crank_revolutions_x20 = 0;
static uint16_t ui16_cadence_sensor_ticks_counter_min = CADENCE_SENSOR_CALC_COUNTER_MIN;
static uint8_t ui8_pas_state_old = 4;
static uint16_t ui16_cadence_calc_counter, ui16_cadence_stop_counter;
static uint8_t ui8_cadence_calc_ref_state = NO_PAS_REF;
static uint8_t ui8_pas_old_valid_state[4] = { 0x01, 0x03, 0x00, 0x02 };
uint8_t ui8_pas_state = (PAS1__PORT->IDR & PAS1__PIN) | ((PAS2__PORT->IDR & PAS2__PIN) >> 6);
if (ui8_pas_state != ui8_pas_state_old) {
if (ui8_pas_state_old != ui8_pas_old_valid_state[ui8_pas_state]) {
// wrong state sequence: backward rotation
ui16_cadence_sensor_ticks = 0;
ui8_cadence_calc_ref_state = NO_PAS_REF;
goto skip_cadence;
}
ui16_cadence_sensor_ticks_counter_min = ui16_cadence_sensor_ticks_counter_min_speed_adjusted;
if (ui8_pas_state == ui8_cadence_calc_ref_state) {
// ui16_cadence_calc_counter is valid for cadence calculation
ui16_cadence_sensor_ticks = ui16_cadence_calc_counter;
ui16_cadence_calc_counter = 0;
// software based Schmitt trigger to stop motor jitter when at resolution limits
ui16_cadence_sensor_ticks_counter_min += CADENCE_SENSOR_STANDARD_MODE_SCHMITT_TRIGGER_THRESHOLD;
} else if (ui8_cadence_calc_ref_state == NO_PAS_REF) {
// this is the new reference state for cadence calculation
ui8_cadence_calc_ref_state = ui8_pas_state;
ui16_cadence_calc_counter = 0;
} else if (ui16_cadence_sensor_ticks == 0) {
// Waiting the second reference transition: set the cadence to 7 RPM for immediate start
ui16_cadence_sensor_ticks = CADENCE_TICKS_STARTUP;
}
// Reference state for crank revolution counter increment
if (ui8_pas_state == 0)
ui32_crank_revolutions_x20++;
skip_cadence:
// reset the counter used to detect pedal stop
ui16_cadence_stop_counter = 0;
// save current PAS state
ui8_pas_state_old = ui8_pas_state;
}
if (++ui16_cadence_stop_counter > ui16_cadence_sensor_ticks_counter_min) {
// pedals stop detected
ui16_cadence_sensor_ticks = 0;
ui16_cadence_stop_counter = 0;
ui8_cadence_calc_ref_state = NO_PAS_REF;
} else if (ui8_cadence_calc_ref_state != NO_PAS_REF) {
// increment cadence tick counter
++ui16_cadence_calc_counter;
}
I am happy to see that the fully wireless TSDZ2 project is going wellcasainho said:A video showing the Garmin GPS cycling computer controlling the battery voltage to turn on / off the motor -- changing assist level on the display and when value is zero it disable the motor voltage:
stancecoke said:This limit exists to make sure to get a proper sinusodial shape of the phase current. If you get two less PWM updates per electric revolution, you won't get an proper current shape. With the limit of 520 we get 30 points on the sine- curve per revolution at the PWM frequency of 15625 Hz.mspider65 said:For this reason, I think that by setting a higher value of max ERPS it will be possible
regards
stancecoke
The test was done using the standard 36V motor configuration.Elinx said:imho is that what Jbalat did found already and what is implemented as "experimental high cadence"
That option changes the erps from 520 to 700, but also the foc angle from 80 to 115 and can go to 130 rpm cadence.
mspider65 said:hefest said:Any progress on supporting tsdz2 firmware v1.0.0?
The Controller protocol and firmware parameters are different and the porting involves all the layers (ESP32 and Android app.), and since I am really satisfied with the current firmware, i don't have in plan (at least for now) to port the v1.0.0.