Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

stancecoke said:
...........
Hm, as far as I know, marcoq is inactive at the moment. .....
I think marcoq isn't complete inactive, because on Jobike he publish on regular base a teaser for a future version based on (again) v0.19 with ackmaniac and mbrusa mods. The latest v0.20 has problably a lot influence on the Java gui.
mbrusa has already proposed to help him with v0.20, because he already made some setup for it.
The problem is the Java gui, that is under control of marcoq.
If it remains unchanged (one page without tabs) then it is too small and choices have to be made wich settings comes in and wich will be removed.
But communication there is minimal too. So I think marcoq has a "lack of time" problem.
 
famichiki said:
Not sure how accurate the other readings of Mbrusa's firmware are, but the battery voltage certainly isn't right. I have a partially charged 52V battery and it's showing 59.2V but my bluetooth BMS shows the correct reading at 56.1V
with Google Translate:
Hi famichiki, percentage and voltage to be precise must be calibrated.
A suitable editor (Notepad ++ example) is needed to edit two parameters in the ebike_app.h file
ACTUAL_BATTERY_VOLTAGE_PERCENT to correct the voltage value.
ACTUAL_BATTERY_CAPACITY_PERCENT to set the actual battery capacity.
The procedure is as follows:
Set the two values ​​to 100, compile and program.
With the battery fully charged, switch on the display.
Display the voltage.
With a nominal 36V battery it must be close to 42V, if it is lower try increasing ACTUAL_BATTERY_VOLTAGE_PERCENT until reading 42V, vice versa if it were higher it must be decreased. I had to put 101 (+ 1%)
Check the battery percentage, it must be at 99.9.
At this point, use the bike until the battery is completely exhausted.
Check the residual percentage and calculate the effective percentage value (100 - residual value). Set ACTUAL_BATTERY_CAPACITY_PERCENT with this value
Example I had the final residual 8%, effective percentage 92% (100 - 8), but with used battery the effective% could be much less.
It is important in the configurator to set “Li-ion Cell Voltage for 4/4 Bars” to at least 4.10 Volts, otherwise after a short turn, if the voltage does not fall below this value, when it is switched on again it resets to 99.9 again.
If the charge is not complete, the reset to 99.9 does not activate automatically. If desired, it can be done manually by activating the "set default" procedure within 5 seconds of power on (2 times the light button at level 0).
 
mbrusa said:
Important! The display speed must be set in km / h
That is for ALL measurement values, like torque too?
Otherwise can these measurements be recalculated if the setting was mph instead of kph?
 
mbrusa said:
Hi famichiki, percentage and voltage to be precise must be calibrated.

Thanks for your reply.
Is that procedure only for the battery percentage display function?
Does the voltage display also need calibrating? Or is the raw voltage value always displayed?
Actually I have a more serious concern. I suspect my torque sensor is defective.
How can I compare my sensor with the data shown here?

Grazie per la tua risposta.
Questa procedura è solo per la funzione di visualizzazione della percentuale della batteria?
Anche la visualizzazione della tensione deve essere calibrata? Oppure viene sempre visualizzata la tensione non elaborata?
In realtà ho una preoccupazione più seria. Sospetto che il mio sensore di coppia sia difettoso.
Come posso confrontare il mio sensore con i dati mostrati qui?

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/How-to-calibrate-the-torque-sensor

Does your function output comparable data?
If the data is not comparable, could you provide a correct data table for your method to be used for calibration?

La tua funzione produce dati comparabili?
Se i dati non sono comparabili, potresti fornire una tabella di dati corretta per il tuo metodo da utilizzare per la calibrazione?

(ui16_adc_read_torque_sensor_10b() / 10)

This data is displayed.
Questi dati vengono visualizzati.

Code:
0kg    18
10kg   23
20kg   27
80kg   32 (body weight)

Or should I use one of the other "test torque" options instead?
O dovrei usare invece una delle altre "test torque"?

ui8_torque_sensor * 10
ui8_torque_sensor_filtered * 10


I also tried it my way using this as v0.19 seems to do.
Ho anche provato a modo mio usando questo come v0.19 sembra fare.

ui16_pedal_torque_x10

This data is displayed.
Questi dati vengono visualizzati.

Code:
0kg    14
10kg   35
20kg   90

Sono molto confuso!
 
Elinx said:
mbrusa said:
Important! The display speed must be set in km / h
That is for ALL measurement values, like torque too?
Otherwise can these measurements be recalculated if the setting was mph instead of kph?
Yes for all values.
It works only with km/h set, with mph the values go out of range for the display, the same happens with km/h and wheel diameter less than 21 ".
 
famichiki said:
mbrusa said:
Hi famichiki, percentage and voltage to be precise must be calibrated.

