How to use parport2 for input mod?
- mansourirad
- Offline
- New Member
-
- Posts: 9
- Thank you received: 0
I have a PCI-to-LPT card ( with Address 0x9400 )
I can set this card for output but I want set it for "input" .
I have some Encoders and Sensors.
Example : I want appoint Pin10 of LPT2 to X-home sensor
1- how to config pins of LPT2 to EMC2.4 ?
2- how to config EMC2 to use Encoders wire from LPT2 ?
3- how to use Encoders feedback in EMC2.4 ?
regards.
Please Log in or Create an account to join the conversation.
Lot of questions in one short query, suggest you get 2nd parport working as input first
Find the line in your .hal file near the top
loadrt hal_parport cfg="0xN78 out" (will be 0x278 or 0x378)
and change to
loadrt hal_parport cfg="0xN78 out 0x9400 in"
then add
addf parport.1.read base-thread
addf parport.1.write base-thread
Now open emc (axis) and check in Machine > Hal Configuration that parport.1 pins (2-9) are input and that you can get a signal from them.
You can use each pin in parport.1 the same way as parport.0 except that 2-9 are now inputs
Ref the encoder, you will need to specify make, voltage, channels etc and what you are using for to enable someone to assist.
regards
Please Log in or Create an account to join the conversation.
- mansourirad
- Offline
- New Member
-
- Posts: 9
- Thank you received: 0
I do write your setting in mymill.hal
I am understand your text about parport setting but I want to know : how to connect 6 wires Encoder to pins.
and I dont Know how to use G-Code for connect pals of Encoder as feedbak as pals of Motor.
best regards,
Please Log in or Create an account to join the conversation.
I do write your setting in mymill.hal I am understand your text about parport setting
Does you second parport work, can you see the pins as input and receive a signal through them?
how to connect 6 wires Encoder to pins.
and I dont Know how to use G-Code for connect pals of Encoder as feedbak as pals of Motor.
You need to specify what the 6 leads are, preferably the make and model of the encoder, incremental or absolute and
which motor you are attaching it to and for what purpose
eg Spindle for threading or stepper for position.
The leads are most likely labelled +Ve, GND, A, B, Z A-, B- etc but there are many different types.
regards
Please Log in or Create an account to join the conversation.
- mansourirad
- Offline
- New Member
-
- Posts: 9
- Thank you received: 0
1- How to check input signal over parport2?
2- Yes wire of my Encoders is " A, A-, B, B-, Z, Z-, V+, V0(GND). How to connect those to parport2 as feedback as Motor 1 and Motor 2?
Please Log in or Create an account to join the conversation.
Please explain with more detail what you are trying to do.
You say you want encoder feedback for motors - What kind of motors ? steppers or servos?
This outlines how to add the HAL commands to use a second parport:
www.linuxcnc.org/docs/2.4/html/examples_pci_parallel_port.html
I assume you are not using stepconf as it allows you to add the commands for up to three parports already.
to check if the second parport is working use halmeter ( which can be started from AXIS ) - If you see the pins then it at least loaded.
You don't use Gcode to connect encoder to motors you use HAL commands. ( and wires
![:) :)](/media/kunena/emoticons/smile.png)
A is phase A
A- is used for differential wiring , its the compliment of the A phase . You are probably not going to connect it.
B is phase B
B- compliment - your not going to connect it
Z is phase Z which is the index pulse
Z- compliment - your not going to connect it.
V+ is the power lead probably 5 volts but could be something else (12 volt is also common)
V0 ground connection.
Please Log in or Create an account to join the conversation.
- mansourirad
- Offline
- New Member
-
- Posts: 9
- Thank you received: 0
My motors is Stepper.
I can set the file mymill.hall for 2 parports . (according to the above notes)
now I want set pins of parport2 to feedback for Motor1 and Motor2.
example : I want set pin2 from parport2 for A phase Encoder1 (as feedback as motor1).
regards.
Please Log in or Create an account to join the conversation.
I'm afraid you are not getting quick replies because no-one is quite sure what you are doing or what you want.
Drip feeding one hal connection line after another is probably not a good way to get a coherent working system.
Apart from a single reference to mymill, you could be building a 2 axis CCTV camera tracking system for all we know.
There is quite a strong train of thought that encoders on a stepper system should not be necessary, as steppers either work or stall and the later is mostly down to inappropriate power / gearing / acceleration settings etc for the size of the machine.
Have you used stepconf or pncconf to get your initial configs?
They will deal with all your parport connections etc for you.
If you can be specific about what machine you have, what steppers, encoders, drivers etc. then someone like Chris, who wrote the stepconf and pncconf programs should be able to advise on the best way to configure your machine.
regards
Please Log in or Create an account to join the conversation.
- mansourirad
- Offline
- New Member
-
- Posts: 9
- Thank you received: 0
Excuse me if was not clear my question.
I Manufacture the CNC for Metal Engraving , 2 axis X o Y and one pneumatic piston for engraving.
I have 2 stepper motors without encoders. I can control it whit EMC2 program. (over parport0). I configure mymill.hal whit stepconf form in EMC2 wizard configuration.
============
Now I want manufacture a lathe and control it whit EMC2 program.
I will have 2 axis , X o Y , liquid coolant , 2 Stepper Motors, 2 Encoders (A,A-,B,B-,Z,Z-)"Autonics E50S8 rotary encoder" for feedback of motors, and some end or first and home sensors , Over parport 0,1,2.
============
My question:
How to use encoders as a feedback ?
How to set conditions ,
Example : If (sensor N) Then {Motor 1 on/off}
Example : If (! Encoder 1) Then { redo pals for Motor 1}
Thanks,
Best Regards.
Please Log in or Create an account to join the conversation.
Do you want the encoder feedback just to cause an following error if it detects missed steps
Or do you really want full closed loop control where EMC uses the encoder to drive the motor speed?
reading encoders in software could really limit your max speed as it's fairly easy to move them faster then the computer can read them
and also finding a low latency computer becomes more important again so as not to limit top speed too much.
What is the resolution of the encoders? I mean how many pulses per rotation?
Please Log in or Create an account to join the conversation.