casainho said:VICTORY!!
The connection for firmware programming and debug are available on the connector for the speed sensor.
Seems that the original firmware is not read protected. I was able to read the option bytes, firmware and finally connect with OpenOCD for a debug session.
Please read my full notes here: https://opensourceebikefirmware.bitbucket.io/development_tsdz2/Various--2018.04.18_-_original_firmware_and_debug_session_using_OpenOCD.html
casainho said:Ok, TSDZ2 is out off topic but I would like to say that the firmware development started the best way possible!!!and thanks to all the knowledge earned on this project for Kunteng motor controllers.
casainho said:VICTORY!!
The connection for firmware programming and debug are available on the connector for the speed sensor.
Seems that the original firmware is not read protected. I was able to read the option bytes, firmware and finally connect with OpenOCD for a debug session.
stancecoke said:I've implemented it in the latest commit, but I have not tried it on the road,
Thanks for logging and testing. Really nice to see that is really different on both situations.stancecoke said:stancecoke said:I've implemented it in the latest commit, but I have not tried it on the road,
I've tested it on the road now, but I was not successful. It seems, that the zero crossing of the phase current is not influenced by the correction angle at all...![]()
mjentos said:Hi,
I got controller 60V KT 18 MOSFETS, and motor Nine Continent RH205 kassette. I can`t to configure it to run motor smoothly, i got effect like on the video https://www.youtube.com/watch?v=exmxFgL-Fno&feature=youtu.be&t=13 . Motor has 46 magnets, I set P1 on 46 and still works wrong. Do you think with the new firmware I will be able to make it run well?
Interesting is that with stock fw you can regen by decreasing throttle possition and the transition between braking and accelerating is not noticeable at all.stancecoke said:...but I was not successful.
honya96 said:mjentos said:Hi,
I got controller 60V KT 18 MOSFETS, and motor Nine Continent RH205 kassette. I can`t to configure it to run motor smoothly, i got effect like on the video https://www.youtube.com/watch?v=exmxFgL-Fno&feature=youtu.be&t=13 . Motor has 46 magnets, I set P1 on 46 and still works wrong. Do you think with the new firmware I will be able to make it run well?
Try changing C2 and reset display everytime.
No, the current controller tries to decrease the duty_cycle. Let's say motor is rotating at 100 erps and that gives a 12v BEMF. If duty-cycle value equals to a 12v from battery, no current flows. If you decrease duty-cycle a bit, now the voltage from battery will be lower than the BEMF voltage from motor and current will start to be regen.stancecoke said:After thinking a little: The current controller pulls the dutycycle to zero, if high regen current is wanted. In this case the correction angle can't have any effect, as the PWM puts no sinewave to phase lines.
Can we achieve higher regen current, if we set a higher dutycyle and a "misstuned" correction angle?!
With dutycycle = 0 I get about 1.5A regen current at about 20km/h with my BionX...
You mean changing the angle to get regen?? Idon't think so. On FOC, for regen and invert rotation, we change Iq current from positive to negative. Let's say motor is running with a reference Iq = 10A, to start regen we should put Iq ref = -10A.stancecoke said:Can we achieve higher regen current, if we set a higher dutycyle and a "misstuned" correction angle?!
casainho said:So, on motor regen duty-cycle is not always zero but will be a value in a way that regen current is not more the value we define/control,
Then leave it at 0 and test all 36 phase-hall combinations (google for it).mjentos said:I tried 0-7, no improvement
casainho said:If we push the first magnet to right to move the second one, max torque will be at 90 degrees and after being moving, to brake, max torque will be at -90 degrees (now on the left side).
Yes, that is one idea but I prefer to keep looking at the same place and consider the signal is now inverted and so invert the logic for increase/decrease the ui8_angle_correction. That's because of possible errors on current implementation, due to overflow of the 8bits variables like this ui8_motor_rotor_angle >= FOC_READ_ID_CURRENT_ANGLE_ADJUST.stancecoke said:Have you ever tried to shift the correction angle by 127 (=180°) for doing regen? In the german forum there was a similar suggestion.casainho said:If we push the first magnet to right to move the second one, max torque will be at 90 degrees and after being moving, to brake, max torque will be at -90 degrees (now on the left side).
// make sure we just execute one time per ERPS, so use the flag ui8_flag_foc_read_id_current
if ((ui8_motor_rotor_angle >= ((uint8_t) FOC_READ_ID_CURRENT_ANGLE_ADJUST)) && (ui8_flag_foc_read_id_current))
{
ui8_flag_foc_read_id_current = 0;
// minimum speed to do FOC
if (ui16_motor_speed_erps > MOTOR_ROTOR_ERPS_START_INTERPOLATION_60_DEGREES)
{
// read here the phase B current: FOC Id current
ui8_adc_id_current = UI8_ADC_MOTOR_PHASE_B_CURRENT;
if (ui8_adc_id_current > ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MAX)
{
// limit max ui8_angle_correction value (127 + 15)
if ((ui8_angle_correction+1) < 143) { ui8_angle_correction++; }
}
else if (ui8_adc_id_current < ADC_PHASE_B_CURRENT_ZERO_AMPS_FOC_MIN)
{
// limit min ui8_angle_correction value (127 - 15)
if ((ui8_angle_correction-1) > 112)
{
// decrease only when not regen!! other way ui8_angle_correction will always decrease... CAN WE IMPROVE THIS??
if (UI8_ADC_BATTERY_CURRENT > (ui8_adc_battery_current_offset+2)) { ui8_angle_correction--; }
}
}
}
}
Stancecoke needs to clean up his branch before the merge to master.geofft said:Thought I'd better just mention that the current github master branch seems to give no to response to PAS input - this is with throttle/pas mode selected. Have double-checked my config.h settings, all seems ok....
casainho said:Stancecoke needs to clean up his branch before the merge to master.geofft said:Thought I'd better just mention that the current github master branch seems to give no to response to PAS input - this is with throttle/pas mode selected. Have double-checked my config.h settings, all seems ok....
Geofft, thank you for testing the new code from Stancecoke. If it works best, let's use it![]()
casainho said:Stancecoke needs to clean up his branch before the merge to master.
Please look at the list I wrote before. At top of my head, try to not remove my implementation for my mod and also remove the printfs even if they are commented, to keep the code clean and easy to read.stancecoke said:What are your concerns?casainho said:Stancecoke needs to clean up his branch before the merge to master.
casainho said:try to not remove my implementation for my mod
I am waiting an answer from BMSBattery, they told me they would contact their engineers and also the producer.stancecoke said:Will you ever use your mod of the BMS-Sensor again, after breaking two bottom bracket axles???casainho said:try to not remove my implementation for my mod
To be honest, I'm not motivated to put any further work on this branch.
Also I am waiting for the photos and experience with Sempu torque sensor.