-
Notifications
You must be signed in to change notification settings - Fork 27
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.1.15 (ex2.17) - GD32F130C6T6 - Another layout #44
Comments
Only test with a 2A cc constant current power supply!!! C6 instead of C8 means only 32 kB instead of 64 kB. Our simpleFOC firmware has become far bigger then 32 kB, so there is little chance that code optimization will ever bring it below 32 kB again :-( This gen2.x runs nicely with 32 kB. I can not open your private-user-images.githubusercontent.com- images. Concerning MM32SPIN see the 2.8 issue. #22 Please make a pull request with your defines_2-17.h (I guess that is the next number). |
Untill you have found the correct SELF_HOLD pin you can bridge the onoff button to keep the board powered. currentDC and VBatt can wait until you have serial communication to esp32 or likewise. Thanks for pictures of the gotrax housing. So others will know what is inside from the outside :-) |
Please upload photo with the cables attached so we know what the headers are meant for. |
I was able to get this layout to work using REMOTE_DUMMY. I put up a PR #45 with my changes. I tried to get serial output using the arduino but I am still getting junk... even with nothing connected to the arduino using the TestSpeed.ino. This behavior is strange. I tried different pins on the arduino and I am still getting junk characters so I am still trying to figure that out. |
When I am running REMOTE_DUMMY, should I be able to connect an arduino to the UART0 TX/RX and GND and see output output? Also, I connected a logic analyzer (I don't have an osciliscope) to UART0 TX/RX when running REMOTE_DUMMY and it is showing high when I power on but there is no digital signal otherwise. I am guessing that I am missing something stupid. |
RemoteDummy does not have uart communication! |
#44 Layout2-17 remote dummy working
After a lot of tinkering and learning/hacking I figured out that this layout doesn't have USART0 accessible on the PCB. After defining USART1_Remote with the proper pins I was seeing bits transmitted when I connected my logic analyzer. Using the TestSpeed.ino sketch I was still not able to get anything but garbage on my serial monitor when connected to my Arduino Mega. I discovered that the SoftwareSerial library might be causing issues so I switched over to hardware serial defined as Serial1 which uses pins 19, 18 (RX/TX). After making that change, I was able to get the TestSpeed to start controlling the motor. After that I was able to figure out a few more of the ADC defines // ADC defines
#define VBATT PB1 // Confirmed AndyShmandy 12/22/2023
#define CURRENT_DC PA7 // Confirmed AndyShmandy 12/22/2023
#define SELF_HOLD PC13 // Confirmed AndyShmandy 12/19/2023
#define BUTTON PB2 // Confirmed AndyShmandy 12/19/2023 I will do a PR for my changes to this layout. @RoboDurden Thank you for your help with this! |
-Confirmed a few more ADC defines. -Updates some comments for this specific layout -Added photo of the slave board and confirmed that there are no LEDs
I added a PR for #46. Thanks again! |
No way to access pb6 and pb7 ? Some other user recently had problems with RemoteUartBus but I live outdoors and can not test any hardware for the next weeks. |
You even unsoldered the MCU ? There are uart0 alternatives, target.h:
maybe you can make use of PA14 and PA15 |
No, the only thing that I left unsoldered is the single optical sensor in the middle of the board that was used to detect 'foot on hoverboard'. In the image above, (using Gimp) I just had the opacity set to 50% so you could see both sides of the board and that PB6 and PB7 don't go to vias on the bottom of the board. The image you are showing above is from the Razor layout 2-16 #42. For this layout, the IMU is traced to pins PB10 and PB11 When I get better at soldering, I may try to attach to those pins directly. There are a few more "broken" free hoverboards that I am going to pick up so we will see what those boards look like. I am learning so much and having so much fun with this. Thank you! |
When you have finished with your nice pin tracings, please make another pull request :-) |
I tried to get REMOTE_UARTBUS working on this layout but I am not having any success. Since it doesn't have a second uart available, I have the config.h set:
In defines_2-17.h
After flashing with this change, when I connect my logic analyzer to USART1 and turn it on, both chanels (RX and TX) go HIGH and stay until I turn it off. That behavior seems strange. When I have it configured for REMOTE_UART, I see it sending data. It seems like REMOTE_UARTBUS doesn't like USART1... just a theory. On the other end, I wanted to make sure that the ESP32 can send data to the hoverboard. I hooked up my logic analyzer and it showed data on the TX channel and nothing on the RX as expected. Even though the hoverboard side doesn't seem to be working, I decided to hook the ESP32 to USART1 on the hoverboard. It didn't work. :-(. I will try to dig a bit further in the code of the remoteUartBus to see if I can figure out why it isn't using USART1. By the way, I probed USART0 pins (PB6, PB7) using the logic analyzer and it didn't appear to be sending/receiving any data and the pins stayed LOW. My next step in troubleshooting will be to define USART0 and configure it for USART0_REMOTE and probe those pins to see if I see any bits. Unfortunately, those pins don't even have traces on this board. Any thoughts? |
Be aware that i updated the repo today because the TestSpeed Arduino example had an outdated hoverserial.h library that did not work with UartBus ! That was the issue that made UartBus not work for that other user. Now it is working fine for him. |
I was using the updated hoverserial.h. After a lot of troubleshooting I was able to get it to work using REMOTE_UARTBUS. I discovered that the RX/TX pins that are set in TestSpeed.ino for ESP32 are actually GPIO pin numbers that may map to different pins on the ESP32 PCB. On my "ESP32 Dev Module" the GPIO 16, 17 are labeled 27, 28. I may put up a PR that adds a comment to that line so that all of the time I wasted won't be wasted by someone that is dumb like me ;-). I am going to see if I can get a second one working on REMOTE_UARTBUS as you show schematic in the readme. Do you know of any code examples for steering that takes input from a potentiometer? |
AnalogRead on the esp32 side and then map the 0 - 4096 to fSteer = 0.0 - 1.0 Then speedL = (1-fSteer)* iSpeed |
Awesome!! Thanks! I'll give that a try. I added a PR to clarify the GPIO port vs PCB pin number that I was confused by (#47) . I won't feel bad if you close it without merging. |
Good news... I was able to get this working and control the speed and steering using potentiometers. After that success, I tried something a bit more challenging and I figured out how to remote control this thing with my RC airplane transmitter (Flysky FS-i6x) and receiver(fs-ia10b) connected to my ESP32. At this point, my biggest problem is that the battery junk so I only get a few minutes on a charge. |
Hello @RoboDurden! I have yet another board layout that I would like to try to get working. Please let me know if you think it is capable of FOC. It is called a GoTrax SRX Mini. It is using a GD32F130C6T6 MCU.
I created a new layout and made the necessary code changes and I was able to compile and flash just fine (after doing removing the resistor and adding the wire to NRST as shown in the readme for the ST-link v2). The problem I am having is that the power isn't staying on. When I press the power button I get a chirp from the buzzer and it seems to reset so it appears that REMOTE_DUMMY doesn't even have a chance to start.
I removed several of the components (Buzzer, optical sensor, and capacitor) temporarily in order to better trace the board.
I am having difficulty identifying the following:
SELF_HOLD
BUTTON (I am not certain that I have it mapped correctly) PB2?
VBATT
CURRENT_DC
By the way, I have another board that is very close to this one but it uses the MM32SPIN MCU (see 3rd board on issue #38).
The text was updated successfully, but these errors were encountered: