603,546 active members*
3,468 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1

    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

  2. #2
    Join Date
    Dec 2003
    Posts
    24260
    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 Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  3. #3
    Join Date
    Jul 2003
    Posts
    1766
    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

  4. #4
    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

  5. #5
    Join Date
    Jul 2003
    Posts
    1766
    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

  6. #6
    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

  7. #7
    Join Date
    Sep 2008
    Posts
    229
    Quote 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.

  8. #8
    Join Date
    Feb 2006
    Posts
    101
    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.

  9. #9
    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

Similar Threads

  1. Parallel port: How to check Step signal?
    By satanicoo in forum CNC Machine Related Electronics
    Replies: 6
    Last Post: 07-08-2010, 10:00 PM
  2. 1.6V-3.0V random signal voltage parallel signal from output – Any advice?
    By cjchands in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 11-12-2009, 11:36 AM
  3. Differential Encoder Signals
    By eloid in forum DIY CNC Router Table Machines
    Replies: 8
    Last Post: 01-30-2008, 03:05 AM
  4. differential encoder signal form
    By Karl_T in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 03-19-2007, 03:28 PM
  5. Interfacing a 24 volt signal to parallel port
    By macona in forum CNC Machine Related Electronics
    Replies: 14
    Last Post: 01-06-2007, 09:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •