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 > Stepper Motors and Drives


Stepper Motors and Drives Discuss stepper motors, drivers and related topics here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 11-03-2006, 02:16 PM
 
Join Date: Dec 2004
Location: USA
Posts: 16
KPyro is on a distinguished road
Can someone tell me how this PIC works?

I have been looking at this app note
http://ww1.microchip.com/downloads/e...tes/00822a.pdf
trying to figure out how the current feedback works.

I am not firmilure with the PIC CPU but looking at the asm code
I cant see where it even looks at the feedback signal AIN1 and AIN3
they go back to RA1 and RA3 but it doesnt even look like the software
ever checks them.

I understand the electronics it just looks to me like the program runs at
a set current value and ignores the feedback.

Also what do you think about the 100% on time in one phase and varing the other phase, every other microstepper driver I've seen varies both phases.

Hope someone can help me with this.
Thanks
Ken
Reply With Quote

  #2   Ban this user!
Old 11-03-2006, 02:29 PM
 
Join Date: May 2003
Location: USA
Posts: 550
fyffe555 is on a distinguished road

The Pic has hardware PWM, the code just has to set the % value and the hardware does the rest, including monitoring feedback.

Only varying one phase? why? one you've got setup to manage one phase its just as easy to manage both. Not sure the motor would like 100% on one phase and not on the other.
Reply With Quote

  #3   Ban this user!
Old 11-03-2006, 02:53 PM
 
Join Date: Dec 2004
Location: USA
Posts: 16
KPyro is on a distinguished road

Originally Posted by fyffe555 View Post
The Pic has hardware PWM, the code just has to set the % value and the hardware does the rest, including monitoring feedback.
I'll have to look at the data sheet again I looked for that possability but didnt see it.

Originally Posted by fyffe555 View Post
Only varying one phase? why? one you've got setup to manage one phase its just as easy to manage both. Not sure the motor would like 100% on one phase and not on the other.
Yeah I didnt see the logic either. It said something about maxamizing torque which I can kinda see but it seems to be using percentages that you would see
if you were varing both.

Thanks for the reply I am off to read the data sheet again and see what I missed.
Reply With Quote

  #4   Ban this user!
Old 11-03-2006, 03:41 PM
 
Join Date: Dec 2004
Location: USA
Posts: 16
KPyro is on a distinguished road

Ok I give up I cant find anywhere in the data sheet or searching on the web
Where the input to the compartor RA1 or RA3 affects the PWM in any way.

Can you point me to a datasheet or appnote that explains it?

I am trying to do this in a AVR chip because I am much more comfortable
with them but I need to under stand how this one works first.

Thanks
Ken
Reply With Quote

  #5   Ban this user!
Old 11-03-2006, 04:28 PM
 
Join Date: May 2003
Location: USA
Posts: 550
fyffe555 is on a distinguished road

I'm not sure I'm following the question but from a real quick scan of the sheet the actual PWM control of the motors current is actually controlled by the L298, not the Picmicro and the pic isn't using the feedback voltage(s).

L298 appears to be passing a sense voltage back to the 18F/C452 on AN1/RA1 AN3/RA3 but the Pic is actually setting its PWM's from a truth table based upon microstepping, speed etc and setting the duty cycle of CCP1/2 from those tables directly.

There doen't appear to be any code to deal with AN1/2 RA1/RA3 and I don't think its doing anything with the input voltage and doesn't seem to do anything with portA at all. It might be directly loading values to registers to determine if the motor is running or what the direction is later but I didn't go that deep.

I'm not sure thats of any help.? Hopefully someone who knows what they're talking about will be along shortly!
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 11-03-2006, 04:54 PM
 
Join Date: Dec 2004
Location: USA
Posts: 16
KPyro is on a distinguished road

Originally Posted by fyffe555 View Post
I'm not sure I'm following the question but from a real quick scan of the sheet the actual PWM control of the motors current is actually controlled by the L298, not the Picmicro and the pic isn't using the feedback voltage(s).
No the L298 does no currrent control the current though the r9 and 10 develops a voltage proportinal to the motor current and is fed back to the
controling device L297 or micro in this case whitch varies the PWM to raise
or lower the current.

Originally Posted by fyffe555 View Post
There doen't appear to be any code to deal with AN1/2 RA1/RA3 and I don't think its doing anything with the input voltage and doesn't seem to do anything with portA at all.
Thats what I thought I've looked at the code for hours and it just doesnt seem to control the current at all just spit out a PWM value and HOPE that
its not to high for the motor.

Originally Posted by fyffe555 View Post
I'm not sure thats of any help.? Hopefully someone who knows what they're talking about will be along shortly!
Hey ya tried and ya got me thinking. Maybe I could use those feedbacks as an interupt trigger and manually turn off the PWM output in the ISR.

Thanks
Ken
Reply With Quote

  #7   Ban this user!
Old 11-03-2006, 07:04 PM
jeffs555's Avatar  
Join Date: Jun 2004
Location: United States
Posts: 463
jeffs555 is on a distinguished road

That appears to be like a lot of other Microchip app notes; good for understanding the basics, but missing a lot of stuff needed for a practical design. The part about driving one phase full on doesn't make much sense. The main reason for microstepping is smoothness, and with one phase full on and a sine on the other the torque will be varying throughout the rotation which is not the best for smooth movement. Like you, I couldn't find anywhere in the code where they were looking at the current feedback.
Reply With Quote

  #8   Ban this user!
Old 11-03-2006, 07:32 PM
 
Join Date: Dec 2004
Location: USA
Posts: 16
KPyro is on a distinguished road

Thanks Jeff At least I dont feal like I am missing something anymore.
I hate app notes like that I am not smart enough to catch there mistakes
Reply With Quote

  #9   Ban this user!
Old 11-03-2006, 07:32 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

I'vd been through this app note before also, and come to the same conclusions on the comparitor inputs as being unused. My conclusion was it used duty cycle only current control, and that it used a VS equal to the coil voltage of the motor, thus no chopping action on 100% currents. I can't say that I subscribe to free running async duty cycle variation as a good method to do microstepping.
__________________
Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
Vist my websites - http://pminmo.com & http://millpcbs.com
Reply With Quote

  #10   Ban this user!
Old 12-09-2006, 09:31 AM
 
Join Date: Nov 2006
Location: Slovakia
Age: 25
Posts: 15
Tracid is on a distinguished road

I read that datasheets theorethical part but didnt the code itself.

-these comparators interrupt so theres no need to check them.
-duty cycles are picked from the duty cycle lookup table and only the full ON phase is switched to 50percent if the comparator interrupts.
This is what should happen,but since i didnt read the code i cant say if they really wrote the code this way.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-09-2006, 03:48 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

Tracid,
The code doesn't use the interrupts, they are never setup or enabled.
__________________
Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
Vist my websites - http://pminmo.com & http://millpcbs.com
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 04:32 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 354 355 356 357 358 359 360 361