Thanks for your reply.
Is that procedure only for the battery percentage display function?
Does the voltage display also need calibrating? Or is the raw voltage value always displayed?
Actually I have a more serious concern. I suspect my torque sensor is defective.
How can I compare my sensor with the data shown here?

Grazie per la tua risposta.
Questa procedura è solo per la funzione di visualizzazione della percentuale della batteria?
Anche la visualizzazione della tensione deve essere calibrata? Oppure viene sempre visualizzata la tensione non elaborata?
In realtà ho una preoccupazione più seria. Sospetto che il mio sensore di coppia sia difettoso.
Come posso confrontare il mio sensore con i dati mostrati qui?

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/How-to-calibrate-the-torque-sensor

Does your function output comparable data?
If the data is not comparable, could you provide a correct data table for your method to be used for calibration?

La tua funzione produce dati comparabili?
Se i dati non sono comparabili, potresti fornire una tabella di dati corretta per il tuo metodo da utilizzare per la calibrazione?

(ui16_adc_read_torque_sensor_10b() / 10)

This data is displayed.
Questi dati vengono visualizzati.

Code:
0kg    18
10kg   23
20kg   27
80kg   32 (body weight)

Or should I use one of the other "test torque" options instead?
O dovrei usare invece una delle altre "test torque"?

ui8_torque_sensor * 10
ui8_torque_sensor_filtered * 10


I also tried it my way using this as v0.19 seems to do.
Ho anche provato a modo mio usando questo come v0.19 sembra fare.

ui16_pedal_torque_x10

This data is displayed.
Questi dati vengono visualizzati.

Code:
0kg    14
10kg   35
20kg   90

Sono molto confuso!

If the value is very different from the real one, it is better to also calibrate the voltage.
With (ui16_adc_read_torque_sensor_10b () / 10) to compare you have to make x 10 / 4.
With the latest version the values are directly comparable, I used UI8_ADC_TORQUE_SENSOR, the same as the 0.19 casainho version.
update
 
mbrusa said:
If the value is very different from the real one, it is better to also calibrate the voltage.
With (ui16_adc_read_torque_sensor_10b () / 10) to compare you have to make x 10 / 4.
With the latest version the values are directly comparable, I used UI8_ADC_TORQUE_SENSOR, the same as the 0.19 casainho version.
update

I installed your latest version today and traveled about 30 km.

The problem of the engine continuing to run a couple of seconds after stopping pedaling still exists. But forget it for now.

Furthermore, I found that the bike was very "fast" during my ride today. Minimal effort was required and it was difficult to drive slowly or maintain cadence with the engine.

I have tested my torque sensor many times and it is constantly low. So I hope I can correct it with calibration. I have a range of 18 - 35 which becomes more difficult at the top of the range above 30.

I wonder ... Would it be possible to calibrate via software? For example: we may have one configuration setting for our zero torque and another setting for the maximum torque. The maximum torque will depend on the user, it could be their body weight or maximum leg strength. Since the maximum torque of each person will be different, we can customize the torque sensor for the user. What are your thoughts?

...

Ho installato la tua ultima versione oggi e ho percorso circa 30 km.

Il problema del motore che continua a funzionare un paio di secondi dopo l'arresto della pedalata esiste ancora. Ma dimenticalo per ora.

Inoltre, ho scoperto che la bici era molto "veloce" durante la mia guida oggi. Era richiesto uno sforzo minimo ed era difficile guidare lentamente o mantenere la cadenza con il motore.

Ho testato il mio sensore di coppia molte volte ed è costantemente basso. Quindi spero di poterlo correggere con la calibrazione. Ho un intervallo di 18 - 35 che diventa più difficile nella parte superiore dell'intervallo superiore a 30.

Mi chiedo ... Sarebbe possibile calibrare via software? Ad esempio: potremmo avere un'impostazione di configurazione per la nostra coppia zero e un'altra impostazione per la coppia massima. La coppia massima dipenderà dall'utente, potrebbe essere il loro peso corporeo o la massima forza della gamba. Poiché la coppia massima di ogni persona sarà diversa, possiamo personalizzare il sensore di coppia per l'utente. Quali sono i tuoi pensieri?
 
famichiki said:
.......... Would it be possible to calibrate via software? For example: we may have one configuration setting for our zero torque and another setting for the maximum torque. The maximum torque will depend on the user, it could be their body weight ........
Problem is that the curve isn't complete lineair, above ~20kg, as you have seen here, where is a first description of the calibration proces. You must find the "knee" too. That is why calibration is adviced. If the first zero point is too high, the measurement with full weight is unreliable.
On the other end, there are already settings into the Java gui for setup the torque assistence. So maybe there are possibilities with minimal measurements.

torquesetting.jpg
 
I'm just been testing the torque level using the VLCD5's built in test mode. Is the value meant to change when pedal pressure is applied or is it only static? There is a TE mode which I thought was a live reading, because in the manual TE1 specifies it's the initial value only. Even if I apply pressure while entering the menu I still only see the initial value of 70.

