Skip to content
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.2 (ex2.8.1) #59

Open
AILIFE4798 opened this issue Feb 1, 2024 · 114 comments
Open

Gen2.4.2 (ex2.8.1) #59

AILIFE4798 opened this issue Feb 1, 2024 · 114 comments

Comments

@AILIFE4798
Copy link

AILIFE4798 commented Feb 1, 2024

IMG_20240201_215601
IMG_20240201_215624
MCU:MM32SPIN05PFOP(32K)
Gate driver: uni u3116s
Voltage:5V!!!

No optical sensors is on this board
It is pin compatible with Layout 2.8

@AILIFE4798
Copy link
Author

the manufacture really said : fuck your foc im not gonna include an opamp for you

@AILIFE4798
Copy link
Author

Turns out mm32spin have internal comparator so it doesnt need one

@AILIFE4798
Copy link
Author

hoverv2 8 1_compressed@0 5x
@reed_dan i have traced the 2.8.1 can you verify it is same as 2.8.0

@RoboDurden
Copy link
Owner

@AILIFE4798 , This board really looks very different to 2.8. So i would like to assign a new number 2.21 to it.

It will not help new people to identify their board when 2.21 is hidden as 2.8.1.

Yes, i am okay if you want to do a standalone MM32 firmware. Maybe you would like to copy my PAxy pin/port mapping macros and the remoteXY.c structure.

Then i indeed would like to change the board numbering to Gen2.GD.x and Gen2.MM.y

@AILIFE4798
Copy link
Author

@reed-dan do you think this board is close enough to yours
it is manufactured by same company but the infamous lks32mc088 is also manufactured by them so it does not mean anything
the pins are not 100% compatible like led and button are not
tracing a mm32board took allot more effort then a gd board even without autodetect
so it is best to minimize the layouts
or seperate the mm layouts from gd ones

@reed-dan
Copy link

reed-dan commented Feb 7, 2024

@reed-dan do you think this board is close enough to yours it is manufactured by same company but the infamous lks32mc088 is also manufactured by them so it does not mean anything the pins are not 100% compatible like led and button are not tracing a mm32board took allot more effort then a gd board even without autodetect so it is best to minimize the layouts or seperate the mm layouts from gd ones

I think there are significant differences in the 2 boards. I think mine should be 2.8.0 and yours 2.8.1, but that is my opinion.

@RoboDurden
Copy link
Owner

A sub number like 2.6.1 should only be used if the boards are really like version x and x.1 of the same manufacturer and only a minor change in the defines2_6.h is needed like buzzer on slave instead of master.

I would like to assign 2.21 to the 2.8.1

@GRROWL911
Copy link

Hello all, I am new here and have a TaoTao 2130 series board with the MM32SPIN05pf. I have already traced most of the required pins, and just need to summarize the drawing. The board has a master and slave, which I have both, yet not traced the slave board yet. I am working on the testing of the pins based on the MM32SPIN05pf code you have already developed. I also have a new hoverboard with the lks32mc088 chips, master and slaves, which I hope to look at next. How do I create a new board definition? And, I am new to GitHub, so I do not know how to contribute my changes either. Sorry for being a newbie here.
IMG_0520
IMG_0521
IMG_0522
IMG_0523

@RoboDurden
Copy link
Owner

Great to have another motivated owner of some mm32 boards.

The mm32 firmware is developed actively by @AILIFE4798 .

If you succeed to unlock your board and are ready to upload a firmware, I am confident that he will make a firmware ready for your board.

Please take a look at our wiki here to connect a mm32 board.

This will be the most difficult part.

@GRROWL911
Copy link

RoboDurden, already unlocked the board, already tested the RGB and Headlight LEDs, working on the latching. Have the Hall and Gate pins sorted, all UART pins sorted. Testing bit by bit.

@RoboDurden
Copy link
Owner

@GRROWL911 could you please make a YouTube tutorial where you simply walk through all the tools that were needed to successfully upload a new firmware to the mm32 board !!!!

@AILIFE4798
Copy link
Author

@GRROWL911 you can disable latch and button in code to use a jumper to replace it
test the hall and motor first
if your hall and uart pin is not standard you have to wait im workng on support timer3 (already workng but code not updated) and uart2(tx working rx dma not workng)

@AILIFE4798
Copy link
Author

btw unlock mm32 just require keil and stlink v2 no aditional tool needed
some said its easier then the gd32

@AILIFE4798
Copy link
Author

everything in the wiki is bs ill make a video in the future how to use my firmware

