584,866 active members*
4,972 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Open Source Controller Boards > DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)
Page 2 of 25 123412
Results 21 to 40 of 490
  1. #21
    Join Date
    Nov 2005
    Posts
    111

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Hi,
    its possible to a isolated current sensor? There are some available for Arduino?

    Thanks

    Hans

  2. #22
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Hello guys!

    Here is the first (very alpha) version of the software. Does not have Enable input, and current sensing...
    at 72MHz the PID frequency reached is around 60kHz...

    Tools used:

    1. eclipse Mars.1 Release (4.5.1)
    2. gcc-arm-none-eabi-4_8-141002
    3. eclipse plugin: GNU ARM C/C++ Cross Development Tools (filename: ilg.gnuarmeclipse.repository-2.9.3-201508190739.zip)
    4. CoreUtils, Coreutils-090604.msi
    5. OpenOcd 0.9.0

    enjoy...

    Mihai

  3. #23
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    It's me again...

    Here is a better version of the firmware... has also current sense in place... and the enable signal input...
    Code it's a mess, very little comments and very ugly written... Sorry about that... I am not a C developer...
    The PID Frequency has decreased to 48kHz after adding ADC in interrupt mode... I do not think DMA mode ADC would do in out case as we need very little lag in measuring the current...
    Anyway, it's pretty accurate... and 48 kHz it's really nice...

    enjoy video...

    Mihai

    https://www.youtube.com/watch?v=3pDLmSwuHiU

  4. #24

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Quote Originally Posted by mcm_xyz View Post
    It's me again...

    Here is a better version of the firmware... has also current sense in place... and the enable signal input...
    Code it's a mess, very little comments and very ugly written... Sorry about that... I am not a C developer...
    The PID Frequency has decreased to 48kHz after adding ADC in interrupt mode... I do not think DMA mode ADC would do in out case as we need very little lag in measuring the current...
    Anyway, it's pretty accurate... and 48 kHz it's really nice...
    Thanks for publishing the code. And don't be too hard on yourself, your code was very readable and actually I'm impressed how simple the firmware actually is. I was able to compile it right away. I did not upload it to actual hardware as I don't have anything suitable on the table right now, but will do maybe tomorrow.

    The tuner software is a bit trickier for me as I don't own a Windows PC at the moment.. I tried running the code on Linux with Mono (Opensource alternative to MS C# runtime libraries) and after a bit of commenting your code (had to remove the chart area and customprogressbar which seemed not compatible with Mono) I was able to launch the gui at least. But having no hardware I cannot say for sure if the USB connection works. I'll come back to you when I know.

    Thanks for your hard work!
    Pekka

  5. #25
    Join Date
    May 2006
    Posts
    190
    Quote Originally Posted by roivai View Post
    Thanks for publishing the code. And don't be too hard on yourself, your code was very readable and actually I'm impressed how simple the firmware actually is. I was able to compile it right away. I did not upload it to actual hardware as I don't have anything suitable on the table right now, but will do maybe tomorrow.

    The tuner software is a bit trickier for me as I don't own a Windows PC at the moment.. I tried running the code on Linux with Mono (Opensource alternative to MS C# runtime libraries) and after a bit of commenting your code (had to remove the chart area and customprogressbar which seemed not compatible with Mono) I was able to launch the gui at least. But having no hardware I cannot say for sure if the USB connection works. I'll come back to you when I know.

    Thanks for your hard work!
    Pekka
    Hmmm... The code for the tuner program uses lots of references to usb hid dlls from windows... I do not think they will work on Linux. However the app is simple... I bet there are already made programs for linux that can send simple texts to a usb hid device... The only thing that is not text is the servo response matrix.

    Mihai

  6. #26
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Yet another issue...

    The STEP / DIR inputs are mapped right now to Ext Interrupts... From what I've read it's possible to configure the Tims in encoder mode and read a pulse + direction signal... strange but I did not managed to do that yet... all I can get in the tim3 register is the direction change...
    I am working on that now...

    Mihai

  7. #27
    Join Date
    Dec 2009
    Posts
    8

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    hello Mihai

    I am really impressed at your project, I'm sure it will be work perfectly. I have a question, do you plan add "step multiplier "option ? Sometimes if encoder resolution is to big the Mach3 will not be able send step signal as fast as need.

    Kamil.

  8. #28
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Quote Originally Posted by kamilkamil1 View Post
    hello Mihai

    I am really impressed at your project, I'm sure it will be work perfectly. I have a question, do you plan add "step multiplier "option ? Sometimes if encoder resolution is to big the Mach3 will not be able send step signal as fast as need.

    Kamil.
    Should not be a problem to add such feature... Also there are several modes to count encoder pulses... Right now we count all (both raising and falling on both A and B channels), but the encoder counter could be configured differently also...
    Will add in the next version a configurable step multiplier. I guess 1 to 10 should do...

    Mihai

  9. #29
    Join Date
    Nov 2005
    Posts
    111

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Hello Mihai,
    in what kind of way can the controller check the rotorposition, when the controller is switch on the first time?
    There are no inputs for hallsensors or similar.

    Thanks

    Hans

  10. #30
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    I've been investigating the bootloader embeded in the ROM of STM32F103 MCU. It only supports USART so it's not really useful since we already have USB. So I modified and compiled a USB DFU mode bootloader (taken from ST website: http://www.st.com/web/en/catalog/tools/PF258157) in order to have the USB firmware upgrade feature... The servo firmware was modified to be able to enter the new bootloader from program.
    The bootloader code was compiled in IAR (I was too lazy to setup the project in eclipse...), but it is very little and I think you can compile in the Demo version of IAR.
    Also we might add a jumper in order to put the device in the new bootloader mode (BOOT0 and BOOT1 pins can not be used because they put the cpu in the embeded bootloader)

    I will come back with code, schematic and compiled firmwares...

    Mihai

    PS. I have in mind to set up a folder in some webserver folder and to add the "update from internet" feature to the Servo Drive Tuner program...

  11. #31
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Quote Originally Posted by Holzwurm56 View Post
    Hello Mihai,
    in what kind of way can the controller check the rotorposition, when the controller is switch on the first time?
    There are no inputs for hallsensors or similar.

    Thanks

    Hans
    Power is applied to 2 inputs of the motor in a gradually mode on initialization. This will move the rotor to a known position. (yes, it's a minus but I do not really care because I always remake the HOME reset on my cnc on powerup)... From there the angle of the shaft is computed from the encoder position and the number of PPR of the encoder...
    Check out function PWM_Init_Motor from unit pwm.
    If some want to use hall sensors, the code in function PWM_Set_Duty must be changed. The values in p1, p2 and p3 must be taken from the Hall sensors and not my commutation tables... That's all...

    Mihai

  12. #32
    Join Date
    May 2005
    Posts
    1397

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Quote Originally Posted by mcm_xyz View Post
    PS. I have in mind to set up a folder in some webserver folder and to add the "update from internet" feature to the Servo Drive Tuner program...
    If it helps, massmind.org is at your disposal.
    James hosts the single best wiki page about steppers for CNC hobbyists on the net:
    http://www.piclist.com/techref/io/steppers.htm Disagree? Tell him what's missing! ,o)

  13. #33
    Join Date
    Nov 2005
    Posts
    111

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Hello Mihai,
    many thanks for your answer. You are a super software developer but It`s not possible for me to write one line of code. I want only know the prinzip of checking the rotorposition.

    Thanks

    Hans

  14. #34
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Hello guys!

    Here is the latest code for you!

    It contains:
    1. Bootloader code and binary file.
    2. Firmware code and binary (debug version).
    3. Servo Tuner Utility code and binary.

    There is a new feature, maybe someone may want to add some jumpers to the schematic. If you link the pin PB1 to 3.3 V and reset the mcu it will enter USB DFU Bootloader mode. The program is capable of entering bootloader mode with the command "UPG".
    Also there is a Step multiplier field as requested...

    In order to flash the first time you will have to flash via StLink with the images: BootLoader.bin and F103ServoDrive.hex (order is not important). Then you can upgrade firmware from USB from the Servo Tuner Utility (Menu File > Update servo firmware)...
    Please note that you will need dfu files in the Servo Tuner Utility. You can convert HEX files to dfu files using DfuFileMgr.exe utility included in ST app from link: STSW-STM32080 DfuSe USB device firmware upgrade STMicroelectronics extension: contains the demo GUI, debugging GUI, all sources files and the protocol layer (UM0412) - STMicroelectronics

    Mihai

    PS: I'm still waiting for a board... please... share your works...
    If you compile in release mode you get a PID frequency up to 54 kHz...
    Attached Files Attached Files

  15. #35
    Join Date
    Mar 2005
    Posts
    303

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    I'm trying to finish

  16. #36
    Join Date
    May 2006
    Posts
    190

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Quote Originally Posted by tivoidethuong View Post
    I'm trying to finish
    Nice work... I can not tell I fully understand... Where is the USB connector? Why the 15 pin connector?
    Anyway... I am waiting for someone to make a nice PCB for this project... I am interested in buying some...
    The idea of to have 2 boards (one for low power logic and one for high power part) seems to be very nice... One on top of the other with some connectors between them...

    It would be super cool!

    Mihai

  17. #37
    Join Date
    Nov 2005
    Posts
    111

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Hi,
    I think the board will be createt with the minimum development board. Some hobby machinists or electronic are not able to solder smd parts. I thinks its a good idea to make a power pcb and a isolated controller pcb with a isolated current sensor. Maybe the power pcb with integratet bridge like IRAMX20xxxxxx and a control of the integratet thermosensor.

    Thanks

    Hans

  18. #38
    Join Date
    May 2005
    Posts
    1397

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    May I make a suggestion on the PCB? One barrier to entry which will keep a lot of people from trying, testing, contributing to this project is the fine pitch SMT soldering required for that processor. If you could use an /existing/ development board as the basis for the PCB, assuming one exists, it would really help people to get involved. There is no reason why you can't /also/ layout a section for the actual processor, but providing an option to easily connect to an existing development board is an important step, in my experience. It could be as easy as simply providing well labeled "test points" so that a cable can be run from the dev board to the PCB in place of an onboard processor.
    James hosts the single best wiki page about steppers for CNC hobbyists on the net:
    http://www.piclist.com/techref/io/steppers.htm Disagree? Tell him what's missing! ,o)

  19. #39
    Join Date
    Feb 2007
    Posts
    4553

    Lightbulb Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    Maybe a board like this will work.

    Arm Cortex M3 STM32F103C8T6 Minimum System Chip Development Board STM32 48 Pin | eBay

    Jeff...
    Attached Thumbnails Attached Thumbnails DB.jpg  
    Patience and perseverance have a magical effect before which difficulties disappear and obstacles vanish.

  20. #40
    Join Date
    May 2005
    Posts
    1397

    Re: DIY BLDC / DC Motor Servo Drive - ARM MCU (STM32F103C8T6)

    I'm sure that could be made to work... but ideally, it should be something that can be directly soldered in place, and that one, with the pre-soldered headers, would make that difficult. I was thinking of this much less expensive one:
    STM32F103C8T6 Arm STM32 Minimum System Development Board Module for Arduino DHU | eBay

    Or at least of something like that one. Where the headers can be put on the bottom, and are simple straight headers.
    James hosts the single best wiki page about steppers for CNC hobbyists on the net:
    http://www.piclist.com/techref/io/steppers.htm Disagree? Tell him what's missing! ,o)

Page 2 of 25 123412

Similar Threads

  1. Replies: 3
    Last Post: 02-11-2015, 06:07 AM
  2. Replies: 0
    Last Post: 10-21-2014, 09:29 PM
  3. Servo Drive AC + servo motor for car steering wheel simulator
    By yusukeand in forum Servo Motors / Drives
    Replies: 6
    Last Post: 01-10-2014, 09:06 AM
  4. VCE-750 with BLDC Servo - X Axis Servo fault
    By kostner in forum Haas Mills
    Replies: 6
    Last Post: 10-23-2011, 08:09 PM
  5. Sell Servo Motor, Servo Drive by GSKcnc.com from China
    By salecnc@hotmail in forum News Announcements
    Replies: 0
    Last Post: 06-03-2008, 08:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •