-
Notifications
You must be signed in to change notification settings - Fork 29
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.4 (ex2.3) #20
Comments
This is a bad translation engine, surely not Google ? I guess it was me who did add the 2.3 layout so i might have such a board laying aorund somewhere here. |
Hi im new here but i also have one of these Hoverboards. |
If you have a new layout, please post some hi-res photos here. Yes, slave board can be flashed with the master firmware. But it needs the CHECK_BUTTON define to be disabled whenthe slave board ist dircetly powered and has no on button:
|
Im currently working on the pinout. Sadly the firmware woult be pretty useless to me without eiter ADC or PWM control. I dont know much about Github so i will post my results here when im done. |
ADC would not be a big problem. PWM would need some few timing calculations to translate the high/low times to a pwm ratio.. If your board is not the layout 2.3 that this issue is dedicated to, please create your own issue and attach high res photos there so i can assign a new layout number. |
Would be nice if you could uplad an aligned fornt/back image like 2.7 front-back |
Above is the code of my configuration but not everything is ok any ideas ? Sorry for the translation but I have a hard time with languages :) |
Always use a CC constant current power supply with max 2A when testing new boards !!!!!!!!! |
I powered it initially via inverters to limit the current. |
@DerPinguin77 i do not see a seconde uart header on this layout :-/ In the bottom left i see a 4 pin header with The 4 pin header to the top right i guess is the charging connector ? I stick to my understanding that adding a cheap ESP S2 Mini with bluetooth and wlan is always the better choice. |
@mateuszfcg i have added your @DerPinguin77 if you have a constant current power supply it would be great if you start testing the new I will check the defines later this day if they confirm with your drawing. P.S. the two photo sensors (light barriers) on the backside could be used as digital inputs. The last board i tested allowed one input to be used as analog input. |
okay i updated https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/blob/main/HoverBoardGigaDevice/Inc/defines_2-3.h Am not sure if the ordering is right:
I added the led pins by looking on the photo:
I disabled both uart ports.
Please someone check the rx tx pins of the white uart header below the GD32 MCU :-) |
Hi, came home from work just now. I think it would not be a problem if each of those boards only had one free input pin. It isnt as nice but you could just use the one pin of each board to control the motor connected to it. I can understand that for robotic projects the esp uart thing is much more practical, but I would prefer to use the board standalone without any extra stuff, cause I just need basic speed control. |
This nice guy just today added rc remote control which i will implement tomorrow: #24 Then there will already be two different control methods. Indeed you are correct, if we only have one input pin per board, the slave could transmit the steer value to the master, the master calculates the speedL and speedR and send the speedR back to the slave :-) Be sure to use a 2A cc power supply (or a dc dc step down or up converter with cc). |
Hi i probed all the other mentioned pins now. Here is the updated picture: Also the steering feature is not really impotant to me. I just need to be able to control the different motors speeds seperately, so they dont even have to be connected via uart. |
yes i think that is the correct download. |
The yellow wire is the pin of the second Infrared thingy. I think it would be possible to remove the resistor that pulls the red pin high. |
yes, but i am not sure if Keil will be able to unlock the MCU.
Then i will look in the MCU user manual to see if one of these pins can also do adc. |
@DerPinguin77 1. unlock the GD32 via ST-LINK Utility (this will remove the preloaded firmware) And getting back to the topic of the UART the white connector is: So far I have established a connection to the Arduino with these pins. I still have a problem with VBat and IAMP. No matter what voltage I put on the power supply it is still Iamp=0.42, IVolt 36.0 in the serial monitor. Another issue is the hold up when a button is pressed. The button is definitely on PB2 @RoboDurden |
Thanks, so no adc on these pins. So you use
and |
0.42 is because of bldc.c :
|
36V also set in bldc.c
|
If you indeed have serial connection between arduino and hoverboard please post your new values of:
|
defines_2-3.h
commsStering.c
However, I would like to know the current and voltage reading of the current |
Then you need to find the correct adc pins:
|
Why did you uncomment
it is no longer used in my code. |
I will upload my code in the evening. |
Im sorry i am just dumb. I forgot to build the software after changing the version, so I always flashe the software for the wrong board. Now it is working. In my case the one of the leds is not lighting up and it younds like its skippikg steps so maybe its a problem with one the hall sensors either in software or on the hardware. I will try another motor and let you know. |
Yeah i tested it and the motor is fine. But I think may be something messed up in the code with the hall sensors. |
@DerPinguin77 you really should start using your brain.
Which color ?? And by now you should be able to turn this led on in main() using DEBUG_LedSet(SET) And when you are sure the led pin is correct, |
@RoboDurden Im just trying my best. I have never worked with this Software nor programmed anything in C. I thy my best to help with stuff that I can do like for exampe measuring stuff, or suggestions that i can give (maybe theire dumb or wrong but i try my best). |
Check if you have it running. In my case the LED pointing was not working so I added simple code. Another issue maybe something is defective with the control of the orange LED. Try swapping pins, e.g. red and orange, to see if it lights up |
Hi i think i found the problem. The hall or the motor pins seem to be swapped. In the Video you can see the "wrongly" connectad motor phases to make it work. Motor_test_2.mp4 |
Hi,
For the last one I just copied the code from @mateuszfcg I also got the UART control running with the ESP and I was able to control the motor with a poti. This is my defines 2.3.h:
|
Great you succeeded with the motor pins, led pins, esp32 communication and also adding a potentiometer to the ESP32 :-)
of which you have traced 7:
PA3 and PA4 are already taken for BUTTON_PIN and HOLD_PIN That leaves 5 pins to test wise assign to
and read the log data from the ESP32 while changing the voltage of the power supply. I guess that PB0 and PB1 will be the mosfet lowside gate currents. So i would start with PA5 to be the battery voltage:
|
I have already tried those pins but i only changed the VBATT_CHANNEL ADC_CHANNEL. I was afraid to break somethin because of the uncommented comment. So is it safe to uncomment this line and try all the pins out? //#define VBATT_PIN GPIO_PIN_0 // uncomment this line when you have verified the pin/port |
i have updated my pervious comment ! if you do not uncomment the VBATT_PIN definition, no battery voltage will be calculated in bldc.c :
|
So i tested all of the 7 traced pins. The voltage pin is definetly right. I tested it with different voltages and it was only about 1V off. Maybe it need a little calibration. // ADC defines I also have another question. What is the max value you can send over uart for the maximum speed? 1024 or something different. Also how fast is the motor supposed to be at max speed? I also made a Video of the Serial Monitor WhatsApp.Video.2023-10-01.um.20.58.22.mp4 |
log data looks good to me. speed can go from -1000 to +1000 |
If you do not measure 5V on the DATA pin or the two PHOTO pins, you could try to replace
with one of these three. And see if the ESP32 is still able to control the speed. But the ESP32 should not really be connected to a pin that is pulled to +5V by the hoverboard controller ! When you succeed with hte RX pin you could try the remaining two pins for
and see if the ESP32 is still receiving log data. The uart header you currently use is normally meant for the master-slave communication between the two split boards. I just noticed, that the ESP32 S2 only seems to have two hardware serial, the first normally used for log output. The PHOTO pins might need an unsoldering of the photo light barriers. But maybe the pins will already work for rx or tx without unsoldering them. |
Sorry for my late reply. I didn't have much time last week and I dont know how it will be next week. If I find some time i will test the PHOTO pins and let you know. I will try to help as much as I can. |
I was away from home for a while so I couldn't test anything, but today I sat down anyway: |
@RoboDurden |
At the moment you do not use the steer command.
|
Ok I didn't think about that. And actually what is the steer variable used for ? |
|
There are different sets of pins available for USART0 and USART1 i think. But yes, no free re-asignment like with the ESP32 i fear. The 2.0 layout uses
Possible RX pins for USART_1 would be PA3, PB0 and PA15 but they are all used already for the 2.3 layout. USART0 is the 2.3 mater/slave header which we currently use for steering:
Luckily these two pins are also used for I2C. I am not fully happy with that i2c firmware as you need to restart the hoverboard once the i2c connection fails. It might be possible to use multiple slaves with the USART0 protocol ??? The ESP32 (master) would not only send |
Okay, serial communication from ESP32 S2 Mini works and master-slave also works. In config.h you will have to choose between three possible modes:
Now i could try to connect both boards via the only one available usart to the ESP32 as i have suggested above. like i2c. |
In the Arduino IDE there is a library "software serial" maybe something like that could be used here, then we could use the stlink programming pins |
Yes :-) and it works nicely:
I will only upload to my github repo when i have tested the code with a test setup that has two usart buses. But you can download my work here: arduino code:
config.h :
by software, up to 255 split hoverboards can be connected to the bus. enjoy :-) |
Hello. Has anyone run the disc version 2.3? At first I had a problem with uploading any batch, but I managed to do it for a while. now I have trouble starting it. when I connect the power supply, the engine only starts slightly and holds it in one position. I cannot establish communication with Arduino. I tried on different GD pins. please help. Does anyone have the file already configured for this disc? Regards
The text was updated successfully, but these errors were encountered: