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! > Machine Controllers Software and Solutions > LinuxCNC (formerly EMC2)


LinuxCNC (formerly EMC2) Discuss LinuxCNC (formerly EMC2) Controlers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-22-2011, 01:08 PM
jsheerin's Avatar  
Join Date: Aug 2008
Location: US
Posts: 1,132
jsheerin is on a distinguished road
Differential encoder signal w/ parallel port?

I'm trying to setup a system to test some servo motors with the bldc component in EMC2. My motors have differential quadrature encoders with an index pulse, but I'm currently running them in single ended mode (only one line in each for the A, B and Z signals). I'm running these signals straight into parallel ports. I have three parallel ports in my machine - one port on the motherboard and two more on a pci breakout card. I'm currently having noise issues with the index pulse input. Is it possible to setup EMC2 to use the differential capabilities of the encoder? I have been searching but can't find an example of how to do this. Any help appreciated!
__________________
CNC mill build thread: http://www.cnczone.com/forums/vertical_mill_lathe_project_log/110305-gantry_mill.html
Reply With Quote

  #2  
Old 12-22-2011, 01:16 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,542
Al_The_Man is on a distinguished road
Buy me a Beer?

If the EMC2 input does not have the feature you could try a RS422 receiver right at the port, there are quite a few such as the DS3486 etc.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #3   Ban this user!
Old 12-22-2011, 01:39 PM
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 1,081
samco is on a distinguished road

You sould look at mesa hardware... With what you are trying to do - you really should use some external hardware.. Pretty inexpensive also.. Gives you very fast encoder counters, step generators , pwm and i/o (and analog +/-10 depending on the options)

Mesa FAQ - EMC Support Forum

Mesa has a bunch of servo interfaces that are switchable between single ended and differential. (I am using the 7i33 and 7i48 which work great)

ask a lot of questions!

sam
Reply With Quote

  #4   Ban this user!
Old 12-22-2011, 03:54 PM
jsheerin's Avatar  
Join Date: Aug 2008
Location: US
Posts: 1,132
jsheerin is on a distinguished road

Thanks Al. If it's not possible to do differential input in software and nothing else works, I'll pick up the chip you recommend. I wish I'd asked this last week - I just ordered some parts from Mouser... They're really cheap but then will cost $10 to ship.

Thanks for the input, Sam. Yes, I have looked at Mesa hardware. If I can get my current test system working, that's what I will eventually buy (after I design and build the rest of the machine). However as I mentioned I'm currently trying to test the EMC bldc component with my motors (which I already have), and so far it doesn't work. So I currently have zero incentive to buy more hardware that depends on bldc working. That's why I'm trying to use just the parallel port for my test rig since I already have that hardware (really just the computer) and it will work with whatever electronics package I eventually settle on.
__________________
CNC mill build thread: http://www.cnczone.com/forums/vertical_mill_lathe_project_log/110305-gantry_mill.html
Reply With Quote

  #5   Ban this user!
Old 12-22-2011, 04:57 PM
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 1,081
samco is on a distinguished road

what do you mean by - it doesn't work? I saw a video of the servo spinning using the bldc component in open loop.. (showing that the commutation is working...) There are quite a few people using the bldc component now with great success. Andy has done such great work with it.

Are you coming up with a circuit that take PWM out of the printer port and converting it to +/-10v to drive your amc drive?

As far as the printer port reading your encoder... You are really limited to you base period. To be safe - you can only count about 1/2 of your base settings.. So lets say your base period is 50000ns (I think the default base setup on the sample configs) that would be a freqency of 20khz so you should be able to reliably count at 10khz. On good computer hardware you might be able to go 20000ns or better which would give you a reliable counting freq of 25khz.. technically - if your quadrature signal is exactly 50/50 you can aproch counting at the base period.. (so 20000ns would be 50khz) but I would not count on it.

Not that I don't think it is possible - but you have to get a lot of the components working together to do it this way. (I had initially used the printer port to do totally closed loop servo control using pwm amplifiers and counting encoder back to the printer port. It did work but I soon found the limitations of the printer port in pwm speed and encoder counting.) It was a good learning experience.

Now as far as noise.. I would make sure all your cables are shielded and the shield grounded only on one end. (I have everything grounded at a bus bar near the computer.) I have had good luck with single ended encoder for short distances.. but longer distances have given me problems. As al says - you can use differential recievers at the computer end. (it isn't a emc2 issue seeing the differential signals.. it is the printer port isn't designed to see differential signals.) as Al said - you can get differential reciever chips that would convert it to single ended at the printer port.

