Jump to content


Full Members
  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by electric_vehicle_lover

  1. Firmware

    So I tested the FOC of this dirty cheap motor controller: https://opensourceebikefirmware.bitbucket.io/Various--Endless-sphere.com_forum_messages--2017.10.23_-_FOC_and_no_FOC_comparison.html 2017.10.23 - FOC and no FOC comparison The next information is about the results of using “very low resolution FOC”. On the tests I run the motor with or without “very low resolution FOC”. The motor was providing the same mechanical output, was running at the same speed 16km/h and with the same load (on a bike training roller). With “very low resolution FOC” As we can see, the phase B current is aligned with the all sensor signal, meaning the Id current is zero and IQ current is max. The phase B amplitude is 0.94V that represents a current of 5.8A. Without “very low resolution FOC” For the motor to be able to run at the same speed 16km/h as on the first test, the PWM duty_cycle / energy had to be increased. The phase B current is not aligned with the all sensor signal (and this misalignment varies with motor load and speed), meaning the Id current is not zero and IQ current is not the max possible. The phase B amplitude is 1.2V that represents a current of 7.4A.
  2. Does BT Telemetry Impair Control Circuit Response?

    On the firmware I did and I am developing, for Unicycles or EBikes https://opensourceebikefirmware.bitbucket.io/ the UART/Bluetooth communications interrupt have lower priority than the motor control interrupts. The motor control interrupts like the PWM interrupt have the top priority so the motor control code will always run! Here is my current firmware for the motor controller and communications controller: while (1) { // because of continue; at the end of each if code block that will stop the while (1) loop there, // the first if block code will have the higher priority over the others ui16_TIM2_counter = TIM2_GetCounter (); if ((ui16_TIM2_counter - ui16_motor_controller_counter) > 100) // every 100ms { ui16_motor_controller_counter = ui16_TIM2_counter; motor_controller_high_level (); continue; } ui16_TIM2_counter = TIM2_GetCounter (); if ((ui16_TIM2_counter - ui16_communications_controller_counter) > 150) // every 100ms { ui16_communications_controller_counter = ui16_TIM2_counter; communications_controller (); continue; } ui16_TIM2_counter = TIM2_GetCounter (); if ((ui16_TIM2_counter - ui16_throttle_pas_torque_sensor_controller_counter) > 100) // every 100ms { ui16_throttle_pas_torque_sensor_controller_counter = ui16_TIM2_counter; throttle_pas_torque_sensor_controller (); continue; } } https://github.com/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/blob/master/motor_controller_low_level.c https://github.com/OpenSource-EBike-firmware/BMSBattery_S_controllers_firmware/blob/master/communications_controller.c
  3. Firmware

    Yesterday, I did the very first ride on one EBike, with OUR OpenSource firmware -- and I was happy because my son was the first to see and try :-) And 3 days ago, XenonJohn just post a video where it shows how he is building an EUC using Arduino + a brushless motor controller:
  4. unkown board gyro calibration

    Lucky you because that boards seems to be a MicroWorks 30B4: https://eggelectricunicycle.bitbucket.io/MicroWorks_30B4_board.html There are 2 pins for calibration, at least for what I remember. Don't remember now which was them but search on google for the board name and calibration!!
  5. Firmware

    Just recorded some minutes ago -- the video shows the motor running using my lab power supply (that can handles max of 10A). Firmware was limiting the motor max current to be about 8A. Motor max speed is 45km/h when the wheel is on the air. This controller family supports from 0.25kW to max of 4.3KW (72V, 60A), which should be ok to implement vehicles like hoverboards up to motorcycles running at 100km/h!! Current motor interface implement the following methods, that can be used to control the motor and get his running speed value. This was tailored for EBike application but if anyone want to build a different thing like an EUC, we can help developing the firmware for that specific needs of the motor control. /***************************************************************************************/ // Motor interface void hall_sensor_init (void); // must be called before using the motor void motor_init (void); // must be called before using the motor void motor_set_mode_coast (void); // disable PWM output void motor_set_mode_run (void); // enable PWM output void motor_set_pwm_duty_cycle_target (uint8_t value); void motor_set_current_max (uint8_t value); // steps of 0.5A each step void motor_set_regen_current_max (uint8_t value); // steps of 0.5A each step void motor_set_pwm_duty_cycle_ramp_inverse_step (uint8_t value); // each step = 64us uint16_t motor_get_motor_speed_erps (void); /***************************************************************************************/ Another project developer implemented support the LCD and mobile app:
  6. Firmware

    Happy that we achieved the same performance as the original firmware (pretty sure the Kunteng developers also implemented that very low resolution FOC) -- here the tests the other developer did -- I have some more ideas to try improve the results :-) The new controller arrived today. I've done some measurements on the test bench with the original firmware. The effiency is worse at higher mechanical loads in comparison to the 12 FET Lishui (FOC sensorless)... With your SVM_4 (8bit) algorithm we seem to do quite the same as the original firmware
  7. Firmware

    Yes, I started with a very slow EUC and just after moved to the MicroWorks board.
  8. Firmware

    What do you expect from me now?? Don't wast your time anymore talking to me, because I will ignore you.
  9. Firmware

    I wanted to say they are dangerous (without comparing to EBikes). Wasn't obvious, I had to build, learn and ride to understand the potential issues - and over the time I read the forum messages about the faceplants on every EUC brand, it scares me. But I still like them but I don't trust to ride fast and so I see them more like a toy. The bicycle, I feel safe riding my Brompton at 30km/h and my big other electric at 45km/h - do not want to ride EUCs at such velocities.
  10. Firmware

    IMO after I realized that EUCs are more dangerous than EBikes, I started and moved to this project: https://opensourceebikefirmware.bitbucket.io/ Also the MicroWorks stopped to sell the board and told that EUC market decreased, which other sources confirm. EBikes market is huge and will keep growing!! I found that the current motor controllers are dirty cheap starting at 14€ and they potentially can be controlled by UART, using for instance an Arduino -- that is my plan, a good EBike motor controller firmware + a firmware to make the controller generic in the hope it can be adopted on the Arduino world where there is no such option, users keep using DC motors :-( Also I think an DIY EUC can be made using EBike components: direct drive motor + motor controller + Arduino + batteries.
  11. Firmware

    @KingQueenWong just did it!! The EUC1 motor controller board does FOC!! And this board is cheap and available. It misses UART bluetooth connection:
  12. Firmware

    I would say you are dreaming. I never compromised myself as also you never discussed your hardware/prototypes -- you were working alone, in your project. I will say again my motivations: I want to work on projects that will be adopted by many as possible and for that I believe the hardware needs to be very cheap and widely available. For instance, (at least until now) VESC hardware is very expensive (135€) and seems some shops have it out of stock. The EBike motor controller I am developing firmware for costs only 14€ and can be bought from many online shops, they always have them in stock. VESC is very well known on a growing market that is eskate and still costs 135€ and EUC market seems to be decreasing... EBike market is big and will keep increasing that is why I got much more interest on the firmware for the EBike motor controller, including more 2 developers, one that is actively developing the firmware, already bought a few controllers (but went to find the cheaper ones!!) and even built a test bench:
  13. Firmware

    My opinion has evolved over the time, just like development projects does when we get more and more information over the time. I already explained the reasons why I am not motivated to work with custom board and instead focus on a widely available and cheap already existing motor controllers. You are repeating the same arguments when I already did explain my motivations -- you are misleading and being unfriendly and that is the reason that I feel the need to ignore you; due to your behavior, it is now more and more clear to me that I would not want to work with you in a project.
  14. Firmware

    I resolved some bugs on the firmware and finally I have my both very different motors running with the very low resolution FOC. The EUC motor runs very well, I would say with almost equal to the OpenSource firmware on the MicroWorks 30B4 board. Video of my EUC2 motor running at 60V (yes, the S06S EBike motor controller did run at 60V and there is a version of this controller that runs at 72V): But the Q85 EBike motor runs badly and I am pretty sure it is because is a high eRPM motor!! The EUC2 motor runs at 125 eRPM, needs to draw the SVM/Sinewave with steps of 64us/using 125 points. Q85 motor runs at 480 eRPM wich is only 32 points to draw the sinewave!! I am pretty sure the issue is this, lack of resolution -- I can go now and try optimize the firmware, I have some ideas... anyway, the original firmware don't seem to run very well this motor, maybe because of this limitation... But the MicroWorks 30B4 board may have the same issue, since the PWM frequency is the same!! I think EUC motors have lower eRPM than this geared EBike motor. As for comparison, here is the MicroWorks 30B4 board running the OpenSource firmware with FOC:
  15. Firmware

    Good that finally you could understand that there are low cost hardware that does FOC ignoring motor flux and resistance -- that is what I did, after following Shane Colton documentation and firmware, for the OpenSource firmware to the MicroWorks 30B4 board. And for this Kunteng STM8 8 bits 16MHz EBike motor controller, I had to go even simplifying even more but it is still FOC, at least IMO -- anyway, the original firmware for sure does that so we had to figure it out and do it!! What I got today: No FOC, see the amount of current motor asks for the power supply: Now with very low resolution FOC, see the decreased amount of current -- the motor speed also increased But there are still some issues reading IQ current and the control results also in bad results sometimes, as seen the yellow phase B current is not a good sinewave:
  16. Firmware

    Sorry but you have no reason on this point - because the document from OnSemi that I linked and I am following "Field Oriented Control of Permanent Magnet Synchronous Motors" implements FOC and don't do any calculation of the magnetic fields, don't rely on know motor inductance and resistance values to determine magnetic properties. I am saying that I documented the theory math of "very low resolution FOC" and implemented it, following the concepts math of that OnSemi document.
  17. Firmware

    Why are you misleading?? Again: I did quote what I was talking about:
  18. Firmware

    I did quote what I was talking about: And my answer was: That is what you say but others like OnSemi and TI employees consider that is also possible not making that calculation. Seems you are not reading before answering.
  19. Firmware

    Yes, because would not be possible to do that calculation on this so limited microcontroller. But I found a simplification to read ID and IQ currents, avoiding the need to have a second phase current sensor and do clark and park calculations. I documented the simplification math here: That is what you say but others like OnSemi and TI employees consider that is also possible not making that calculation.
  20. Firmware

    See this document from OnSemi, with the implementation of FOC with only hall sensors, with tittle "Field Oriented Control of Permanent Magnet Synchronous Motors" that uses only hall sensors. I will keep calling FOC but explaining that is a "very low resolution FOC" in the case of this EBike controller that uses a 8 bits STM8 microcontroller running at 16MHz only!!, and only measures 1 phase current.
  21. Firmware

    See here that Texas Instruments employees consider FOC using hall sensors (you can find many other examples on Texas Instruments forum): And I just found this 8 bits motor controller as low as $17!! Every online shop sells them and everyone is happy because they find their motors silent and efficient, when compared to the 6 steps old generation controllers.
  22. Firmware

    FIRST TIME EVER having "FOC" (very low resolution FOC) on the dirty cheap EBike controllers with a 8 bits microcontroller STM8: https://opensourceebikefirmware.bitbucket.io/ Very low resolution FOC seems to be working with my motor (EUC2 motor, low eRPM, at power supply 45V) but I had to do the interpolation every hall sensor signal and now the motor startup ok and do ok the interpolation. My EUC2 motor, low eRPM, at power supply 30V. Next image: without FOC, angle keeps constant. First part, motor at max eRPM speed of +100 and using about -500mA of IQ current. Second part, also using -500mA but I was blocking a bit the motor, so it could not get the max velocity: Now with FOC enable and and just changing the velocity/PWM duty_cycle. We can see that FOC try to keep IQ current near zero: Now as before, but on second part I tried to bloc with my hand and we can see angle going decreasing to very low values while the IQ current then goes to near zero value (it takes sometime to go to zero value, needs a PI controller):
  23. Firmware

    Nice to see the news about VESC :-)
  24. DIY One Wheel build with Unicycle components

    One day we will have our OpenSource firmware and then we will be able configure that functionalities :-) For now we are working to develop firmware for EBike motor controllers, that after will work as a generic brushless motor controllers, for instance, to be controlled with an Arduino using UART commands. If you are interested, you can follow current project here: https://endless-sphere.com/forums/viewtopic.php?f=30&t=87870&p=1317106#p1317106

    I have 2 of them but I am keeping them as a recuerdo and also I played/hacked them so I don't have many confidence in them now :-) I hope I/we will be able to develop OpenSource firmware for EBike motor controllers and them be able to develop a DIY EUC version -- if you are interested you can follow our project here: https://endless-sphere.com/forums/viewtopic.php?f=30&t=87870&start=325 http://opensourceebikefirmware.bitbucket.io/