Git Product home page Git Product logo

Comments (8)

Candas1 avatar Candas1 commented on August 28, 2024

Hi,

As you insisted, I thought this was relevant and tested code.

I will need to clean it up now.

from split_hoverboard_simplefoc.

RoboDurden avatar RoboDurden commented on August 28, 2024

Well it was relevant and tested code when i made the pull request.
But as you said you would not accept it, i began to continue with my fork..
Luckily i have not pushed my recent testings for quite a while, so what you got is still quite good for your repo :-)

from split_hoverboard_simplefoc.

RoboDurden avatar RoboDurden commented on August 28, 2024

Dear @Candas1 , as you probably remember my rude words for nice Emanuel Feru, you should know that i for sure am not an easy character - my nick name (alter ego) Robo Durden is a tribute to Tyler Durden !!!
So for sure never do anything only because i "insist" on it.
And as i try my best to be a born loser ('it is only after we have lost everything that we are free to do anything" - Tyler Durden), i never really insist on anything :-)

from split_hoverboard_simplefoc.

RoboDurden avatar RoboDurden commented on August 28, 2024

thanks @robcazzaro for the reminder that Gen1 is stm32 and we do not need two motors with our Gen2 GD32 port.

I have made some progress with running simpleFOC on my Gen1 test setup:

MOT: Monitor enabled!  
Split Hoverboards with C++ SimpleFOC :-)  
driver.init() succeeded :-)  
MOT: Init  
MOT: Enable driver.  
MOT: Align sensor.  
MOT: Skip dir calib.  
MOT: Skip offset calib.  
MOT: No current sense.  
MOT: Ready.  
setup needed ms: 3308  
0  
TIME_SEND  
0  
0  
0  
0  
0  
0  
1  
1  
1  
1  
1  
1  
2  
2  
2  
2  
2  
3  
7

Don't know why execution hangs/resets at

  oKeepOn.Init();
  oKeepOn.Set(true);  // now we can release the on button :-)
  oOnOff.Init();

But i for now have disabled that functionality by simply

// Self hold defines
// Set output high to keep the latch ON. Set low to turn the board OFF
#define SELF_HOLD_PIN TODO_PIN	// PA5	// OFF_PIN

This is how i was able to activate UART3 debug output:

  #if HOVER_GEN == 1
    //HardwareSerial oSerialSteer(PA3, PA2);  // long cable NOT 5V tolerant EFeru USART2 GPIO Configuration
    HardwareSerial oSerialSteer(PB11, PB10);  // short cable 5VT EFeru USART3 GPIO Configuration
    #undef DEBUG_UART
    #define DEBUG_UART oSerialSteer
  #endif

https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/blob/main/src/main.cpp#L19

@Candas1 , if you have not yet worked on your repo since accepting my old pull request, you might want me to clean up my current fork and do another pull request.

But the simpleFOC does not yet work on the Gen1.
In the debug log you see the millis() of every loop(), so the code is running.
But quickly a constant overcurrent of 1.6A (limit of 1.5A set with my little power supply), the motor makes a little buzzing noise and voltage drops from 25 to 21 Volt.
With a current limit of 1.0A, the mcu reboots.
Do not really want to increase the current limit. 1.5A should be well enough to make the motor startup.

I have to check the https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/blob/main/include/defines_1-0.h to make sure i got all pin assignments correct from the EFeru defines.h

Ideas welcome :-)

If you know someone with knowledge about Darrieus VAWT wind turbines: https://youtu.be/UitxRSDj3tc

from split_hoverboard_simplefoc.

Candas1 avatar Candas1 commented on August 28, 2024

thanks @robcazzaro for the reminder that Gen1 is stm32 and we do not need two motors with our Gen2 GD32 port.

Also simpleFOC cannot do dual FOC yet.

Don't know why execution hangs/resets at

  oKeepOn.Init();
  oKeepOn.Set(true);  // now we can release the on button :-)
  oOnOff.Init();

