Giter VIP home page Giter VIP logo

bldc-drive's Introduction

bldc-drive

This is a project developing a simple BLDC servo controller. It is based on an STM32F103 microcontroller.

Some parts, especially the PID control loop is based on development done by user mcm_xyz in cnczone.com forum. Thank you! Check the thread http://www.cnczone.com/forums/open-source-controller-boards/283428-cnc.html

Disclaimer

This software and hardware is provided "AS IS", WITHOUT ANY WARRANTY. The software is released under GPL v2. Authors accept no liability for any harm or loss resulting from use of this hardware or software.

Authors & Contributors

Firmware

Firmware is a work-in-progress (and will be for a while :), however following features are included:

  • Trapezoidal BLDC commutation using either HALL sensors or quadrature encoder.
  • Step+Dir input interface with PID position control loop.
  • PWM+Dir input interface in velocity mode.
  • USART communitacation for configuration. Configuration settings saved to flash memory.
  • TODO: Motor Test Mode to simply activate a Motor with a fixed frequency, no encoder needed

Update 1st May 2016

Some updates to the firmware.

  • ADC current limiting implemented. Appears to work OK
  • I created a quick and ugly Python gui for tuning
  • Updated the PID loop to have feedfoward coefficients FF1 and FF2 (like LinuxCNC). This means that the PID output can be adjusted by the requested speed and the requested acceleration. This made the PID tuning a lot easier for me at least, I'm able to get a motor to follow the requested position very well also during acceleration and during constant drive.

Hardware:

First prototype hardware is built and it is working well. However, there are couple of known issues:

  • 6n137 optocoupler is not officially supporting 3.3V supply voltage which is used in the board. In reality they seem to work, but the optocoupler should be changed or additional levelshifting circuitry added on next revision. Also, the optocoupler input circuit supports only push-pull-type encoder output. Many encoders seem to have open drain output. :(
  • Few connectors in the layout missed solder stop openings. They were bit painfull to solder. :)
  • The current amplifier INA27x connection is wrong. The IN+ and IN- should be swapped.

STATUS QUO:

Second hardware revision with the above findings fixed is published. There are no known issues, two servo drives are succesfully driving my CNC router. Pics and videos to come..

HARDWARE TODOs:

  • verify all part-values into the schematic

bldc-drive's People

Contributors

pekkaroi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bldc-drive's Issues

some kind of TestMode missing

I have started to read the code and looked at the gui as well but i think there is some kind of test mode missing, where you could just start the motor at very slow speed to test it without any encoder.

if I understand the code good enough, i will add such a mode to the software. i think that this will make development easier for beginners or people who have trouble with the encoder....

please tell me what does encoder_poles mean

Hi,
Excellent open source project.I try to run it everything is fine but I don't know the specific meaning of encoder_poles.
It refers to the motor coil pair?It refers to the encoder subdivision?Or something else?
I read the code, but only in one calculation.Please tell me what it means.
Thanks a lot
y5664579.

PID error of the project

Lucky to see this impressive protect, it is with a good framwork. I have tested it in the step mode with an encoder of 4000 PPR. But when I adjust the input signal about 60KHz, that means the speed is under 1000 RPM, the pid error will decrease from 8800 to about 6500, then it will jump bigger and bigger till the biggest pid error.So during this, the sound is also bigger and bigger, why does it happen?
Thanks.

Error while compiling with IAR ewarm utils.c

I get this error at line 11 Error[Og006]: Error in inline assembly: "Error[41]: Bad label"
The error is in file utils.c Any clue for debuging?

1 #include "utils.h"
2 #include <stddef.h>
3 #include <stdint.h>
4
5 void delay_ms(const uint32_t ms)
6 {
7
8 uint32_t ms2 = ms*STM32_CLOCK_HZ / 1000 / STM32_CYCLES_PER_LOOP;
9
10 asm volatile(" mov r0, %[ms2] \n\t"
11 "1: subs r0, #1 \n\t"
12 " bhi 1b \n\t"
13 :
14 : [ms2] "r" (ms2)
15 : "r0");
16 }

BOM

Is there a BOM available?

It posible for pmsm servo 220v 5A???

Hii iam very apriciate to your project.

For now i looking like this driver for my pmsm servo 220v 5A. With ABZ encorder 2500ppr.
It is posible to used??
And this already suport step/dir interface right???
I will coustem the driver and igbt
With this chip IKCM30F60GA. (Already include driver igbt, you can check the data sheet)
Iam also want to used for my cnc. If u have time i wait for the answere🙏🙏🙏

NOOB guide /Help

can you tell me and maybe others how to use this? how does configuring the servo work? I cant start the GUI when opening with python.

Missing Binaries

Hello Pekka!

Your project looks really interesting to me, though I am struggling to get everything sorted with eclipse. Any chance you could add the binaries to the repository. Just flashing a .hex to a breakout board would do wonders to start prototyping.

Cheers
Peter

Dead time

I want to customize the firmware, for my motor control board, where can I configure the deadtime?

schematic&layout

Hi there!

I have taken a look at your schematic and layout, and have seen that you have created it in a kicad version older than 4.0. so i have forked the design and am actually migrating the project to kicad 4.0 and the new symbols.
if you like to merge it, i will create a pull request once i'm ready with the migrating process.
additionally i have deleted the older versions of schematic and layout, because there is git history and if you like you can pull older versions from there.

please do not migrate at the moment, because there is still work to do and migrating now will lead to more work for you :D

a list of parts and values that you have used in your prototypes would be neat, because they are not mentioned in the schematic...

sry. for something like fucked up grammar or missuse of words, I am from germany and so german is my first and main language...

Newbie hint request

Hi Pekka,

What tool/version was used for firmware?
I tried loading the project to STMworkbench but it reports error on not recognizing uint16_t

Should the components in KiCad schematic be connected?

Have you got any progress with posting videos?

Rgds,
Tapio

ps above in english for wider audience

DC brushed motor version

Hi, I would ask about possibility of implementation code for DC brushed motors. I tried change pwm.c file with pwm_Comutate to simple fixed BH1, BL1 parameters but its not work. Pekka please indicate me direction which I should focuse.

Thanks a lot

Kamil.

STM32 PMSM FOC Software Development Kit - MC library

Hello
What do you think it is possible to add PID position conttol of the mcm_xyz user from cnczone to this SDK. It auto generates code and project for IAR or Keil. From what i looked it is implemented only Speed and Torque in the ST Motor SDK.
FOC (Field Oriented Control) of 3-phase Permanent Magnet motors (PMSM, BLDC) brings increase torque ,efficiency, and reduce noise and torque ripple.
https://www.youtube.com/watch?v=yFecre8dacY

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.