because things change everyday im not gonna make video every day

@AILIFE4798
Copy link
Author

@GRROWL911 your layout is closer to @StomperQc 's lks32
do not have a comparator so not foc capable
but should work with current feature
please make a image like i did at my github repo with all the pins i will see
and PLEASE DO NOT CHANGE PINMODEAF IF YOU DONT KNOW WHAT YOU ARE DOING!!!
i already bricked my board with that

@GRROWL911
Copy link

@GRROWL911 could you please make a YouTube tutorial where you simply walk through all the tools that were needed to successfully upload a new firmware to the mm32 board !!!!

Once I get the board working and move to the slave, I'll try post some instructions. Basically, just the same as the Wiki posted using ST-Link and pyocd.

@GRROWL911
Copy link

@AILIFE4798 > btw unlock mm32 just require keil and stlink v2 no aditional tool needed some said its easier then the gd32
I was not able to unlock using Keil alone, would erase and fail to write. Using pyocd to do a chip erase worked, then just Keil.

@AILIFE4798
Copy link
Author

you need to choose erase full chip not erase sector

@GRROWL911
Copy link

@GRROWL911 your layout is closer to @StomperQc 's lks32 do not have a comparator so not foc capable but should work with current feature please make a image like i did at my github repo with all the pins i will see and PLEASE DO NOT CHANGE PINMODEAF IF YOU DONT KNOW WHAT YOU ARE DOING!!! i already bricked my board with that

@AILIFE4798 the LKS32 boards do look very, very similar, however I have not pulled them out of the HV yet, so no tracing. Once I have all the pins sorted and verified, I'll post the image.

@AILIFE4798
Copy link
Author

image

@GRROWL911
Copy link

you need to choose erase full chip not erase sector

@AILIFE4798 I am not sure how to set Keil up for that. I am using the VS Code edition and Keil for the first time, so I have no idea what I am doing. I've a lot more experience with the NRF52 world. I'd like to know how for the slave boards. I long ago bricked my other master board.

@AILIFE4798
Copy link
Author

i do not have lks32 yet so you are on your own unless you want to send one
not seen any for sell so far

@GRROWL911
Copy link

@AILIFE4798 any hints on the latch/button code, I have the bins traced, however the latch does not hold, and the button does not seem to be reading correctly either. I am working slowly and methodically since this is all new to me. If I cannot get the latch/button parts working, I will just move to the motors. I also need to figure out how to startup the slave boards as they do not have a switch.

@GRROWL911
Copy link

i do not have lks32 yet so you are on your own unless you want to send one not seen any for sell so far

@AILIFE4798 I'll look at them after I have these ones working.

@AILIFE4798
Copy link
Author

well since when im good at keil ?lol
the hardest part of keil is to download it
if you have done it everything after is easy
keilerasefullchippng

@AILIFE4798
Copy link
Author

idk both of my board latch an button is working fine
make sure it is not commented out because then it will get bypassed by my code
i think you just traced it wrong
latch and button is not easy to trace

@GRROWL911
Copy link

well since when im good at keil ?lol the hardest part of keil is to download it if you have done it everything after is easy

@AILIFE4798 I have not yet found any settings pages in the VS Code edition. I already had VS Code from my NRF52 boards, so adding the Keil extension was very easy. That was the easiest part.

@AILIFE4798
Copy link
Author

if you need to download full keil ide download from filecr
using pyocd is also ok

the reason board is bricked is the pinmodeAF does not exist
when you change the pin you must change pinmodeAF to correct one

@AILIFE4798
Copy link
Author

using slave board is very very hard my layout2.20 is still not working
easier to unbrick the master boar

@RoboDurden
Copy link
Owner

Slave board normally gets on when it receives +5V (or +15V) on the master slave uart cable.

Good night from Germany

@GRROWL911
Copy link

GRROWL911 commented Feb 15, 2024 via email

@AILIFE4798
Copy link
Author

fixed and code updated
i cannot fully understand the code above what does question mark mean but the itotal is signed int it should be alright without

@AILIFE4798
Copy link
Author

@GRROWL911 now i have sucessfully run my board at 72mhz and code updated, but now UART does not work(ofcourse it doesnt because baud rate is wrong now)

@AILIFE4798
Copy link
Author

the PWM frequency is increased 9 times for free without losing resolution

@AILIFE4798
Copy link
Author

and i have found a bug in the startup, so that the UART1 is using APB2 runs at sysclock , but UART2 is using APB1 and APB1 is set to half of sysclock so it does not work before

