Bobbla
Newbie
Offline
Posts: 22
Thank You
-Given: 2
-Receive: 16
|
 |
« on: March 24, 2012, 09:24:23 21:24 » |
|
So this is a small project I am throwing my spare time away with, it is still in progress.  I use a PIC12F1822, it receives commands over I2C. The commands can do stuff.. like change duty cycle and period time. There is a doc document that is a little more descriptive then this, maybe a little to much. But like I said, still in progress. I was thinking that I would add optocoupler or similar, but I don't know much about it... Please if you could give me some feedback that would be nice  File contains some proteus files, .C, .h, .cof and other files... If you have CCS IDE and compiler which this is coded in the open the .pjt file and edit the paths before opening the .pjt file with the CCS IDE. Cheers 
|
|
|
Logged
|
|
|
|
SteveyG
Newbie
Offline
Posts: 23
Thank You
-Given: 4
-Receive: 9
|
 |
« Reply #1 on: March 25, 2012, 07:51:01 19:51 » |
|
What function would the optocoupler perform? Are you intending to optically isolate the I2C bus or something else?
|
|
|
Logged
|
|
|
|
alexisnik
Junior Member

Offline
Posts: 58
Thank You
-Given: 25
-Receive: 6
|
 |
« Reply #2 on: April 04, 2012, 12:11:13 12:11 » |
|
Hi,
What is the final goal of the project? I guess you are using a plain DC brushed motor, right? And an H-Bridge to drive the motor?
You need to provide some more info and why do you need the opto-isolation...
|
|
|
Logged
|
|
|
|
solutions
Hero Member
   
Offline
Posts: 1826
Thank You
-Given: 656
-Receive: 905
|
 |
« Reply #3 on: April 05, 2012, 04:06:47 04:06 » |
|
Motor control is completely built into other Microchip micros.
You are using a screwdriver to hammer a nail.
|
|
|
Logged
|
|
|
|
programmer5
Inactive
Offline
Posts: 2
Thank You
-Given: 0
-Receive: 0
|
 |
« Reply #4 on: April 06, 2012, 09:37:30 21:37 » |
|
"I use a PIC12F1822, it receives commands over I2C." so first thing is that you've to configure PIC as a slave for receiving i2c commands, have you done it?
"The commands can do stuff.. like change duty cycle and period time." ok, once you done configuring PIC as a slave, this thing is simple.
" I would add optocoupler or similar," if you are using hbridge, then you may need gate driver ICs, and to drive gate driver ICs, optocouplers are required.
"If you have CCS IDE and compiler which this is coded in the open the .pjt file and edit the paths before opening the .pjt file with the CCS IDE." i only use mikroC, sorry for that.
|
|
|
Logged
|
|
|
|
solutions
Hero Member
   
Offline
Posts: 1826
Thank You
-Given: 656
-Receive: 905
|
 |
« Reply #5 on: April 07, 2012, 10:23:13 10:23 » |
|
if you are using hbridge, then you may need gate driver ICs, and to drive gate driver ICs, optocouplers are required. I suggest you stick to what you do well - programming. Optos are among the the worst of choices for an accurate and reliable power supply and are absolutely not "required" for gate drive from a micro. That said, it sounds like these "commands" may be going to a high voltage motor from a human operator - in that case, isolation of some kind is needed for safety.....if you don't know what you are doing in this area, Bobbla, don't.
|
|
|
Logged
|
|
|
|
Elmer
Junior Member

Offline
Posts: 41
Thank You
-Given: 13
-Receive: 11
|
 |
« Reply #6 on: April 09, 2012, 12:05:44 00:05 » |
|
Bobla, You should jump to dsPIC33, MC type (motor controller). dsPIC in C is not much different from other PIC and the asm has some great 16x16-bit MAC instructions for semi-DSP action (eg. simple digital filters). Some devices also have DMA which work with the peripherals, reducing the MCU load by offloading primitive tasks to DMA and interrupts. I can recommend the 28/44-pin DIP/SO/TQFP/QFN dsPIC33F/ dsPIC33E series with peripheral pin select crossbar, that lets you reconfigure pins to interfaces runtime (sometimes very handy). Those also come with DMA (use microchip filter tool to select device based on preferences), and as mentioned make sure you get the "MC" parts for the right PWM hardware. 28-pin DIP package also makes them very proto friendly. Beware that some new dsPIC33/PIC24 devices now require the new ICD3 programmer that has some new low-voltage programming features (I had to acquire one recently as pun for putting such a part on a small PCB series  $$ ). PIC24 BTW doesn't have the motor control feature you want nor the hardware MAC. FYI, Allegro has some very integrated brushless DC motor drivers with very good specs  EDIT: Dan Strother has a nice ARM-based BLDC project on his page, along with some thoughts and observations. RR.
|
|
« Last Edit: April 09, 2012, 12:18:59 00:18 by Elmer »
|
Logged
|
peace in the valley
|
|
|
SteveyG
Newbie
Offline
Posts: 23
Thank You
-Given: 4
-Receive: 9
|
 |
« Reply #7 on: April 12, 2012, 09:50:23 09:50 » |
|
Bobla, You should jump to dsPIC33, MC type (motor controller). dsPIC in C is not much different from other PIC and the asm has some great 16x16-bit MAC instructions for semi-DSP action (eg. simple digital filters). Some devices also have DMA which work with the peripherals, reducing the MCU load by offloading primitive tasks to DMA and interrupts.
I can recommend the 28/44-pin DIP/SO/TQFP/QFN dsPIC33F/dsPIC33E series with peripheral pin select crossbar, that lets you reconfigure pins to interfaces runtime (sometimes very handy). Those also come with DMA (use microchip filter tool to select device based on preferences), and as mentioned make sure you get the "MC" parts for the right PWM hardware. 28-pin DIP package also makes them very proto friendly. Beware that some new dsPIC33/PIC24 devices now require the new ICD3 programmer that has some new low-voltage programming features (I had to acquire one recently as pun for putting such a part on a small PCB series Angry $$ ). PIC24 BTW doesn't have the motor control feature you want nor the hardware MAC.
FYI, Allegro has some very integrated brushless DC motor drivers with very good specs Wink
EDIT: Dan Strother has a nice ARM-based BLDC project on his page, along with some thoughts and observations. RR.
I think all of the dsPICs have DMA. The PICkit3 is a lower cost device which will still program these devices.
|
|
|
Logged
|
|
|
|
Elmer
Junior Member

Offline
Posts: 41
Thank You
-Given: 13
-Receive: 11
|
 |
« Reply #8 on: April 12, 2012, 09:27:37 21:27 » |
|
I think all of the dsPICs have DMA. The PICkit3 is a lower cost device which will still program these devices.
None of the 30-series dsPICs has DMA, and lots of dsPIC33F doesn't either. All 33E devices however, has DMA.
|
|
|
Logged
|
peace in the valley
|
|
|
solutions
Hero Member
   
Offline
Posts: 1826
Thank You
-Given: 656
-Receive: 905
|
 |
« Reply #9 on: April 13, 2012, 08:14:08 08:14 » |
|
What do you need DMA for?
|
|
|
Logged
|
|
|
|
GunMage
Junior Member

Offline
Posts: 65
Thank You
-Given: 11
-Receive: 35
|
 |
« Reply #10 on: April 13, 2012, 05:17:33 17:17 » |
|
I suggest you stick to what you do well - programming. Optos are among the the worst of choices for an accurate and reliable power supply and are absolutely not "required" for gate drive from a micro.
That said, it sounds like these "commands" may be going to a high voltage motor from a human operator - in that case, isolation of some kind is needed for safety.....if you don't know what you are doing in this area, Bobbla, don't.
Just as a point of reference I isolate everything I can to include driving motors. However my stuff typically is 3-6KM subsea. The methodology used in design needs to be such that it makes sense for it's use. Solutions is quite right in stating make certain you know what you are doing or the end result could be catostraphic. Yes, Allegro makes some good motor drivers. I personally have used A3955 & more recently A4975. However I recently switched to ST Micro parts. More specifically L6207 http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00002293.pdf
|
|
|
Logged
|
|
|
|
Elmer
Junior Member

Offline
Posts: 41
Thank You
-Given: 13
-Receive: 11
|
 |
« Reply #11 on: April 15, 2012, 11:34:36 23:34 » |
|
What do you need DMA for?
Nothing at all really, just a feature I value whenever having the opportunity, like a remainder "when choosing dsPIC, remember some parts have DMA and some don't". The DMA part was really taken out of a sentence here, let's just bury it as OT cause that's really what it is. A side note.
|
|
|
Logged
|
peace in the valley
|
|
|
Bobbla
Newbie
Offline
Posts: 22
Thank You
-Given: 2
-Receive: 16
|
 |
« Reply #12 on: April 21, 2012, 11:54:01 23:54 » |
|
Bobla, You should jump to dsPIC33, MC type (motor controller). dsPIC in C is not much different from other PIC and the asm has some great 16x16-bit MAC instructions for semi-DSP action (eg. simple digital filters). Some devices also have DMA which work with the peripherals, reducing the MCU load by offloading primitive tasks to DMA and interrupts.
I have actually used a dsPIC33F before, but it was in a project I never really finished. (Seems to be lots of em now a days..) I will look at the ARM link you posted, might be interesting. I don't really know much about power electronics(and that is why I do these projects). I suggest you stick to what you do well - programming. Optos are among the the worst of choices for an accurate and reliable power supply and are absolutely not "required" for gate drive from a micro.
That said, it sounds like these "commands" may be going to a high voltage motor from a human operator - in that case, isolation of some kind is needed for safety.....if you don't know what you are doing in this area, Bobbla, don't.
This project is nothing more then me learning stuff in my spare time, and I do it mostly just to learn stuff. That being said, this was the first time I've used a PIC12 or CCS. There are no real requirements and I just do this for fun. I've never build a circuit with optocoupler before, nor really known anything else about it. A friend of mine talked about it and I thought this might be interesting so here I am. I've read a little about it and I can conclude that...  In short the optocoupler is not needed, but a curiosity. I'm also sorry that it took me so long to respond, been busy. Hope that answered some questions, cheers 
|
|
|
Logged
|
|
|
|
|