Professional Documents
Culture Documents
GNU/Linux and FPGA in Real-Time Control Applications: Pavel Pisa Pisa@cmp - Felk.cvut - CZ CC By-Sa
GNU/Linux and FPGA in Real-Time Control Applications: Pavel Pisa Pisa@cmp - Felk.cvut - CZ CC By-Sa
GNU/Linux and FPGA in Real-Time Control Applications: Pavel Pisa Pisa@cmp - Felk.cvut - CZ CC By-Sa
Pavel Pisa
pisa@cmp.felk.cvut.cz
CC BY-SA
2017-03-05
InstallFest 2017
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction
BLDC/PMSM Motor Control
Other Projects
Content of Presentation
1 Introduction
3 Other Projects
Background Introduction
Previous Presentations
InstallFest 2015
Related Articles
The most recent theses I lead in motion control and FPGA area
Radek Mečiar: Motor control with Raspberry Pi board and
Linux, 2014 (PDF)
Martin Meloun: FPGA Based Robotic Motion Control
System, 2014 (PDF)
Martin Prudek: Brushless motor control with Raspberry Pi
board and Linux, 2015 (PDF)
Nepivoda Tomáš: DC Motor Control Peripheral Module for
Zynq Platform, 2016 (PDF)
Martin Jeřábek: FPGA Based CAN Bus Channels Mutual
Latency Tester and Evaluation, 2016 (PDF)
Electric Motors
main categories:
brushed DC – motor with mechanical commutator
brushless DC motor (BLDC)/Permanent magnet synchronous
motor PMSM – comutator replaced by control electronics –
needs position/sector sensor or position estimation
stepper motor – synchronous motor, position usually enforced
by direct drive
induction or asynchronous motor – exact position is not strictly
required for control, torque is function of slip of rotor behind
rotating magnetic field
Raspberry Pi Applications
facts
intended for education
provides decent performance for video playback
is really cheap
the last point is important
used for many hobby projects, strong community
used even in commercial solutions due to low cost even that it
is not intended for such use
Alternatives
Many better alternatives exists for full featured GNU/Linux
systems for industrial applications.
There are listed few ones
FreeScale i.MX53 – ARM Cortex A8, ETHERNET, CAN,
USB, . . .
FreeScale i.MX6 – ARM Cortex A9
TI AM335x Sitara ARM Cortex-A8 (Beagle Bone black) –
adds quadrature encoder inputs, two real time coprocessor
units (PRU)
Ti AM437x – Cortex A9 based, 2×PRU
Ti AM5728 – dual core Cortex A15, PowerVR GPU, 2×
Cortex M4 cores, dual core C66x DSP, IVA (H.264), 2×PRU
Xilinx Zynq-7000 – 2×Cortex A9, FPGA
Other PowerPC, SPARC based solution are used for military and
space.
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction BLDC Motor Basic
BLDC/PMSM Motor Control BLDC Motor Control Realized by RPi with SPI FPGA Peripheral
Other Projects Xilinx Zynq-7000 FPGA and Control
Outline
1 Introduction
3 Other Projects
1.0
0.5
0.0
0.5
1.0
0 1 2 3 4 5 6
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction BLDC Motor Basic
BLDC/PMSM Motor Control BLDC Motor Control Realized by RPi with SPI FPGA Peripheral
Other Projects Xilinx Zynq-7000 FPGA and Control
1.0
0.5
0.0
0.5
1.0
0 1 2 3 4 5 6
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction BLDC Motor Basic
BLDC/PMSM Motor Control BLDC Motor Control Realized by RPi with SPI FPGA Peripheral
Other Projects Xilinx Zynq-7000 FPGA and Control
Unipolar/Zero-based Voltage
Angular speed ω
8
462
02
46
80 1 2 3 4 5 6
Phase voltages uA ,uB ,uC – subtracted min (uA , uB , uC )
1.5
1.0
0.5
0.0
0 1 2 3 4 5 6
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction BLDC Motor Basic
BLDC/PMSM Motor Control BLDC Motor Control Realized by RPi with SPI FPGA Peripheral
Other Projects Xilinx Zynq-7000 FPGA and Control
index 0°
(0)
346°
(962)
317°
(881) 16°
(45)
278° 1 46°
(798) (128)
011 2
256° 001 010 76°
(711) 101 110 (211)
100
225° 105°
(292)
(626) 3
196° 134°
(544) (373)
166°
(461)
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction BLDC Motor Basic
BLDC/PMSM Motor Control BLDC Motor Control Realized by RPi with SPI FPGA Peripheral
Other Projects Xilinx Zynq-7000 FPGA and Control
IRC
ENI ENR HAL
AP
do_inp AS do_con do_out
MOSFET driver
Speed
+current limit
Inv. alpha
MOSFET driver
Q compoenent Q
+current limit
and/or
MOSFET driver
controller Park beta uA
+current limit
ENG position
D
D,Q to PMSM
RP control to u
do_gen D component A,B,C B
RS controller alpha
beta
PWM uC
MA, MS PIRC, PTPER
EP, GEN_ST PTOFS
GEN_INFO PTSHIFT
current D
iA
Forward Forward Current
iB
Park Clark ADC iC
alpha, A,B,C
current Q
beta to
to alpha,
D, Q beta
Outline
1 Introduction
3 Other Projects
Motor Motor
driver
Raspberry Pi
+ Linux 4.6. 7- RT
Expansion
unit
with
FPGA
FPGA CPU
SPI
position
Hall 1 Hall2 Hall3
adc_reader qcounter
phase 1
phase 3
phase 2
Irc_A Irc_B
Ch0 Ch1 Ch2
I/Opins
CLK gen.
Hall ef ect IRC input of
ADC output output
sensors output output half-bridges (50MHz)
double (3)
double (3)
int32
IRC-display
3
[1x3]
Manual int32 -860
PWM_VAL PWM SW sfPMSMonSPI IRC-scope
int32
Index Pos
double (3)
[1 1 1] irc_val single single
-K- round 62
int32
PWM_EN irc_indx
Gain1 Rad 2 Deg Com phase deg
PMSMonSPI irc_occur single
phase rad [phase_rad]
hal
uint32 phase_rad
1000 irc_per_com
double
IRC per com 55 irc_ph_shift Double Click
IRC Phase Shift
to run model on RPi
IRC to phase
IRC Inputs
2000
1500
1000
500
−500
−1000
−1500
−2000
0 2 4 6 8 10 12 14 16 18 20
1000
500
−500
−1000
−1500
0 2 4 6 8 10 12 14 16 18 20
2000
1500
1000
500
−500
−1000
−1500
−2000
0 2 4 6 8 10 12 14 16 18 20
Outline
1 Introduction
3 Other Projects
MicroZed
Source: http://microzed.org/product/microzed
Source: https://cw.fel.cvut.cz/wiki/courses/b35apo/start
Source: https://www.xilinx.com/products/silicon-devices/soc/zynq-7000.html
Address
form
CPU
Memory mapped
Input/Output range
RAM memory
Source: PiKRON
Pavel Pisa pisa@cmp.felk.cvut.cz CC BY-SA GNU/Linux and FPGA in Control
Introduction
BLDC/PMSM Motor Control
Other Projects
LX ROCON – Features
Conclusion