This is Eco Cycles video showing a faulty motor.
https://www.youtube.com/watch?v=cOxYphMKx_Y

Interestingly there is a comment from someone there having some similar but more severe problems than me. Today while crossing a large divided road I had the green man, but when I reached the centre divider and stopped pedalling the motor continued to propel me across a few more lanes of traffic.

Mine is exhibiting sensor failure - it doesn't assist when I would expect it to, then occasionally pulses and, more awkwardly, decided to give full assistance at inopportune moments, like just when stopping at traffic lights.

vlcd5-testmode.png
 
famichiki said:
.....
This is Eco Cycles video showing a faulty motor.
.......
....when I reached the centre divider and stopped pedalling the motor continued to propel me across a few more lanes of traffic.
...
The question is. Is this behavior only with OSF or also with default FW.
If you have a bad torque sensor then you must have it too with default FW.
In the past there was for some people such a problem with OSF of marcoq, but that problem should be solved now.
A bad sensor can never be corrected.

For vlcd5 TE values
IMHO it must be possible to read weight values.
source
 
Elinx said:
The question is. Is this behavior only with OSF or also with default FW.
If you have a bad torque sensor then you must have it too with default FW.

The overrun was present in the factory firmware but the pulse/kicks of power were not. However I have not run the factory firmware long enough to see if the continual running occurs. That has only happened a few times in hundreds of km with OSF.

I just did the VLCD5 test again, the value does not change with either TE or TE1.. just a static 70. So that doesn't sound right going by the thread you linked to.
 
famichiki said:
...... So that doesn't sound right going by the thread you linked to.
I have XH18, so can't check. That is why I give this source. Maybe some other people can do.
 
I wonder if the value isn't changing because I've got the OSF installed. I'll revert to factory firmware tomorrow and try again. If there's still no change then there must be something seriously wrong.
 
Elinx said:
The problem is the Java gui, that is under control of marcoq.

I added the java source to my repo:
https://github.com/stancecoke/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/blob/master/TSDZ2_Controller_vM0.19.C_and_TSDZ2_Configurator_0.3.7_con_codice_0.19_Stable/tools/OSEC.java

Eclipse for java can be used for editing and building the runnable .jar file.

regards
stancecoke
 
famichiki said:
I wonder if the value isn't changing because I've got the OSF installed.....
You could have a point there, otherwise mbrusa's mod for measuring values isn't necessary
 
Elinx said:
You could have a point there, otherwise mbrusa's mod for measuring values isn't necessary

I can confirm that the inbuilt VLCD5 torque measuring mode only works properly with the factory firmware installed, otherwise you will only receive an initial static reading for both TE and TE1.

To access the service viewing menu, hold both "i" + power for 8 seconds, then press "i" 4 times.

As mentioned on this other forum, the manual is incorrect and the TE1 mode will display the live changing value (with TE being the initial static value). This may help you diagnose a faulty torque sensor.

https://www.pedelecs.co.uk/forum/threads/help-please-tsdz2-problem.33106/

However now I am getting a higher initial reading of 98 (was 70 with OSF) with a maximum reading of 190 when pressing with all my body weight and strength (80kg). I have no idea what this reading relates to though. :?:

According to Eco Cycle's video descriptions my initial reading is a little high (should be 80 +/- 10) but measuring it with OSF indicated it was low... well low according to Casainho's motor anyway. I don't know how many different motors he sampled to arrive at his recommended readings.

https://www.youtube.com/watch?v=cOxYphMKx_Y

Also I see in the main OSF thread that within a few hours of me wondering about software calibration Casainho has posted a method for doing just that. :thumb:

https://endless-sphere.com/forums/viewtopic.php?f=30&t=93818&start=4200#p1518241

So if anyone here is still running the factory firmware, or could revert and give this a try, I'd very very grateful to hear what torque values your VLCD5 displays.
 
famichiki
I have these TE 1-0093 values without load
TE 1- 0217 pedal pressure
my weight 113 kg I use 19s (52v) firmware from Eco Cycle.
I'm using a translokator. R.
 
ri53hu said:
famichiki
I have these TE 1-0093 values without load
TE 1- 0217 pedal pressure
my weight 113 kg I use 19s (52v) firmware from Eco Cycle.
I'm using a translokator. R.

Thank you! :thumb:
 
stancecoke said:
Elinx said:
The problem is the Java gui, that is under control of marcoq.

I added the java source to my repo:
https://github.com/stancecoke/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/blob/master/TSDZ2_Controller_vM0.19.C_and_TSDZ2_Configurator_0.3.7_con_codice_0.19_Stable/tools/OSEC.java

Eclipse for java can be used for editing and building the runnable .jar file.

regards
stancecoke


Good evening stance coke,
today marcoq has officially published on jobike that it will no longer release any version, its work ends like this. The cause of this decision was the publication of the decompiled sources of its configurator without consulting it, and without its permission.
Now we are left with no programmer to carry out this development.
I am very sorry for this, and I believe you should find a solution to this problem.
Thank you
 
stancecoke said:
Elinx said:
The problem is the Java gui, that is under control of marcoq.

I added the java source to my repo:
https://github.com/stancecoke/TSDZ2-Smart-EBike-compatible-with-original-VlCD6-display/blob/master/TSDZ2_Controller_vM0.19.C_and_TSDZ2_Configurator_0.3.7_con_codice_0.19_Stable/tools/OSEC.java

Eclipse for java can be used for editing and building the runnable .jar file.

regards
stancecoke

Stancecoke, I understand marcoq did not agree to publish its source code for whatever reason, and that was clear to me since the beginning after the early discussion between him and casainho, plus the popup at the interface startup.

Any chance for you to remove the source code from your repo?

As already mentioned, marcoq's intention is to stop sharing the configurator updates with the community, and this is a substantial loss for all of us.
Hope you guys may clarify the matter for the benefit of the community.
Cheers.
 
thineight said:
Stancecoke, I understand marcoq did not agree to publish its source code for whatever reason, and that was clear to me since the beginning after the early discussion between him and casainho, plus the popup at the interface startup.

Any chance for you to remove the source code from your repo?

As already mentioned, marcoq's intention is to stop sharing the configurator updates with the community, and this is a substantial loss for all of us.
Hope you guys may clarify the matter for the benefit of the community.
Cheers.

If you have used a GPL component in your software, then your entire software is considered a ‘work based on’ a GPL and, therefore:

You are not allowed to claim patents or copyright on the software. Moreover, you are obligated to display a copyright notice, disclaimer of warranty, intact GPL notices, and a copy of the GPL.
You are not allowed to change the license or introduce additional terms and conditions.
You are under the reciprocity obligation, which means you are obligated to release the source code and all of the rights to modify and distribute the entire code.
 
It's not really necessary to use the configurator and any Marcoq based version can be programmed without it.

After clicking 'Compile' the configuration data is temporarily written to /src/controller/config.h and cleared again after compiling is finished.

So if you quickly copy that you will have an editable configuration file. Editing the file directly is not too bad, especially if you are already familiar with Marcoq's configurator.

Then you can just run Compile.bat and Program.bat in the root directory without needing to use the configurator.

When programming, if you get the below message it means you need to set your custom path to ST Visual Programmer (SVTP).

'STVP_CmdLine' is not recognized as an internal or external command, operable program or batch file

In /src/controller/configurator_program.bat you will see this:

Code:
::PATH = %PATH%;C:\STMicroelectronics\st_toolset\stvp
PATH = %PATH%;%1

Change it to this:

Code:
PATH = %PATH%;C:\enter\your\path\here

