Closed Candas1 closed 10 months ago
Hello. first of all, after buying the hover board, I replaced the processors with dg32 and uploaded the software from flo199213 it worked fine. that's how the wheel on the main board worked in SIN, Test video. Phase current measurement was not included in the software at that time, and I had problems with communication between the boards, I had to make slight changes to the code, finally the board was controlled by uart with esp32 but there were no FOC modes. Then I decided on stm32 because of the closed loop FOC. Which is a better solution in my case.
I created a new definition 2-7 with my outputs. The compilation was successful.
I had to add [env:STM32F103CB] in platform.ini
I'll let you know if it works when I get home.
Don't hesitate to ask questions, it works in a bit different way. And use a power supply, this is still work in progress. It's missing features from Eferu, but it's easier to maintain/contribute to, and has a community.
I tested the software. The wheel began to spin. Made noises like COMM_CTRL mode in Eferu firmware. And I noticed that the mosfets wire and coils in the motor were very hot. You may still need to check and adjust the settings.
Have you used the dev branch ? Yesterday I updated to reduce the frequency and increase the deadtime (I think it's too low with STM32 because of a bug)
Yesterday around 3 pm I downloaded Dev branch from you.
ok I did changes later, you can try
ok i will try but later i have to go to work 😎. I still need to learn how to use github, because I don't know a lot of things yet.
no worries it's not urgent I am also learning SimpleFOC at the same time. This library will let us also use Encoders
I tested again and there is an improvement, the wheel turns smoothly, but I can't understand many parameters, I tested various target parameters from 0 to 100 and even set -100 😎 (it was an error). The main thing is that the slower the wheel rotates, the more current goes to the coils, in my case it is over 18A at target = 15, and at target = 100 the current is 7.5A. My engine package gets very hot. Mosfets are also warm, but not very warm. Please tell me what changes the BLDC_CUR_GAIN parameter and how to adapt it to your disc. Maybe the maximum motor phase current is set somewhere? Physically, my board has the same phase current measurement as from the Eferu software. and sometimes I had to help the wheel start turning. Best regards and I'm waiting for further developments.
So you are using my dev branch, but with your define.h ? Use my latest code so you are in voltage mode for now and I added a filter for the target. When this works well we can check FOC.
I use this parameter which is the default, it should be the same as Eferu. This should be same as your power supply voltage.
If you change this as:
motor.sensor_direction = Direction::UNKNOWN;
//motor.zero_electric_angle = MOTOR_zero_electric_offset;
It will output the sensor direction and zero_electric_offset, it should be CCW and 2.09. But as it runs smoothly I think it should be the same as me.
This is the maximum target voltage you should request, after that it will saturate.
Yes I used your branch. I created my Define.h with my pinout. I saw that in your code it was set to 26v and I did not change it. I only changed BAT_CELLS to 10 and changed the motor limit voltage to * 0.28 and the current dropped. cool. test video.
in torques Control type:: foc_current the wheel consumes 5.5A with the motor.voltage limit setting 36 * 0.14, you can see that it does not spin as smoothly as in the voltage mode
so voltage mode is working correctly. In foc_current mode, I reduce the motor.voltage_limit 5-10% because we need enough low side ON time for current sensing.
If you comment this line, the current sense align with run at startup.
You should get status 3, which means the pins for phase currents are correct, and gains are inverted(this is the same with Eferu). I didn't tweak the shunt resistance (we don't have a shunt, we use the mosfet's RDson), and the gain. What you request in this mode is not was you read on the power supply. I am requesting like maximum a target of 0.5 with no load. If you brake with your hand and increase you should feel the torque increasing.
I use this nice tool to check the offsets and that the waveworm is fine. (there is a config file in my repo already, you can make the sample period 1ms).
I checked the variables currents.a, currents.b, currents.c with STM studio. of course in Foc mode and current sense bypass is turned off. the readings were at 0 and did not change anything. Do you have any suggestions on what might be wrong?
I tried all combinations of phase current reading pin connections. the effect is unchanged
Sorry I missed to reply. For me it just works. What status are you getting from the current sense align ?
no problem, I had a little problem with the board, currently trying to implement two sets of 4 wheels, I had a problem with the software. I don't know why, but after uploading the fresh, new STM, the program didn't work. it hung on some parts of the code, but the strange thing is that everything works on old STMs.
how to check status?
Sorry I completely overlooked this discussion.
Variant
None
Control type
None
Control mode
None
Description
Hi,
I am not sure if you tried already, but simpleFOC would work on your board. The last few months I have been working on writing PWM and Current sense drivers for GD32 chips so it can be used with simpleFOC. I am active on the dev branch here, it's still work in progress but I tested it on both gd32 and stm32(single motor). Ideally in the future this would support different boards with different chips via variant files.