(hope that made sense)
sam
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-22-2011, 05:27 PM
jsheerin's Avatar  
Join Date: Aug 2008
Location: US
Posts: 1,132
jsheerin is on a distinguished road

I've gotten my motors to rotate in free running mode (cfg=H) and in fanuc input Hall output mode (cfg=fTH) and during the process of getting that working Andy found and fixed an error in his code, but I haven't gotten good results using the incremental encoder (cfg=qH or cfg=qiH). In qH it homes the motor correctly according to Andy, but then I can't get the motor to rotate. In qiH it's not homing correctly but I know the index pulse is not being seen correctly so I'm trying to fix that. The modes I really need to be able to use are fqH and qiH.

I do have a circuit that converts pwm out of the printer port to analog drive for the AMC drive.

Your mention of the counting frequency could actually be a significant part of my problem... I have a 2500ppr encoder, or 10k counts per rev, so that would limit me to 60rpm from the motor, right?

I am all about keeping my options open, but maybe if I really want to test this I do need to commit to EMC as my control system, buy some of the Mesa hardware for the input side and just hold off on the motor drives until I get closer to actually needing them... The reason I'm wanting to hold off buying stuff until I have to is because I realistically might not finish this machine for several more years, and I won't really need the electronics until then. I'm just trying to test the motors I've already bought so I can move on to the next part of my design process.
__________________
CNC mill build thread: http://www.cnczone.com/forums/vertical_mill_lathe_project_log/110305-gantry_mill.html
Reply With Quote

  #7   Ban this user!
Old 12-22-2011, 06:11 PM
 
Join Date: Sep 2008
Location: UK
Posts: 125
andypugh is on a distinguished road

Originally Posted by jsheerin View Post
II am all about keeping my options open, but maybe if I really want to test this I do need to commit to EMC as my control system, buy some of the Mesa hardware for the input side and just hold off on the motor drives until I get closer to actually needing them.
The Mesa 5i25 / 7i77 combination is $89 + $159. Not free, but not wildly expensive either.
AIO Daughter cards
That would give you MHz encoder-counting capability (with differential input) and analogue outputs for the drive. (and a fair bit of GPIO, with more easily added in lumps of 48 for $70 to $110 each)
You might well not end up using that for the final build (there will probably be other coool stuff around by then) but some flexible GPIO is something I can see you needing throughout your development process.
Reply With Quote

  #8   Ban this user!
Old 12-22-2011, 08:38 PM
 
Join Date: Feb 2006
Location: Australia
Posts: 90
ftkalcevic is on a distinguished road

I highly recommend sticking with emc. It is incredibly flexible.

I started with Mach3, and a G100. After years of waiting for drivers and fixes, I eventually switched to a Smooth Stepper. It too had problems (gantry homing), and again I was forced to wait for fixes that never came.

I have just switched my mill to emc (I already had set my lathe up with emc).

It had a bug in the gantry configuration. I fixed it myself in 30 minutes.

Don't get me wrong - Mach3 is great - I just made bad hardware decisions.
Reply With Quote

  #9   Ban this user!
Old 01-14-2012, 11:49 AM
jsheerin's Avatar  
Join Date: Aug 2008
Location: US
Posts: 1,132
jsheerin is on a distinguished road

To update this, I got my index pulse working after I added a debounce of 1 base thread period. Then with some changes Andy made to bldc, I got the qH and qiH modes working. I still can't run my motors very fast due to limitations of the parallel port, but things generally seem to be working now. Thanks for all the help.
__________________
CNC mill build thread: http://www.cnczone.com/forums/vertical_mill_lathe_project_log/110305-gantry_mill.html
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel port: How to check Step signal? satanicoo General Electronics Discussion 6 07-08-2010 04:00 PM
Newbie- 1.6V-3.0V random signal voltage parallel signal from output – Any advice? cjchands Mach Software (ArtSoft software) 0 11-12-2009 04:36 AM
Differential Encoder Signals eloid DIY-CNC Router Table Machines 8 01-29-2008 08:05 PM
differential encoder signal form Karl_T General Electronics Discussion 1 03-19-2007 09:28 AM
Interfacing a 24 volt signal to parallel port macona General Electronics Discussion 14 01-06-2007 02:55 PM




All times are GMT -5. The time now is 02:48 PM.





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