@AILIFE4798
Copy link
Author

and now the code brick spin06
they are probably not compatible like i thought

@RoboDurden
Copy link
Owner

So both your spin06 master and slave are now bricked :-/
Such things happen to me all the time :-)
If you will need a seperate target vor spin06, then the board would also get a new layout number.

@AILIFE4798
Copy link
Author

i will use define in the system file
the startup is only for 06 and to make 05 work i edited it then 06 does not work any more
now i have added define so you can change it

@AILIFE4798
Copy link
Author

Ok now 72mhz clock working on both 05 and 06
Pwm frequency is much higher now there's not much noise at 8192 resolution
UART1 works now there's another bug in hal_rcc library but I temporary fixed it
UART2 still does not work who knows why

@GRROWL911
Copy link

GRROWL911 commented Feb 15, 2024 via email

@AILIFE4798
Copy link
Author

i have now copy ITOTALADC2 to signed int but without the if..else
it should be ok

@RoboDurden RoboDurden changed the title Layout 2.8.1 Gen2.4.2 (ex2.8.1) Feb 18, 2024
@AILIFE4798
Copy link
Author

incase anyone still struggling to trace the pins @GRROWL911 @RoboDurden autodetect with self programming feature is online now
the matching normal firmware that can read the programmed config is not yet finished but it will be in 2 day

@RoboDurden
Copy link
Owner

Great if it works :-)

Yet I do not really see that your autodetect.c is easier to understand than mine.

You at least could have adopted structs instead of uint32_t pins[33][3];
And way too many numbers in switch cases instead of enumerates or defines.

But if you stay committed to your firmware we are happy to have you with us :-)

As i still have no mm32 test setup nearby I would love to see a video demonstration. How do you detect the selfHold pin ?

@AILIFE4798
Copy link
Author

i know my firmware is not easy to understand but i dont think you need to understand autodetect
i did try my best to make it better but its all i can get
i will make the main one easier to
and now the testrotate is handled in autodetect it can also be removed from main so less defines clutter

@AILIFE4798
Copy link
Author

it worked on my 2.8.1 without tuning values but its good if you would also test it

@AILIFE4798
Copy link
Author

if you want to request feature also can but im already at 25k

@RoboDurden
Copy link
Owner

There are already some users here with mm32 boards. So a YouTube video with a walkthrough and a demonstration of your eeprom feature might motivate some to test it.

You can use ai text2speech if you do not want to speak yourself . Or only subtitles with nice techno music :-)

@AILIFE4798
Copy link
Author

i will make a video,but after its more complete
i always used ai voice in my videos cuz i cannot speak english

@RoboDurden
Copy link
Owner

25k :-(
I had dreamed that the mm32 libraries are more optimized when you mentioned these extremely low code sizes.
So only the autodetect.c boosted your code size by 10k ?

@AILIFE4798
Copy link
Author

if you have used my firmware you will know why its so large
the amount of strings in it is just not designed to be optimized cuz i dont have to
with eeprom self programming autodetect can be seperate without user needing to compile them self so allinone is not needed
so i can use fancy ui without worrying too much

@RoboDurden
Copy link
Owner

I am still skeptical that my autodetect will ever succeed 100% with all boards.

The selfHold and currentDC autodetect is too tricky for that.

So your eeprom feature is not that important for me and I probably will stick to the defines_2-x-y.h files.

I also want to make them compatible to my platformIO simpleFoc firmware..

@AILIFE4798
Copy link
Author

if autodetect failed, theres last resort
image
and with command line you can modify things like slave id which you will need to anyways

my self hold is 100% reliable believe it or not(acidently detecting button pin doesnt count)
it can even detect self hold pin when powered from stlink connected to usb the tiny voltage drop is enough

i already said currentdc detection is bad idea so i didnt implement in my autodetect

@AILIFE4798
Copy link
Author

my autodetect do not need bridge on power button just use itwith a button itll detect the latch silently on startup

@AILIFE4798
Copy link
Author

and i have implemented self hold button pin fix in my firmware but need user intervention

@RoboDurden
Copy link
Owner

I do not understand your last two comments. A video explanation would be better.
But I do not have time to optimize my autodetect for the next two weeks anyway.

@AILIFE4798
Copy link
Author

i will only make video after the main firmware can use the result of autodetect

@AILIFE4798
Copy link
Author

maybe i can make a shit quality video for you to watch first

@RoboDurden
Copy link
Owner

No I happily wait a little longer :-)
I want to see the eeprom with the two distinct firmwares see in action :-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants