SlideShare a Scribd company logo
1 of 6
Download to read offline
Published on Your Electronics Open Source (http://dev.emcelettronica.com)


Home > Blog > andri_ym's blog > Contenuti




Brushless DC electric motor control by CPLD
By andri_ym
Created May 25 2009 - 08:02


The main area for application of brushless direct current motors (BLDC) is positioning. In this article I am
going to describe a simple solution to operation with two phase sine/cosine BLDC.
The main idea is to generate sine and cosine by Pulse Weight Modulation (PWM) using configurable logic
for example field programmable array (FPGA) or complex programmable logic device (CPLD).
The general structure of system shown in Pic. 1.




                                            Pic. 1.- General structure of system

To produce low cost prototyping solution was selected CPLD from Altera EPM3064A (EPM3128A).

Description of circuit diagram
Device has the following parts:

         - motor driver part;
         - signal and control part;
         - power supply for motor driver part;
         - galvanic isolated power supply for signal part;
         - signal isolator.

System was designed using classical H-bridges based on N-channel MOSFET transistors (IRF540N) with
proper driver IR2110. The main idea was to generate sine wave modulated PWM signals on CPLD and
transfer it via isolating integral circuits to drivers. There are two channels one sine other cosine. CPLD
generates both signals using table method. Resulting waves are filtered partially of LC filter (see photo)
and load windings of motor. The direction of running simply changes by multiplexing of sine and cosine
PWM modulated signals in CPLD.
The system is simply controlled. It can be controlled manually and easily can be connected to any
microcontroller. The carry signal is generated by generator IC MC74HC4060. More suitable frequency for
drivers ICs is near 200 KHz, so was selected 4 MHz quartz resonator to provide 2500KHs carry signal.
Controls:

       - ?On/Off? switch enables/disables outputs. When outputs disabled rotor of BLDC can be easily
       rotated and windings have floating potentials.
       - ?Enable? switch enables run of motor or firmly stops it holding power on windings.
       - ?Direct/Reverse? switch when closed ?Reset? and ?Stop/Run? defines the direction of rotation.
       - ?Speed? jumpers set the period of sine/cosine waves and divide speed of rotation of motor.

The system designed as is. It has very simple protection by R30 and R45 shunt resistors from over current.
Moreover by connection ADC to them can be established current and rotation feedback signal.




                                          Pic. 2 ? Circuit diagram

In Download [1] section - BLCD_CPLD.zip you'll find the schematic at a high resolution.

VHDL code description. VHDL code is provided in appendix A.
Configurable logic module has 5 inputs and 2 outputs and utilizes 25% of logic cells.
Inputs: 4 of them map switches state (except ?On/Off? what directly connected to isolated repeater) and 1
takes input clock (PWMclk).

This clock internally divided and used to control multiplexors to select data from sine/cosine tables.
Selected values from tables compared with PWM counting registers and finally form PWM signal with duty
changed cycle. So carry signal is twice modulated ? primary by PWM and secondary by table.

Forms of waves depend on entry in tables for MUXA and MUXB multiplexers. In current project used 12
point approximation of sine/cosine wave. The resulting form of signal can be controlled by oscilloscope
probes at control points K1 and K2. On the Pic. 3 was shown waveform on motor windings. The modulated
PWM carry frequency is filtered and have maximal amplitude near the virtual ?zero? line. The number of
points easily can be tuned to 8 point or even less to control stepper motors and to use more chipper CPLD.
Current solution compiled for EPM3128A and fits EPM3064. With resolution of sine/cosine wave it can be
ported even to EPM3032.




                                    Pic. 3 - Waveform on motor windings

Implementation
Project was implemented and tested with 50Watt BLDC of Russian produced. And provide stable work.
Solution was tried to run 1 KWatts BLDC but time by time output transistors and drivers was crashed by
high current at low speed turning of rotor (less them 10 rps.).
For implementation was selected prototype board with suitable number of drivers and h-bridges. In the
photo was shown PCB for two axis control system. To reduce EMC disturbances motor supplied via simple
low pass LC filter. It is optional system for low load up to 50 Watts. The cut of frequency of filer should be
100KHz or bellow.

Appendix A
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity PWM is-- SIN & COS generator
(PWM 8 bit 8 samples per period)
generic(
Nbit   : natural := 3; -- PWM resolution
Ncases : natural := 2; -- max=8 samplses
PhaseShift: natural := 2 -- Pi/2 phase shift
);
Port ( SOut, COut: out STD_LOGIC; -- PWM outputs
dir: in STD_LOGIC;-- direction
Speed: in STD_LOGIC_VECTOR (1 downto 0);-- rotation Speed
PWMclk     : in STD_LOGIC;-- PMWclock
--    Muxclk: in STD_LOGIC;-- data selector clock
--    test      : out STD_LOGIC_VECTOR (2 downto 0); -- PWM counter
PWMen : in STD_LOGIC-- enable/stop PWM
);
signal divider : STD_LOGIC_VECTOR ( 12 downto 0);-- PWM counter
signal PWMcnt: STD_LOGIC_VECTOR ( Nbit downto 0);-- PWM counter
--signal MuxCnt: STD_LOGIC_VECTOR ( Ncases downto 0);-- selector counter
signal MuxA: STD_LOGIC_VECTOR ( 3 downto 0):=quot;0000quot;; -- data pointers
signal MuxB: STD_LOGIC_VECTOR ( 3 downto 0):=quot;0011quot;; -- data pointers
signal CosOut, SinOut,q : STD_LOGIC;
signal DtSin,DtCos: STD_LOGIC_VECTOR (Nbit downto 0);-- PWM reg values
end PWM;
architecture BHVa of PWM is
begin
process (PWMclk,PWMen)-- PWM counter
begin
if (PWMen='0')
then divider <= quot;0000000000000quot; ; --- disable/stop PWM
else
if(PWMclk'Event and PWMclk='1')
then divider <= divider +'1';
end if;
end if;
end process;
with Speed select --
q <= divider(9) when quot;11quot;,
divider(8) when quot;10quot;, --
--divider(7) when quot;011quot;, --
divider(7) when others; --
process (q) -- SIN & COS data pointers selection
begin
if (PWMen='0')
then MuxA <= quot;0000quot;; MuxB <= quot;0011quot;;
else
if(q'event and q='1')
then MuxA <= MuxA + 1;
MuxB <= MuxB + 1;
--test (2 downto 0) <=MUXA (2 downto 0);
end if;
if(MuxA= quot;1010quot;)
then MuxA <=quot;0000quot;;
end if;
if(MuxB= quot;1010quot;)
then MuxA <=quot;0000quot;;
end if;
end if;
end process;
with MuxA select -- for SIN data 8-input data multiplexer
DtSin (Nbit downto 0) <=
xquot;8quot; when quot;0000quot;, -- @000
xquot;Cquot; when quot;0001quot;, -- @030
xquot;Equot; when quot;0010quot;, -- @060
xquot;Fquot; when quot;0011quot;, -- @090 = Pi/2 = max
xquot;Dquot; when quot;0100quot;, -- @120
xquot;Bquot; when quot;0101quot;, -- @150
xquot;8quot; when quot;0110quot;, -- @180 = Pi
xquot;5quot; when quot;0111quot;, -- @210
xquot;2quot; when quot;1000quot;, -- @240
xquot;1quot; when quot;1001quot;, -- @270 =3/2*Pi= min
xquot;2quot; when quot;1010quot;, -- @300
xquot;4quot; when quot;1011quot;, -- @330
xquot;8quot; when others; -- @360
with MuxB select -- for COS data 8-input data multiplexer --
DtCos (Nbit downto 0) <=
xquot;8quot; when quot;0000quot;, -- @000
xquot;Cquot; when quot;0001quot;, -- @030
xquot;Equot; when quot;0010quot;, -- @060
xquot;Fquot; when quot;0011quot;, -- @090 = Pi/2 = max
xquot;Dquot; when quot;0100quot;, -- @120
xquot;Bquot; when quot;0101quot;, -- @150
xquot;8quot; when quot;0110quot;, -- @180 = Pi
xquot;5quot; when quot;0111quot;, --    @210
xquot;2quot; when quot;1000quot;, -- @240
xquot;1quot; when quot;1001quot;, --   @270 =3/2*Pi= min
xquot;2quot; when quot;1010quot;, --    @300
xquot;4quot; when quot;1011quot;, -- @330
xquot;8quot; when others; --    @360
process (PWMclk,PWMen) -- PWM counter
begin
if (PWMen='0')
then PWMcnt <= quot;0000quot; ; --- disable/stop PWM
else
if(PWMclk'Event and PWMclk='1')
then PWMcnt <= PWMcnt +'1';
end if;
end if;
end process;
process (dtsin,PWMcnt)-- SIN PWM comparator output
begin
if (dtsin > PWMcnt )
then SinOut <= '0' ;
else SinOut <= '1';
end if;
end process;
process (dtcos,PWMcnt)-- COS PWM comparator output
begin
if (dtcos > PWMcnt )
then CosOut <= '0' ;
else CosOut <= '1' ;
end if;
end process;
with dir select -- for COS data 8-input data multiplexer
Cout <= CosOut when '0', -- 128@000=0
Sinout when others;
with dir select -- for COS data 8-input data multiplexer
Sout <= SinOut when '0', -- 128@000=0
CosOut when others;
end BHVa;

In Download [1] section - BLCD_CPLD.zip you'll find the schematic and BOM.

                                                                Projects bldc brushless direct current motor cpld

                                                   Trademarks




Source URL: http://dev.emcelettronica.com/brushless-dc-electric-motor-control-cpld

Links:
[1] http://dev.emcelettronica.com/download

More Related Content

More from Ionela

openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
Ionela
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Ionela
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Ionela
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
Ionela
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Ionela
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
Ionela
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Ionela
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ionela
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
Ionela
 
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
Touchatag  un&#039;applicazione di internet delle cose   2010-11-10Touchatag  un&#039;applicazione di internet delle cose   2010-11-10
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
Ionela
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
Ionela
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
Ionela
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Ionela
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Ionela
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Ionela
 

More from Ionela (20)

IoT with OpenPicus Flyport
IoT with OpenPicus FlyportIoT with OpenPicus Flyport
IoT with OpenPicus Flyport
 
Flyport wifi webserver configuration page
Flyport wifi webserver configuration pageFlyport wifi webserver configuration page
Flyport wifi webserver configuration page
 
openPicus Proto Nest Datasheet
openPicus Proto Nest DatasheetopenPicus Proto Nest Datasheet
openPicus Proto Nest Datasheet
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
 
Openpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud servicesOpenpicus Flyport interfaces the cloud services
Openpicus Flyport interfaces the cloud services
 
Flyport openPicus datasheet
Flyport openPicus datasheetFlyport openPicus datasheet
Flyport openPicus datasheet
 
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
Windows phone 7 è l’ultima occasione di microsoft   2010-10-18Windows phone 7 è l’ultima occasione di microsoft   2010-10-18
Windows phone 7 è l’ultima occasione di microsoft 2010-10-18
 
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...Videocamera cam ball  un mare di caratteristiche nella piccola videocamera a ...
Videocamera cam ball un mare di caratteristiche nella piccola videocamera a ...
 
Utente premium 2010-10-17
Utente premium   2010-10-17Utente premium   2010-10-17
Utente premium 2010-10-17
 
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
Unity sostituisce gnome su ubuntu 11.04   2010-11-01Unity sostituisce gnome su ubuntu 11.04   2010-11-01
Unity sostituisce gnome su ubuntu 11.04 2010-11-01
 
Una retina artificiale per ridare la vista 2010-11-10
Una retina artificiale per ridare la vista   2010-11-10Una retina artificiale per ridare la vista   2010-11-10
Una retina artificiale per ridare la vista 2010-11-10
 
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29Un orologio elettronico completo basato su i2 c rtcc mcp79410   2010-10-29
Un orologio elettronico completo basato su i2 c rtcc mcp79410 2010-10-29
 
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...Ultimo lancio discovery  delle perdite rinviano l’ultimo lancio dello shuttle...
Ultimo lancio discovery delle perdite rinviano l’ultimo lancio dello shuttle...
 
Ubuntu passa a wayland 2010-11-08
Ubuntu passa a wayland   2010-11-08Ubuntu passa a wayland   2010-11-08
Ubuntu passa a wayland 2010-11-08
 
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
Touchatag  un&#039;applicazione di internet delle cose   2010-11-10Touchatag  un&#039;applicazione di internet delle cose   2010-11-10
Touchatag un&#039;applicazione di internet delle cose 2010-11-10
 
Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05Tianhe 1, il supercomputer cinese - 2010-11-05
Tianhe 1, il supercomputer cinese - 2010-11-05
 
Thread o processo quale usare - 2010-11-02
Thread o processo  quale usare  - 2010-11-02Thread o processo  quale usare  - 2010-11-02
Thread o processo quale usare - 2010-11-02
 
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03Termometro digitale usando pic16 f84a   schema elettrico - 2010-11-03
Termometro digitale usando pic16 f84a schema elettrico - 2010-11-03
 
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...Telescopio webb  il sistema di engineering del telescopio webb della nasa si ...
Telescopio webb il sistema di engineering del telescopio webb della nasa si ...
 
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...Tecnologia light peak  intel potrebbe adottarla da inizio 2011, apple a segui...
Tecnologia light peak intel potrebbe adottarla da inizio 2011, apple a segui...
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
anilsa9823
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptx
ABMWeaklings
 
CALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual service
anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
anilsa9823
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
anilsa9823
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
vikas rana
 

Recently uploaded (20)

CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by Mindbrush
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptx
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 
CALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Jankipuram Lucknow best sexual service
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdf
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
 

Brushless Dc Electric Motor Control By Cpld

  • 1. Published on Your Electronics Open Source (http://dev.emcelettronica.com) Home > Blog > andri_ym's blog > Contenuti Brushless DC electric motor control by CPLD By andri_ym Created May 25 2009 - 08:02 The main area for application of brushless direct current motors (BLDC) is positioning. In this article I am going to describe a simple solution to operation with two phase sine/cosine BLDC. The main idea is to generate sine and cosine by Pulse Weight Modulation (PWM) using configurable logic for example field programmable array (FPGA) or complex programmable logic device (CPLD). The general structure of system shown in Pic. 1. Pic. 1.- General structure of system To produce low cost prototyping solution was selected CPLD from Altera EPM3064A (EPM3128A). Description of circuit diagram Device has the following parts: - motor driver part; - signal and control part; - power supply for motor driver part; - galvanic isolated power supply for signal part; - signal isolator. System was designed using classical H-bridges based on N-channel MOSFET transistors (IRF540N) with proper driver IR2110. The main idea was to generate sine wave modulated PWM signals on CPLD and transfer it via isolating integral circuits to drivers. There are two channels one sine other cosine. CPLD generates both signals using table method. Resulting waves are filtered partially of LC filter (see photo) and load windings of motor. The direction of running simply changes by multiplexing of sine and cosine PWM modulated signals in CPLD.
  • 2. The system is simply controlled. It can be controlled manually and easily can be connected to any microcontroller. The carry signal is generated by generator IC MC74HC4060. More suitable frequency for drivers ICs is near 200 KHz, so was selected 4 MHz quartz resonator to provide 2500KHs carry signal. Controls: - ?On/Off? switch enables/disables outputs. When outputs disabled rotor of BLDC can be easily rotated and windings have floating potentials. - ?Enable? switch enables run of motor or firmly stops it holding power on windings. - ?Direct/Reverse? switch when closed ?Reset? and ?Stop/Run? defines the direction of rotation. - ?Speed? jumpers set the period of sine/cosine waves and divide speed of rotation of motor. The system designed as is. It has very simple protection by R30 and R45 shunt resistors from over current. Moreover by connection ADC to them can be established current and rotation feedback signal. Pic. 2 ? Circuit diagram In Download [1] section - BLCD_CPLD.zip you'll find the schematic at a high resolution. VHDL code description. VHDL code is provided in appendix A. Configurable logic module has 5 inputs and 2 outputs and utilizes 25% of logic cells. Inputs: 4 of them map switches state (except ?On/Off? what directly connected to isolated repeater) and 1 takes input clock (PWMclk). This clock internally divided and used to control multiplexors to select data from sine/cosine tables. Selected values from tables compared with PWM counting registers and finally form PWM signal with duty
  • 3. changed cycle. So carry signal is twice modulated ? primary by PWM and secondary by table. Forms of waves depend on entry in tables for MUXA and MUXB multiplexers. In current project used 12 point approximation of sine/cosine wave. The resulting form of signal can be controlled by oscilloscope probes at control points K1 and K2. On the Pic. 3 was shown waveform on motor windings. The modulated PWM carry frequency is filtered and have maximal amplitude near the virtual ?zero? line. The number of points easily can be tuned to 8 point or even less to control stepper motors and to use more chipper CPLD. Current solution compiled for EPM3128A and fits EPM3064. With resolution of sine/cosine wave it can be ported even to EPM3032. Pic. 3 - Waveform on motor windings Implementation Project was implemented and tested with 50Watt BLDC of Russian produced. And provide stable work. Solution was tried to run 1 KWatts BLDC but time by time output transistors and drivers was crashed by high current at low speed turning of rotor (less them 10 rps.). For implementation was selected prototype board with suitable number of drivers and h-bridges. In the photo was shown PCB for two axis control system. To reduce EMC disturbances motor supplied via simple low pass LC filter. It is optional system for low load up to 50 Watts. The cut of frequency of filer should be 100KHz or bellow. Appendix A library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity PWM is-- SIN & COS generator (PWM 8 bit 8 samples per period) generic( Nbit : natural := 3; -- PWM resolution Ncases : natural := 2; -- max=8 samplses PhaseShift: natural := 2 -- Pi/2 phase shift );
  • 4. Port ( SOut, COut: out STD_LOGIC; -- PWM outputs dir: in STD_LOGIC;-- direction Speed: in STD_LOGIC_VECTOR (1 downto 0);-- rotation Speed PWMclk : in STD_LOGIC;-- PMWclock -- Muxclk: in STD_LOGIC;-- data selector clock -- test : out STD_LOGIC_VECTOR (2 downto 0); -- PWM counter PWMen : in STD_LOGIC-- enable/stop PWM ); signal divider : STD_LOGIC_VECTOR ( 12 downto 0);-- PWM counter signal PWMcnt: STD_LOGIC_VECTOR ( Nbit downto 0);-- PWM counter --signal MuxCnt: STD_LOGIC_VECTOR ( Ncases downto 0);-- selector counter signal MuxA: STD_LOGIC_VECTOR ( 3 downto 0):=quot;0000quot;; -- data pointers signal MuxB: STD_LOGIC_VECTOR ( 3 downto 0):=quot;0011quot;; -- data pointers signal CosOut, SinOut,q : STD_LOGIC; signal DtSin,DtCos: STD_LOGIC_VECTOR (Nbit downto 0);-- PWM reg values end PWM; architecture BHVa of PWM is begin process (PWMclk,PWMen)-- PWM counter begin if (PWMen='0') then divider <= quot;0000000000000quot; ; --- disable/stop PWM else if(PWMclk'Event and PWMclk='1') then divider <= divider +'1'; end if; end if; end process; with Speed select -- q <= divider(9) when quot;11quot;, divider(8) when quot;10quot;, -- --divider(7) when quot;011quot;, -- divider(7) when others; -- process (q) -- SIN & COS data pointers selection begin if (PWMen='0') then MuxA <= quot;0000quot;; MuxB <= quot;0011quot;; else if(q'event and q='1') then MuxA <= MuxA + 1; MuxB <= MuxB + 1; --test (2 downto 0) <=MUXA (2 downto 0); end if; if(MuxA= quot;1010quot;) then MuxA <=quot;0000quot;; end if; if(MuxB= quot;1010quot;) then MuxA <=quot;0000quot;; end if; end if; end process; with MuxA select -- for SIN data 8-input data multiplexer DtSin (Nbit downto 0) <=
  • 5. xquot;8quot; when quot;0000quot;, -- @000 xquot;Cquot; when quot;0001quot;, -- @030 xquot;Equot; when quot;0010quot;, -- @060 xquot;Fquot; when quot;0011quot;, -- @090 = Pi/2 = max xquot;Dquot; when quot;0100quot;, -- @120 xquot;Bquot; when quot;0101quot;, -- @150 xquot;8quot; when quot;0110quot;, -- @180 = Pi xquot;5quot; when quot;0111quot;, -- @210 xquot;2quot; when quot;1000quot;, -- @240 xquot;1quot; when quot;1001quot;, -- @270 =3/2*Pi= min xquot;2quot; when quot;1010quot;, -- @300 xquot;4quot; when quot;1011quot;, -- @330 xquot;8quot; when others; -- @360 with MuxB select -- for COS data 8-input data multiplexer -- DtCos (Nbit downto 0) <= xquot;8quot; when quot;0000quot;, -- @000 xquot;Cquot; when quot;0001quot;, -- @030 xquot;Equot; when quot;0010quot;, -- @060 xquot;Fquot; when quot;0011quot;, -- @090 = Pi/2 = max xquot;Dquot; when quot;0100quot;, -- @120 xquot;Bquot; when quot;0101quot;, -- @150 xquot;8quot; when quot;0110quot;, -- @180 = Pi xquot;5quot; when quot;0111quot;, -- @210 xquot;2quot; when quot;1000quot;, -- @240 xquot;1quot; when quot;1001quot;, -- @270 =3/2*Pi= min xquot;2quot; when quot;1010quot;, -- @300 xquot;4quot; when quot;1011quot;, -- @330 xquot;8quot; when others; -- @360 process (PWMclk,PWMen) -- PWM counter begin if (PWMen='0') then PWMcnt <= quot;0000quot; ; --- disable/stop PWM else if(PWMclk'Event and PWMclk='1') then PWMcnt <= PWMcnt +'1'; end if; end if; end process; process (dtsin,PWMcnt)-- SIN PWM comparator output begin if (dtsin > PWMcnt ) then SinOut <= '0' ; else SinOut <= '1'; end if; end process; process (dtcos,PWMcnt)-- COS PWM comparator output begin if (dtcos > PWMcnt ) then CosOut <= '0' ; else CosOut <= '1' ; end if; end process; with dir select -- for COS data 8-input data multiplexer
  • 6. Cout <= CosOut when '0', -- 128@000=0 Sinout when others; with dir select -- for COS data 8-input data multiplexer Sout <= SinOut when '0', -- 128@000=0 CosOut when others; end BHVa; In Download [1] section - BLCD_CPLD.zip you'll find the schematic and BOM. Projects bldc brushless direct current motor cpld Trademarks Source URL: http://dev.emcelettronica.com/brushless-dc-electric-motor-control-cpld Links: [1] http://dev.emcelettronica.com/download