You could check in debug mode if the code is going to hardfault handler.

@Candas1 , if you have not yet worked on your repo since accepting my old pull request, you might want me to clean up my current fork and do another pull request.

I did some cleanup already but haven't committed yet.

But the simpleFOC does not yet work on the Gen1. In the debug log you see the millis() of every loop(), so the code is running. But quickly a constant overcurrent of 1.6A (limit of 1.5A set with my little power supply), the motor makes a little buzzing noise and voltage drops from 25 to 21 Volt. With a current limit of 1.0A, the mcu reboots. Do not really want to increase the current limit. 1.5A should be well enough to make the motor startup.

Those simpleFOC parameters should be properly set for STM32 drivers not to short the half bridges:
SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH
SIMPLEFOC_PWM_HIGHSIDE_ACTIVE_HIGH
That's something we haven't implemented with GD32 yet, Rob is looking at it.

from split_hoverboard_simplefoc.

RoboDurden avatar RoboDurden commented on August 28, 2024
SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH
sets PWM polarity on low side phase PWM outputs - default is active high (true) but can be set to false for active low polarity. Affects only low side FETs in 6-PWM mode. No effect in other modes.
SIMPLEFOC_PWM_HIGHSIDE_ACTIVE_HIGH
sets PWM polarity on high side phase PWM outputs - default is active high (true) but can be set to false for active low polarity. Affects only high side FETs in 6-PWM mode. No effect in other modes.

I remember that @robcazzaro mentioned in some of our long issues that the lo-side digital-out pin is negated ? But that would only apply to the Gen2 boards ?

In EFeru::setup.c i find

  sConfigOC.OCPolarity   = TIM_OCPOLARITY_HIGH;
  sConfigOC.OCNPolarity  = TIM_OCNPOLARITY_LOW;

and only three channels per motor.

  HAL_TIM_PWM_ConfigChannel(&htim_left, &sConfigOC, TIM_CHANNEL_1);
  HAL_TIM_PWM_ConfigChannel(&htim_left, &sConfigOC, TIM_CHANNEL_2);
  HAL_TIM_PWM_ConfigChannel(&htim_left, &sConfigOC, TIM_CHANNEL_3);

Maybe that is what simpleFOC is doing with BLDCDriver3PWM and high will open the hi-mosfet and low the low-side mosfet ?

then i should set that build flag SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH to false ?
After i have looked at the schematics pdf i can confirm that a low-side HIGH will close the the lo-side mosfet and a LOW will make it conducting.

Will try SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH = false , but i do not really know how to set build flags. And a flag normaly is only a flag and not a parameter..

from split_hoverboard_simplefoc.

RoboDurden avatar RoboDurden commented on August 28, 2024

Okay motor is spinng - at least in the right directions. But very poorly with buzzing noise and kind of very coarse steps. Right rotation is a bit more smooth and only draws about 300mA at 26V. opposite rotation about 400-500mA.

  driver.voltage_limit = 0.3 * driver.voltage_power_supply;   // 0.3 = keep well below 1.0 for testing !
  motor.voltage_limit =  driver.voltage_limit; // stupid bug to have two voltage_limit in different places

Does someone on the simpleFOC forums already succeeded with Gen2 ?

I would like to have working Gen1 to test my HallSensor linear prediction..

from split_hoverboard_simplefoc.

RoboDurden avatar RoboDurden commented on August 28, 2024

Ah, i had to calibrate the motor:

MOT: Init
MOT: Enable driver.
MOT: Align sensor.
MOT: sensor_direction==CCW
MOT: PP check: fail - estimated pp: 18.00
MOT: Zero elec. angle: 4.19
MOT: No current sense.
MOT: Ready.
setup needed ms: 6428

Now it spins nicely. I have a different motor in the stm setup :-/

from split_hoverboard_simplefoc.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.