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 12-25-2008, 05:04 PM
 
Join Date: Dec 2008
Location: Israel
Posts: 2
CyberArtem is on a distinguished road
Unhappy Strange signal noises from pic16f84a

Hello all
I am building a home made 3 axis cnc router controlled with a custom software written by me. Right now i have 90% finished the router design and working on the electronics , i decided to use pic16f877a as a main controller to which i will connect via 8-bit bus 3 small pic16f84a controllers each of them will control the axis motor with L297+L298 along with two optical interrupters, the communication pic16f877a <=> 3 x pic16f84a is made by a custom commands protocol. I have constructed one "Slave" module for testing and i am sending control packets to it from the "Master" pic. Now the problem i have is that suddenly after a few correct movements the motor starts to rotate rapidly to different directions and don't respond to incoming commands anymore. Even if i disconnect it from the control bus. I think the 'slave' pic is getting 'crazy' somehow, i have tried to pull down the input pins of the pic , tried to add filter capacitors on the VDD lines 5 and 12 volts (for the motor) , nothing helps. I have spent much time trying to figure out whats the problem is but with no luck. Can someone post a working diagram interfacing L297 with PICs. Thanks
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 01-20-2009, 10:15 PM
 
Join Date: Aug 2005
Location: U.S.A
Posts: 52
Megahertz is on a distinguished road

Is the 16F84A watchdog timer reseting the micro and causing the strange behavior?
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 01-22-2009, 09:08 PM
 
Join Date: May 2006
Location: USA
Posts: 37
sswitaj is on a distinguished road

I'm assuming that you're using the internal PWM registers. Check carefully that you're not accidentally writing garbage to those registers. If you have an ICD, stop the chip and check that the actual register values match what you think should be in there.

A common culprit is a read or write to the same address in another bank, with a mis-set bank select register or access bank bit that accidentally overwrites an sfr.

Gg through your address map, and figure out what's in the other banks at that "same" address and see if you might be trying to change those registers.

Alternately, check that you haven't accidentally defined a working variable to use the same space, an easy mistake with two overlapping cblock definitions.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 01-23-2009, 09:46 AM
 
Join Date: Dec 2005
Location: Usa
Posts: 93
Horsedorf is on a distinguished road
Buy me a Beer?

Also, you might want to make sure your command protocol is robust, such that it checks and detects errors in the data stream and doesn't simply assume anything given to it is a valid command. You might want to have your command parser , whe nit sees an invalid command, have it raise an IO pin and simply spin so that you can see if that it what is going on.
You could have stack corruption. You could have noise on your encoder data lines... the possibilities are rather numerous.

Tricks.

Keep a set of io pins spare that you can attach led's to, or a scope to, and have your code write out to these IO pins constantly so that you can follow where it is in the software. You can also use these to display error conditions such that when you have a section of code processing data that you KNOW should be within a certain range, and find out that it's not, you can raise one of the lines or write a certain value to the data lines. Using one line per error is the best so that you can keep track of multiple errors, using all the lines to encode a value gives you more error codes you can watch for though, however, the rate of error writes to those pins would predicate the need for a logic analyzer or some way to record the changes that go onto them.

Good luck.
Horsedorf
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 01-23-2009, 04:33 PM
 
Join Date: Aug 2005
Location: U.S.A
Posts: 52
Megahertz is on a distinguished road

I do not believe the PIC16F84A is ICD capably.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 02-10-2009, 10:36 PM
 
Join Date: Feb 2007
Location: canada
Posts: 559
Larken is on a distinguished road

The 297/298 can't run away on a stepper motor. It only moves if you send it pulses. SO
The PIC is sending it pulses. Probably your code is stuck in a loop and not exiting.
It takes 1000's of compile-test-fix-recompile steps to get all the bugs out.

Have the step routine output a flag or character when it hits the end of the routine. This way you see if it ever got there and exited.
__________________
Manufacturer of CNC routers and Viper Servo Drives
www.LarkenCNC.com and www.Viperservo.com
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
PIC16f84A as stepper controller rich200313 Controller Cards 8 03-20-2008 03:46 PM
DR SIGNAL OFF mustafaguler Fanuc 0 02-22-2008 01:46 AM
L298/L297 strange stepper motor noises cnc kiwi Stepper Motors and Drives 7 12-26-2007 11:18 AM
Whine / squeal noises when machine idle bkraz Bridgeport and Hardinge Mills 5 02-09-2006 06:29 AM
Looking strange CNCadmin CNCzone Site News and Contests 0 09-15-2005 10:04 AM




All times are GMT -5. The time now is 04:47 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