I just put this graph and your notes, on the project notes files as this is important to understand the "torque-simulation" mode.
Here is the code:
Let's consider throttle is not connect (ui8_throttle_value_filtered will be zero).
1. PAS cadence is mapped from 0 to 255, where 255 is the PAS_MAX_CADENCE_RPM
Seems that on your image, PAS_MAX_CADENCE_RPM = 45
2. the max value of both throotle and PAS is used, in this case, PAS cadence is the only one that will have effect
3. is multiplied by (1/5) * LCD assist level (at max level 5, the output will be max of 255)
4. now the value is mapped from 0 up to motor controller max current and is applied to the motor current controller (with LCD assist level of 5, this will represent the top line of your graphic; with level 1, the bottom line of the graph)
5. if LCD P3 = 1, the same value is also mapped from 0 to LCD max wheel speed and is applied to the motor speed controller, else, the motor speed controller is configured with the LCD max wheel speed
The extra here is P3 = 0, were with above all of that, will also set different wheel speed with the same logic as the motor current.
What do you think?
stancecoke wrote: ↑
Dec 09, 2017 6:03 am
I don't have a simple PAS that has this assymetrical output. So I can't test if the direction detection works, sorry.
Have you put all the #defines into the config.h? Then perhaps it's time to update the Java-Tool of the master branch.
So I think we should consider it works until someone tries and say it is not working
Maybe I will test it later, as I have one of that PAS.
I didn't put any the #define in config.h. I am not working yet on there and on the Java tool. Can you do that? -- but see if there is any advantage to do that right now, as I could understand, maybe you are the only one using that tool for now. I prefer to do it manually as I need to know very well which options I am selecting and see the source code being disabled/enable when I change that options.
But if you test and agree with the throotle/PAS and torque sensor control schemes, I think they should not change much and will keep that #define options. So will be a good investment to add to Java tool.
I want to put all my ebikes with torque sensor, I have 3 ebikes and 2 torque sensor installed, I just need to buy another one.
This torque sensor detects torque when press the pedals to the ground, my small soon can cheat the system like that. With human power enable it is ok as depends on the cadence but I would like to have motor assist without need to pedaling at startup. Maybe I can implement the walk speed limit of 6km/h when cadence = 0.