For example, this is mine (if you have spaces in your path name it's a good idea to put quotes around).

Code:
PATH = %PATH%;"C:\Program Files (x86)\STMicroelectronics\st_toolset\stvp"

Alternatively if you want a one-step process, instead run /src/controller/compile_and_flash.bat the way you do with the original OSF. But again, if you have a custom path you'll need to edit this file.

Since Marcoq will no longer be updating the configurator, this way additional features can be added. Perhaps it's still a little daunting for new users but someone might decide to reformat the config.h file a bit nicer and add some explanations. Alternatively other configuration generators could be developed, such as a web-based version.

Here are the example configurations included with the configurator.

TSDZ2_Default_VLCD5_Configuration.ini

Code:
/*
 * config.h
 *
 *  Automatically created by TSDZ2 Controller's Parameters Configurator
 *  Author: marcoq
 */

#ifndef CONFIG_H_
#define CONFIG_H_

//=================================================================================================
// ENABLES
//=================================================================================================
#define ENABLE_VLCD6 0
#define ENABLE_VLCD5 1
#define ENABLE_XH18 0
#define ENABLE_LIGHTS_FROM_OEM 1
#define ENABLE_BACKWARDS_RESISTANCE_OFF 1
#define ENABLE_STREET_MODE_ON_STARTUP 0
#define ENABLE_EMTB_MODE_ON_STARTUP 1
#define ENABLE_WALK_ASSIST_FROM_OEM 1
#define ENABLE_BRAKE_SENSOR 0
#define ENABLE_THROTTLE 0
#define ENABLE_WHEEL_PERIMETER_FROM_OEM	1
#define ENABLE_WHEEL_MAX_SPEED_FROM_OEM 1
#define CHECKBOX11 0
#define ENABLE_DISPLAY_WORKING_FLAG 1
#define ENABLE_DISPLAY_ALWAYS_ON 0
#define ENABLE_WALK_ASSIST_OFF_DELAY 0
#define ENABLE_STREET_POWER_LIMIT 1
#define TEMPERATURE_LIMIT_FEATURE_ENABLED 0
#define STARTUP_BOOST_WHEN_SPEED_IS_ZERO 1
#define STARTUP_BOOST_WHEN_CADENCE_IS_ZERO 0
//=================================================================================================
// BATTERY
//=================================================================================================
#define ADC_BATTERY_CURRENT_MAX_LIMIT 18.0
#define TARGET_MAX_BATTERY_POWER (uint16_t) 625
#define BATTERY_MAX_CURRENT_FLOAT 17.0
#define BATTERY_CELLS_NUMBER (uint8_t) 10
#define BATTERY_LOW_VOLTAGE_CUT_OFF_DIV10 29.0
#define BATTERY_PACK_RESISTANCE (uint16_t) 196
#define DIVISOR_FOR_CUTOFF_CALC (uint16_t) 44
#define LI_ION_CELL_OVERVOLT 4.25
#define LI_ION_CELL_VOLTS_100 3.90
#define LI_ION_CELL_VOLTS_75 3.70
#define LI_ION_CELL_VOLTS_50 3.44
#define LI_ION_CELL_VOLTS_25 3.20
#define LI_ION_CELL_EMPTY 3.00
#define ENABLE_VLCD5_BATTERY_SOC_4_BARS 0
#define SOC_BATTERY_VOLTAGE_FILTER_COEFFICIENT (uint8_t) 4
#define SOC_BATTERY_CURRENT_FILTER_COEFFICIENT (uint8_t) 4
#define SOC_ADC_BATTERY_VOLTAGE_PER_ADC_STEP 0.0866
#define READ_BATTERY_VOLTAGE_FILTER_COEFFICIENT	(uint8_t) 2
#define READ_BATTERY_CURRENT_FILTER_COEFFICIENT (uint8_t) 2
//=================================================================================================
// MOTOR
//=================================================================================================
#define MOTOR_TYPE_36V 1
#define MOTOR_TYPE_48V 0
#define EXPERIMENTAL_HIGH_CADENCE_MODE 0
#define MOTOR_ASSISTANCE_WITHOUT_PEDAL_ROTATION 0
#define MOTOR_PHASE_CURRENT_MAX_AMP 30.0
#define MOTOR_ROTOR_OFFSET_ANGLE (uint8_t) 10
#define MOTOR_ROTOR_ERPS_START_INTERPOLATION_60_DEGREES	(uint8_t) 10
#define MOTOR_OVER_SPEED_ERPS (uint16_t) 520
#define MOTOR_OVER_SPEED_ERPS_EXPERIMENTAL (uint16_t) 700
#define TXTFIELD25 0
#define TXTFIELD26 0
//=================================================================================================
// PWM DUTY CYCLE
//=================================================================================================
#define PWM_CYCLES_SECOND (uint16_t) 15625
#define PWM_DUTY_CYCLE_MIN (uint8_t) 20
#define PWM_DUTY_CYCLE_MAX (uint8_t) 254
#define PWM_DUTY_CYCLE_RAMP_UP_DIV1000 1.3
#define PWM_DUTY_CYCLE_RAMP_DOWN_DIV1000 1.3
#define CURRENT_RAMP 5.0
#define TXTFIELD34 0
//=================================================================================================
// WHEEL and PAS
//=================================================================================================
#define WHEEL_PERIMETER (uint16_t) 2083
#define WHEEL_MAX_SPEED (uint8_t) 45
#define OEM_WHEEL_SPEED_DIVISOR (uint16_t) 315
#define WHEEL_SPEED_SENSOR_MAX_PWM_CYCLE_TICKS (uint16_t) 1166
#define WHEEL_SPEED_SENSOR_MIN_PWM_CYCLE_TICKS (uint16_t) 65534
#define WHEEL_SPEED_PI_CONTROLLER_KP_DIVIDEND (uint8_t) 100
#define WHEEL_SPEED_PI_CONTROLLER_KP_DIVISOR (uint8_t) 4
#define WHEEL_SPEED_PI_CONTROLLER_KI_DIVIDEND (uint8_t) 40
#define WHEEL_SPEED_PI_CONTROLLER_KI_DIVISOR (uint8_t) 6
#define PAS_NUMBER_MAGNETS (uint8_t) 20
#define TXTFIELD45 0
//=================================================================================================
// SOFT START
//=================================================================================================
#define INITIAL_SOFT_START_ASSIST_VALUE_X10 (uint16_t) 20
#define SOFT_START_TIMEOUT (uint16_t) 20
#define K_SOFT_START_FACTOR 0.990
//=================================================================================================
// PEDAL ASSIST LEVELS
//=================================================================================================
#define MASTER_LEVEL_FACTOR 1.0
#define ASSIST_LEVEL_FACTOR_X10_1 (uint16_t) 50
#define ASSIST_LEVEL_FACTOR_X10_2 (uint16_t) 120
#define ASSIST_LEVEL_FACTOR_X10_3 (uint16_t) 210
#define ASSIST_LEVEL_FACTOR_X10_4 (uint16_t) 300
//=================================================================================================
// THROTTLE
//=================================================================================================
#define ADC_THROTTLE_THRESHOLD (uint8_t) 10
#define THROTTLE_FILTER_COEFFICIENT (uint8_t) 1
#define ADC_THROTTLE_MIN_VALUE (uint8_t) 47
#define ADC_THROTTLE_MAX_VALUE (uint8_t) 176
//=================================================================================================
// TORQUE SENSOR
//=================================================================================================
#define ADC_TORQUE_SENSOR_THRESHOLD (uint8_t) 6
#define PEDAL_TORQUE_SENSOR_UNIT 0.55
#define AVERAGE_TORQUE_FACTOR 0.637
//=================================================================================================
// WALK ASSIST
//=================================================================================================
#define WALK_ASSIST_PWM_LEVEL_0 (uint8_t) 10
#define WALK_ASSIST_PWM_LEVEL_1 (uint8_t) 13
#define WALK_ASSIST_PWM_LEVEL_2 (uint8_t) 16
#define WALK_ASSIST_PWM_LEVEL_3 (uint8_t) 19
#define WALK_ASSIST_PWM_LEVEL_4 (uint8_t) 22
#define WALK_ASSIST_PERCENTAGE_CURRENT (uint8_t) 20
#define WALK_ASSIST_MAX_RAMP_TIME_DIV10 1.0
#define WALK_ASSIST_OFF_DELAY_PWM_DIV10 (uint8_t) 20
#define WALK_ASSIST_OFF_DELAY_TIME_DIV10 2.0
//=================================================================================================
// STREET MODE
//=================================================================================================
#define STREET_SPEED_LIMIT (uint8_t) 25
#define STREET_POWER_LIMIT (uint16_t) 250
//=================================================================================================
// MOTOR POWER BOOST
//=================================================================================================
#define STARTUP_MOTOR_POWER_BOOST_LIMIT_MAX_POWER 1
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_1 (uint8_t) 100
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_2 (uint8_t) 72
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_3 (uint8_t) 43
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_4 (uint8_t) 15
#define STARTUP_MOTOR_POWER_BOOST_TIME_DIV10 2.0
#define STARTUP_MOTOR_POWER_BOOST_FADE_TIME_DIV10 3.5
//=================================================================================================
// eMTB MODE
//=================================================================================================
#define EMTB_MOTOR_PULL_FACTOR 0.30
#define EMTB_START_ASSIST_LEVEL_FACTOR_X10 (uint16_t) 50
//=================================================================================================
// MOTOR TEMPERATURE
//=================================================================================================
#define MOTOR_TEMPERATURE_MIN_VALUE_LIMIT (uint8_t) 75
#define MOTOR_TEMPERATURE_MAX_VALUE_LIMIT (uint8_t) 85
#define READ_MOTOR_TEMPERATURE_FILTER_COEFFICIENT (uint8_t) 4
//=================================================================================================
// MAGIC BYTE
//=================================================================================================
#define MAGIC_BYTE (uint8_t) 170
//=================================================================================================
// STVP DIRECTORY
//=================================================================================================
#define STVP_DIRECTORY C:/STMicroelectronics/st_toolset/stvp

#endif /* CONFIG_H_ */

TSDZ2_Default_VLCD6_Configuration.ini

Code:
/*
 * config.h
 *
 *  Automatically created by TSDZ2 Controller's Parameters Configurator
 *  Author: marcoq
 */

#ifndef CONFIG_H_
#define CONFIG_H_

//=================================================================================================
// ENABLES
//=================================================================================================
#define ENABLE_VLCD6 1
#define ENABLE_VLCD5 0
#define ENABLE_XH18 0
#define ENABLE_LIGHTS_FROM_OEM 1
#define ENABLE_BACKWARDS_RESISTANCE_OFF 1
#define ENABLE_STREET_MODE_ON_STARTUP 0
#define ENABLE_EMTB_MODE_ON_STARTUP 1
#define ENABLE_WALK_ASSIST_FROM_OEM 1
#define ENABLE_BRAKE_SENSOR 0
#define ENABLE_THROTTLE 0
#define ENABLE_WHEEL_PERIMETER_FROM_OEM	1
#define ENABLE_WHEEL_MAX_SPEED_FROM_OEM 1
#define CHECKBOX11 0
#define ENABLE_DISPLAY_WORKING_FLAG 1
#define ENABLE_DISPLAY_ALWAYS_ON 0
#define ENABLE_WALK_ASSIST_OFF_DELAY 0
#define ENABLE_STREET_POWER_LIMIT 1
#define TEMPERATURE_LIMIT_FEATURE_ENABLED 0
#define STARTUP_BOOST_WHEN_SPEED_IS_ZERO 1
#define STARTUP_BOOST_WHEN_CADENCE_IS_ZERO 0
//=================================================================================================
// BATTERY
//=================================================================================================
#define ADC_BATTERY_CURRENT_MAX_LIMIT 18.0
#define TARGET_MAX_BATTERY_POWER (uint16_t) 625
#define BATTERY_MAX_CURRENT_FLOAT 17.0
#define BATTERY_CELLS_NUMBER (uint8_t) 10
#define BATTERY_LOW_VOLTAGE_CUT_OFF_DIV10 29.0
#define BATTERY_PACK_RESISTANCE (uint16_t) 196
#define DIVISOR_FOR_CUTOFF_CALC (uint16_t) 44
#define LI_ION_CELL_OVERVOLT 4.25
#define LI_ION_CELL_VOLTS_100 3.96
#define LI_ION_CELL_VOLTS_75 3.70
#define LI_ION_CELL_VOLTS_50 3.44
#define LI_ION_CELL_VOLTS_25 3.30
#define LI_ION_CELL_EMPTY 3.00
#define ENABLE_VLCD5_BATTERY_SOC_4_BARS 0
#define SOC_BATTERY_VOLTAGE_FILTER_COEFFICIENT (uint8_t) 4
#define SOC_BATTERY_CURRENT_FILTER_COEFFICIENT (uint8_t) 4
#define SOC_ADC_BATTERY_VOLTAGE_PER_ADC_STEP 0.0866
#define READ_BATTERY_VOLTAGE_FILTER_COEFFICIENT	(uint8_t) 2
#define READ_BATTERY_CURRENT_FILTER_COEFFICIENT (uint8_t) 2
//=================================================================================================
// MOTOR
//=================================================================================================
#define MOTOR_TYPE_36V 1
#define MOTOR_TYPE_48V 0
#define EXPERIMENTAL_HIGH_CADENCE_MODE 0
#define MOTOR_ASSISTANCE_WITHOUT_PEDAL_ROTATION 0
#define MOTOR_PHASE_CURRENT_MAX_AMP 30.0
#define MOTOR_ROTOR_OFFSET_ANGLE (uint8_t) 10
#define MOTOR_ROTOR_ERPS_START_INTERPOLATION_60_DEGREES	(uint8_t) 10
#define MOTOR_OVER_SPEED_ERPS (uint16_t) 520
#define MOTOR_OVER_SPEED_ERPS_EXPERIMENTAL (uint16_t) 700
#define TXTFIELD25 0
#define TXTFIELD26 0
//=================================================================================================
// PWM DUTY CYCLE
//=================================================================================================
#define PWM_CYCLES_SECOND (uint16_t) 15625
#define PWM_DUTY_CYCLE_MIN (uint8_t) 20
#define PWM_DUTY_CYCLE_MAX (uint8_t) 254
#define PWM_DUTY_CYCLE_RAMP_UP_DIV1000 1.3
#define PWM_DUTY_CYCLE_RAMP_DOWN_DIV1000 1.3
#define CURRENT_RAMP 5.0
#define TXTFIELD34 0
//=================================================================================================
// WHEEL and PAS
//=================================================================================================
#define WHEEL_PERIMETER (uint16_t) 2083
#define WHEEL_MAX_SPEED (uint8_t) 45
#define OEM_WHEEL_SPEED_DIVISOR (uint16_t) 315
#define WHEEL_SPEED_SENSOR_MAX_PWM_CYCLE_TICKS (uint16_t) 1166
#define WHEEL_SPEED_SENSOR_MIN_PWM_CYCLE_TICKS (uint16_t) 65534
#define WHEEL_SPEED_PI_CONTROLLER_KP_DIVIDEND (uint8_t) 100
#define WHEEL_SPEED_PI_CONTROLLER_KP_DIVISOR (uint8_t) 4
#define WHEEL_SPEED_PI_CONTROLLER_KI_DIVIDEND (uint8_t) 40
#define WHEEL_SPEED_PI_CONTROLLER_KI_DIVISOR (uint8_t) 6
#define PAS_NUMBER_MAGNETS (uint8_t) 20
#define TXTFIELD45 0
//=================================================================================================
// SOFT START
//=================================================================================================
#define INITIAL_SOFT_START_ASSIST_VALUE_X10 (uint16_t) 20
#define SOFT_START_TIMEOUT (uint16_t) 20
#define K_SOFT_START_FACTOR 0.990
//=================================================================================================
// PEDAL ASSIST LEVELS
//=================================================================================================
#define MASTER_LEVEL_FACTOR 1.0
#define ASSIST_LEVEL_FACTOR_X10_1 (uint16_t) 50
#define ASSIST_LEVEL_FACTOR_X10_2 (uint16_t) 120
#define ASSIST_LEVEL_FACTOR_X10_3 (uint16_t) 210
#define ASSIST_LEVEL_FACTOR_X10_4 (uint16_t) 300
//=================================================================================================
// THROTTLE
//=================================================================================================
#define ADC_THROTTLE_THRESHOLD (uint8_t) 10
#define THROTTLE_FILTER_COEFFICIENT (uint8_t) 1
#define ADC_THROTTLE_MIN_VALUE (uint8_t) 47
#define ADC_THROTTLE_MAX_VALUE (uint8_t) 176
//=================================================================================================
// TORQUE SENSOR
//=================================================================================================
#define ADC_TORQUE_SENSOR_THRESHOLD (uint8_t) 6
#define PEDAL_TORQUE_SENSOR_UNIT 0.55
#define AVERAGE_TORQUE_FACTOR 0.637
//=================================================================================================
// WALK ASSIST
//=================================================================================================
#define WALK_ASSIST_PWM_LEVEL_0 (uint8_t) 10
#define WALK_ASSIST_PWM_LEVEL_1 (uint8_t) 13
#define WALK_ASSIST_PWM_LEVEL_2 (uint8_t) 16
#define WALK_ASSIST_PWM_LEVEL_3 (uint8_t) 19
#define WALK_ASSIST_PWM_LEVEL_4 (uint8_t) 22
#define WALK_ASSIST_PERCENTAGE_CURRENT (uint8_t) 20
#define WALK_ASSIST_MAX_RAMP_TIME_DIV10 1.0
#define WALK_ASSIST_OFF_DELAY_PWM_DIV10 (uint8_t) 20
#define WALK_ASSIST_OFF_DELAY_TIME_DIV10 2.0
//=================================================================================================
// STREET MODE
//=================================================================================================
#define STREET_SPEED_LIMIT (uint8_t) 25
#define STREET_POWER_LIMIT (uint16_t) 250
//=================================================================================================
// MOTOR POWER BOOST
//=================================================================================================
#define STARTUP_MOTOR_POWER_BOOST_LIMIT_MAX_POWER 1
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_1 (uint8_t) 100
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_2 (uint8_t) 72
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_3 (uint8_t) 43
#define STARTUP_MOTOR_BOOST_ASSIST_LEVEL_PERCENT_4 (uint8_t) 15
#define STARTUP_MOTOR_POWER_BOOST_TIME_DIV10 2.0
#define STARTUP_MOTOR_POWER_BOOST_FADE_TIME_DIV10 3.5
//=================================================================================================
// eMTB MODE
//=================================================================================================
#define EMTB_MOTOR_PULL_FACTOR 0.30
#define EMTB_START_ASSIST_LEVEL_FACTOR_X10 (uint16_t) 50
//=================================================================================================
// MOTOR TEMPERATURE
//=================================================================================================
#define MOTOR_TEMPERATURE_MIN_VALUE_LIMIT (uint8_t) 75
#define MOTOR_TEMPERATURE_MAX_VALUE_LIMIT (uint8_t) 85
#define READ_MOTOR_TEMPERATURE_FILTER_COEFFICIENT (uint8_t) 4
//=================================================================================================
// MAGIC BYTE
//=================================================================================================
#define MAGIC_BYTE (uint8_t) 170
//=================================================================================================
// STVP DIRECTORY
//=================================================================================================
#define STVP_DIRECTORY C:/STMicroelectronics/st_toolset/stvp

#endif /* CONFIG_H_ */
 
I was under the impression the configurator was initially made for configuring the kuteng controllers with open source firmware.
I have no idea who started writing it and if it comes with a GPL or other license.
So, what is so special about Marcoq his configurator that shouldn't be revealed to the public?
As newbie, it's difficult to understand the different motor firmware forks.
There seems to be at least 2 or 3 forks that work with some (all?) of the original displays.
Next, there is the question on what motor firmware revision they are based on, with what features.
If the configurator "sources" were handed over to other dev's with the clear request not to publish them, I can understand Marcoq's feeling, but we don't know what happened.
 
obcd said:
I was under the impression the configurator was initially made for configuring the kuteng controllers with open source firmware.
I have no idea who started writing it and if it comes with a GPL or other license.
So, what is so special about Marcoq his configurator that shouldn't be revealed to the public?
As newbie, it's difficult to understand the different motor firmware forks.
There seems to be at least 2 or 3 forks that work with some (all?) of the original displays.
Next, there is the question on what motor firmware revision they are based on, with what features.
If the configurator "sources" were handed over to other dev's with the clear request not to publish them, I can understand Marcoq's feeling, but we don't know what happened.

It does not matter where he got the configurator from, nor does his intentions matter, he bundled it with the GPL-project from opensource-tsdz2 project, and therefore his code is also subject to GPL.
 
Back
Top