-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gen2.4.x = ALL about MM32SPIN0X (ex2.8 / ex2.8.1 / ex2.21) #57
Comments
@AILIFE4798 the link to the old issues just takes me back here. |
@RoboDurden blink code worked |
Good News. I won't drive for the next days, so I could do some programming. Did you make any modifications to the blink example in the Keil package ? If so, where can I download your project ? |
I will update my code later 8mb.video-LBm-lwBFqyNM.mp4 |
fuck that ill use youtube |
https://github.com/AILIFE4798/Hoverboard-Firmware-Hack-Gen2.x-MM32 |
@reed-dan also try it |
Recently I will work on driving motor and uart |
Better spend the time rewriting all the gd32 code and then add foc to it |
@AILIFE4798 , i have downloaded your HoverBoardMindMotion/ but when i doubleclick on
|
I do not really find Timer code and dma-adc code in
So if we get all this runing we should have the adc for VBATT and currentDC, the hall position and then instead of FOC the simple block commutation of gen2 to drive the motor :-) |
code updated with compiler v6 |
Until now noone have tell me if the code really can be run on other boards but at least on mine it can now self hold and working hall2led |
now i have tried to generate some pwm but so far only all 3 channel low side is conducting |
Yes now i can compile :-) The advanced timer TIM1 can be configured to drive the three low side mosfet and the three high side mosfet at the same time. I guess you will find the init procedure in the hall bldc example i mentioned. |
The hall foc example as well as my gen2.x both trigger the bldcClalculate when adc has finished. |
There is this ever ongoing discussion if ESP is 5VT or not.. |
i have fixed the file placement btw now timer1 working |
I am happy to see that you are already doing all the work, so i wait until tomorrow to see if you already succeeded :-) Please study the
|
@AILIFE4798 , where do you copy and paste your code from ? But hey good to see that you make so much progress so quickly :-) |
i copied from MM32SPIN0x_q_Lib_Samples |
it is easier to rewrite then to understand the code other people write |
aparently in debug mode you can only see int variable but not uint32_t |
maybe i will be able to get foc if the board you ordered for me have comparators |
serial with dma and interrupt now working |
the foc hall example is using timer2 for driving hall sensor |
I do not understand |
Sure you are running at 96 Mhz ? But yes, the SysTick_Handler indeed only seems to count milliseconds and not microseconds. Same for Gen2.x: |
i have mentioned at the very beginning there is no crystal oscilator hardware on the board so it cannot do accurate timing |
"RC oscillators aren’t really that bad. In fact, user guides for modern MCUs report internal oscillator frequency accuracies typically under ±10%, which can be fine-tuned to under ±0.5%. So the bottom line is that you will get away with a lot of applications if you don’t even bother fine-tuning the internal oscillator, and with most applications if you do." |
Maybe it is better to only set a thread variable RemoteUpdate() should be called in the main() loop, so having lowest priority:
|
I do not like that additional speedupdate function in bldc.c But anyway, if you move the |
|
ok the jerking problem is fixed |
What fixed it ? If you have stable uartBus I am willing to delete my mm32 repo and you can create it based on your code. Later this year when I can test with my own mm32 hardware, I might want to integrate your code into my gd32 firmware. But that will not have high priority. As you are far more committed to gen2 at the moment, I would be happy if you host the mm32 firmware . |
i moved the send back to master to main loop as you said |
If you publish RemoteUartBus binaries id1-4 on your repo, what would be the easiest way for newcomers to flash the binaries ? |
use pyocd because needed for unlock |
i really hope someone else can test this |
if you need remotedummy then define testrotate |
I will delete my mm32 repo tomorrow. Then I guess I can fork from your repo (you can not fork of a fork of a repo that you own). I might try to make the code compatible to my remoteXY structure and the defines2_x.h When I succeed I can make pull requests to your new master firmware :-) |
now theres a new define in pinout.h called constspeed |
and now speed limit of both direct control mode and constant speed mode is 1000~-1000 |
using dynamic pid i significantly increased the performance of pid controller |
If you still can't fork I can just delete this repo and open a new one |
I deleted my repo and now your MM32 is the master :-) But i will now drive some 20-30 km today, so i will start to rework your code some other day :-/ To get adc working you maybe start with a dedicated adc example and then find the missing code in the gen2 firmware.. |
@AILIFE4798 : Carrier note: Package delivered2024-02-06 17:42:01 GMT+8 |
i am using adc to count millis because i need it to be fast enough for my pid the systick is not gonna do |
i am not using dma adc now but i know that would not help because i have use debug to read the adc registers and value is also jumping randomly and not colorate with real voltage |
ok adc working now |
I was able to flash my slave 2.8 board and spin both in opposite directions today. |
if you had a mm32spin0x board please create a new layout and hopefully help us make the blink code run on it
currently the progress is 90% complete
motor and uart control works
https://github.com/AILIFE4798/Hoverboard-Firmware-Hack-Gen2.x-MM32
The text was updated successfully, but these errors were encountered: