Helpful ReplyHot!Timers and Three Phase Motors

Author
naeem1234
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
2018/10/04 23:11:00 (permalink)
0

Timers and Three Phase Motors

Hello Everyone
 
Can anyone tell me where to find sample codes for using 16-bit timers to generate 3-phase PWM's for motors?
Your help is highly appreciated.
#1
qhb
Superb Member
  • Total Posts : 9623
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/04 23:20:24 (permalink)
+1 (1)
Good idea to mention what PIC this has to run on...
 
#2
Mysil
Super Member
  • Total Posts : 3279
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/04 23:51:05 (permalink)
0
Hi,
This is in XC8 forum, so means PIC18..., PIC16... and smaller.
PIC18 with 64 MHz maximum clock frequency and 10 bit PWM resolution, will give PWM period frequency 62.5 kHz.
If higher resolution PWM were to be used, PWM period would be even slower.
 
Why do you want to use 16 bit PWM for motor control with a 8 bit microcontroller?
Do you really expect to have calculation performance to run regulation algorithms giving 16 bit control in a 8 bit microcontroller, for 3 phase motor control?
PIC24 and DSPIC33 is used for such motor control algorithms for a reason.
 
16 bit PWM in 8 bit microcontroller, mostly make sense for lighting control, where small PWM steps is needed at low light levels in order to avoid flickering and noticeable intensity steps, and to obtain precise color control.
 
    Mysil
 
#3
naeem1234
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/05 00:23:37 (permalink)
0
The PIC I would use would be most probably PIC18F46K22 as it has 4 x 16-bit timers.
My application requires a very slow control, of order of x100msec but with precision.
 
But if PIC24 or DSPIC33 are the ones more suitable for 16-bit PWM motor control then tell me where to get its sample codes?
#4
PStechPaul
Super Member
  • Total Posts : 2159
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
naeem1234
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/14 23:51:56 (permalink)
0
I wonder how can I search for all the available Microchip MCU's which have 6 PWM outputs (for Motor Control), maybe PIC16F or PIC18F or PIC24 or dsPIC's etc?
#6
qhb
Superb Member
  • Total Posts : 9623
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 00:54:55 (permalink)
+2 (2)
Have you had a look at MAPS?
MAPS - Microchip Advanced Part selector
 
#7
Mysil
Super Member
  • Total Posts : 3279
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 00:55:33 (permalink)
+2 (2)
Hi,
Microchip website have parametric product search for various families of microcontrollers and peripherals.
This is PIC16 and PIC18 devices:
https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=30048&popular=1 
You may select for number of PWM outputs, or: Complementary Waveform Generator / Complementary Output Generator, which are peripherals intended for motor control.
There are similar tables for PIC24 / dsPIC33, PIC32 and for AVR and SAM devices.
 
   Mysil
#8
naeem1234
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 02:21:07 (permalink)
0
There are some dsPIC33E MCUs which have 2 types of PWM's.. 'Motor Control PWM Outputs' and 'SMPS PWM Outputs'. What can be the differences between these two?
#9
qhb
Superb Member
  • Total Posts : 9623
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 02:33:22 (permalink)
+3 (3)
What does the datasheet say?
 
#10
naeem1234
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 03:12:31 (permalink)
0
My mistake.. its not on 1 MCU but on different MCUs, for example
 
dsPIC33EPXXGS202 has 6 PWM outputs for SMPS
while
dsPIC33EPXXMC502 has 6 PWM outputs for Motor control.
 
What could be the big difference in the two? .. as the datasheets do not compare the two types.
#11
crosland
Super Member
  • Total Posts : 1561
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Bucks, UK
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 04:40:54 (permalink)
+3 (3)
Read both data sheets and do your own comparison.
#12
qhb
Superb Member
  • Total Posts : 9623
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 04:54:01 (permalink) ☄ Helpfulby Jim Nickerson 2018/10/15 06:51:26
+3 (3)
But it's so much easier of someone else reads it for you! ;)
 
#13
naeem1234
Super Member
  • Total Posts : 450
  • Reward points : 0
  • Joined: 2015/02/19 06:39:28
  • Location: 0
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/15 06:02:56 (permalink)
0
crosland
Read both data sheets and do your own comparison.




To me it looks like the difference is in the PWM frequency and resolution. For Motor Control these are low while for SMPS these are very high compared to MC PWM.. Please correct me if I am wrong here.
#14
coffee critic
Super Member
  • Total Posts : 350
  • Reward points : 0
  • Status: offline
Re: Timers and Three Phase Motors 2018/10/16 09:07:24 (permalink)
0
If you are interested, the PSMC module that is in the PIC16F178X family has a 3 phase PWM mode built in. The PSMC chapter is only a little over 50 pages to read.

n_*$
#15
Jump to:
© 2019 APG vNext Commercial Version 4.5