CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > PIC Programing / Design


PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 10-14-2007, 11:12 PM
bsharp's Avatar  
Join Date: Apr 2005
Location: usa
Posts: 82
bsharp is on a distinguished road
Pic BDC Servo

I have been reading a lot about building BDC Servo Drivers. And was wondering if any one has tried out any of these. http://www.e-sonic.com/whatsnew/Micr...nput/AN532.pdf
or
http://www.datasheetarchive.com/preview/683956.html
From what I have read microchip stuff seems to be the most intuitive for me.
And after reading through the pdfs the simple design of the dev boards looks like something that I could handle.
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 10-15-2007, 08:26 AM
 
Join Date: Sep 2007
Location: Canada
Posts: 3
Staverous is on a distinguished road

Hi there,

Just a quick background on me, I am a Electronics Technologist, IE: I design embedded systems for the most part.

In my experience with learning and using microcontrollers is that PIC's are the easiest to learn because of their small command set(34 instructions) compare to motorola or AVR's (130ish). I also looked at those application notes and both are very doable since Microchip makes good app notes, I don't know your packground but if you are less than electrically inclinded I would probably lean towards the AN718 since it doesn't take much figuring for the electronics and it mostly code which seems to be mostly given. The other(AN532) gives all the schematics for making the controller with alot of descrete parts, and also most of the code. Either way this is going to take alot of effort but after you have it figured the first time you will be able to make as many as you want.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 10-15-2007, 07:06 PM
bsharp's Avatar  
Join Date: Apr 2005
Location: usa
Posts: 82
bsharp is on a distinguished road

I am a Mechanical/Design engineer by trade. And also have a lot of IT and computer programming skills. I have learned quite a bit about electronics hands on over the years but this would be pushing it to venture alone. My brother in law is an Electronics Engineer and he said that he would help me out with it. He is a little unfamiliar with the application as he mainly works with RF stuff. So any guidance by an experienced hand is welcome and appreciated. I am not looking to mass produce them or anything just to learn more and pay it forward.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 10-15-2007, 07:50 PM
 
Join Date: Dec 2006
Location: Australia
Posts: 29
bobs bots is on a distinguished road
Brushed DC servo drives using PIC etal.

Hi , Just some additional comments:

(a) You first need to look at your requirements, the PID implementation here may be more than you need. Figure out how much mass you are trying to position, how much friction you have and how quickly you are trying to move it, and how much backlash you have. A simple proportional only control with deadband does surprisingly well.
(aa) Do you need profiling capability? (i.e. synchronised motion between two or more motors) this adds a lot of extra complexity, and may lead you to using a larger chip that drives two or more axes.
(aaa) How are you planning to drive the servo controller?, there are two basic flavours, using a "goto xxxx" command through a serial port or using a step and direction input to emulate a stepper motor.

(b) I'd recommend first buying a micro on a header board (you can plug this into a bread board and play with it without lifting a soldering iron) or a development board (eg from http://www.olimex.com/dev/index.html , e.g. the PIC-P18 ), . Get some software you can handle, and a programming cable. (this shouldn't cost more than $200 all up). As I'm in Australia I can get all my stuff from Dontronics (www.dontronics.com), but in the US you have a larger supplier base, hobbyengineering.com has a good collection of microcontroller kits. (http://www.hobbyengineering.com/CatPCPROTO.html)

(c) ensure your system incorporates an in-system programming cable and a serial port - both of this are critical for rapid debugging and development.
DON'T buy a dedicated programmer, this will be a waste of money (until you start manufacturing hundreds of servo controllers!)

(d) Be aware that most of the H -bridge IC's on the market tend to be a bit optimistic on the current ratings, and that in most servo motors the peak currents can be very much higher than the average current.

(e) The pitman motors are a good choice for prototyping, you can get them on Ebay for ~ $20 , but don't expect to be able to move heavy payloads with them, they will drive printheads and the like. Once you move to bigger motors you will probably need to change to discrete MOSFETs on the H bridge.

(f) While you are experimenting it is a good idea to put a small filament bulb in series with your motor (automotive stop lamp or headlight depending on motor size), this makes the whole system less edgey, and if the servo system oscillates or the motor hits a stop, it just lights up the bulb rather than smoking the driver chip.

(g) Be aware with most micros that some of the pins have multiple functions, so check the data sheet to see what you are sacrificing to get your desired features. This is important with PWM pins as PWM mode usually disables some other timer function.


Personally I prefer the Atmel AVR range, but this preference dates back 10 years or so ago when ATMEL had EEPROM, ADC's, crystal oscillators, and FLASHRAM on chip. I also prefer to code in BASIC , and compile this using the MCS-electronics compiler. But there's no obvious reason to prefer AVR or PIC (it's the same choice as GM vs Ford). It usually boils down to which one has peripheral I/O functions that best match your application.

Cheers, BobT
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 10-15-2007, 07:51 PM
 
Join Date: Sep 2007
Location: Canada
Posts: 3
Staverous is on a distinguished road

given that you want to learn I would go with the app note 532, because it is easier to modify but works in a similar fashion. Hopefully money isn't much of an issue cause most of the cheap programmers for PIC's can't program the one they suggest and the other programmers are fairly expensive. Any specific questions just ask I will help as much as I can.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-16-2007, 12:51 AM
 
Join Date: Aug 2007
Location: Mexico
Posts: 6
cinerman37 is on a distinguished road
more information in industrial aplications

Need more information under this aplication of Servo article
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 10-16-2007, 04:00 PM
 
Join Date: Sep 2005
Location: turkey
Posts: 29
nerginer is on a distinguished road
lets make some experiments

Hi,

The topic is the one I want to work on. We can make some experiments and share the results in a project page.

can someone do this documentation and project management stuff?


I want to suggest you an atmel based platform which is free for the experiments. please check

http://www.arduino.cc/
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 10-17-2007, 11:22 PM
bsharp's Avatar  
Join Date: Apr 2005
Location: usa
Posts: 82
bsharp is on a distinguished road

Wow thanks for all the great advise!
I am going to just try it out with a small motor on a bench to start with.
I would like to use step and directions signals from a PC.
I have read through most of the note's on the PIC16F 18F and 30F on the microchip site. And they have a lot about the feed back and control loop.
But I don't see any mention of any thing other than ASCII commands for positioning. Is this something I could program the PIC to do?
Or should I just order a couple and learn a bit more by playing with them?
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 10-21-2007, 05:02 PM
bsharp's Avatar  
Join Date: Apr 2005
Location: usa
Posts: 82
bsharp is on a distinguished road

After a bit of research I bought a few DSPIC30F's to play with. After all the documentation I have went through it makes a lot more sense to me now. Reading about these looks interesting! you could drive BLDC, BDC and I think steppers off this thing with some creative programming. I will post some info after I get something spinning.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 10-22-2007, 03:06 PM
 
Join Date: Dec 2005
Location: Usa
Posts: 93
Horsedorf is on a distinguished road
Buy me a Beer?

The only thing that might be an issue for you unless you can program plds, is that you might have to implemenet the encoder pld as discrete logic instead of using a pld. Other than that, it looks like a fun project!

AND, in fact, the link http://www.datasheetarchive.com/preview/683956.html has a pdf wherein just such a circuit exists using a pair of d flipflops! This is for a quadrature encoder.

Last edited by Horsedorf; 10-22-2007 at 03:17 PM. Reason: adding link
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-22-2007, 05:28 PM
bsharp's Avatar  
Join Date: Apr 2005
Location: usa
Posts: 82
bsharp is on a distinguished road

This is the one that I am getting it is A DSPIC30F4011 http://ww1.microchip.com/downloads/e...Doc/70135E.pdf
It says it has a quad A and B interface module.
I found an example on the web but it is uses an opamp instead of an Hbridge.
And it says it uses quadrature for the input.
http://members.shaw.ca/swstuff/dspic-servo.html
Once I get the chip's I can start playing and it shouldn't take me long to learn it's lingo.
I have programmed different stuff in C before so it makes it a little easier.
I am thinking I will need to code something to use the discrete logic to collect the step pulses and direction signal and couple this to the rest of the loop.
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 10-22-2007, 08:12 PM
 
Join Date: Dec 2005
Location: Usa
Posts: 93
Horsedorf is on a distinguished road
Buy me a Beer?

Ah, good. I presume you already have a pic programmer so that you can program those puppies when they show up. That schematic looks ... uh.. kind of odd to me. For example, the use of +/- 25 volts to drive the motor seems like it would be a pain in the rump. I'm not sure why they wired it up the way they did.

The use of quadrature input on the dspic , if it has that built in, should work out well. I also don't see any inputs other than the serial port, so I'm assuming it's a vector based implementation. (I'll have to look at it more closely tomorrow), and if so, you can just use the direction and step pins to increment or decrement the target location, and HOPEFULLY, if the code is well written as it stands (Again, I'll sneak a peek at it tomorrow), then it will jsut move the motor to the desired location... OH! I get the voltages now, yeah, it's an opamp in unity gain mode, so it will try to allways drive the output to equalize the inputs. So when you drive teh output, you will be using a voltage from the pic, (Pin labled as RE2) and the current limit is set by varying the voltage to the ilim pin on the op amp.

HUH... not sure if I like it, but it looks like it would work.
and 7.5 amps is a lot of current. That could turn a pretty hefty motor.

Okay, I lied, I'mlooking at it now. ... cmd_posn is the variable you want to modify to make the servo seek to a new position.

Rick

Last edited by Horsedorf; 10-22-2007 at 08:35 PM. Reason: add finding.
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with servo and servo drive littlejohn Servo Motors and Drives 0 09-14-2007 06:22 PM
Servo drive / Servo Amplifier Ken_Shea Servo Motors and Drives 9 07-10-2007 06:12 PM
pm feild servo servo eloid Servo Motors and Drives 4 03-03-2007 05:27 PM




All times are GMT -5. The time now is 09:40 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353