Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2016, 10:12:30 22:12


Login with username, password and session length


Pages: [1]
Print
Author Topic: Motor Controller via I2C  (Read 3072 times)
0 Members and 1 Guest are viewing this topic.
Bobbla
Newbie
*
Offline 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.  Smiley

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 Cheesy


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 Smiley
Logged
SteveyG
V.I.P
Newbie
*****
Offline Offline

Posts: 21

Thank You
-Given: 2
-Receive: 9


« Reply #1 on: March 25, 2012, 08:51:01 20:51 »

What function would the optocoupler perform? Are you intending to optically isolate the I2C bus or something else?
Logged
alexisnik
V.I.P
Junior Member
*****
Offline Offline

Posts: 54

Thank You
-Given: 15
-Receive: 6


« Reply #2 on: April 04, 2012, 01:11:13 13: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 Offline

Posts: 1446

Thank You
-Given: 591
-Receive: 851



« Reply #3 on: April 05, 2012, 05:06:47 05:06 »

Motor control is completely built into other Microchip micros.

You are using a screwdriver to hammer a nail.
Logged
programmer5
Inactive

Offline Offline

Posts: 2

Thank You
-Given: 0
-Receive: 0


« Reply #4 on: April 06, 2012, 10:37:30 22: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 Offline

Posts: 1446

Thank You
-Given: 591
-Receive: 851



« Reply #5 on: April 07, 2012, 11:23:13 11: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 Offline

Posts: 43

Thank You
-Given: 14
-Receive: 8



« Reply #6 on: April 09, 2012, 01:05:44 01: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 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.
« Last Edit: April 09, 2012, 01:18:59 01:18 by Elmer » Logged

peace in the valley
SteveyG
V.I.P
Newbie
*****
Offline Offline

Posts: 21

Thank You
-Given: 2
-Receive: 9


« Reply #7 on: April 12, 2012, 10:50:23 10: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 Offline

Posts: 43

Thank You
-Given: 14
-Receive: 8



« Reply #8 on: April 12, 2012, 10:27:37 22: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 Offline

Posts: 1446

Thank You
-Given: 591
-Receive: 851



« Reply #9 on: April 13, 2012, 09:14:08 09:14 »

What do you need DMA for?
Logged
GunMage
V.I.P
Junior Member
*****
Offline Offline

Posts: 61

Thank You
-Given: 8
-Receive: 35



« Reply #10 on: April 13, 2012, 06:17:33 18: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.
Quote from: Elmer

FYI, Allegro has some very integrated brushless DC motor drivers with very good specs Wink
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 Offline

Posts: 43

Thank You
-Given: 14
-Receive: 8



« Reply #11 on: April 16, 2012, 12:34:36 00: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 Offline

Posts: 22

Thank You
-Given: 2
-Receive: 16


« Reply #12 on: April 22, 2012, 12:54:01 00: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  Tongue
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC