Can we use python scripts to assign value to hal pins directly.

More
25 Apr 2017 07:18 #92035 by cmorley
Yes I would scale your slider so it is between -1 and +1 and multiply it with your feedback number (also between -1 and 1)
This works because IIRC adaptivefeed expects a value between -1 and 1.
You could use classicladder or the mult2 component.
I would use gladevcp for the slider.

Chris M

Please Log in or Create an account to join the conversation.

More
25 Apr 2017 10:52 #92044 by kpj10
Thanks Chris for the response. Now, let me see how can I move on the path you suggested.

Regards,
Kunal.

Please Log in or Create an account to join the conversation.

More
25 Apr 2017 16:55 #92079 by andypugh
I think this is a job for a realtime component written in C, with an output pin for speed override.

You could use two IO pins from the Arduino for realtime control, sending 4 states, or consider sending a frequency output from the Arduino proportional to voltage, measure the frequency with an encoder counter, and use that information in your HAL component.

Please Log in or Create an account to join the conversation.

More
25 Apr 2017 17:41 #92087 by kpj10
Dear Andy,

I'm planning to eliminate computation to estimate the feed rate, and hence eliminate the Arduino. This is because; current sensing, then computing based on PID, and then sending to HAL is quite a complex system, which requires a certain level of sophistication to work as expected. Instead, I plan to use a simple hardware setup as follows:
1. If the current in the system is below the preset level raise the speed. I will use an input pin of the parallel port to detect this state.
2. If the current level is above the preset value reverse the feed. I will use another input pin of the parallel port to detect this state.
3. If either mentioned above state is false then that will be the best feed rate to run the machine.

As in the previous comment, Chris did suggest a method for implementing what I want, but unfortunately, I'm not progressing ahead with that much amount of information.

I would be thankful if you or Chris can put more light on the matter: how to connect and update value of motion.adaptive-feed HAL based on the input from the parallel port. To make it simpler,
if Linuxcnc detects the parallel port input pin high(used to increase feed rate, if the current is below the preset value) it should scale up the feed rate by the factor of 0.01 for motion.adaptive-feed. Also, the value of motion.adaptive-pin should not go above 1.
Or
if Linuxcnc detects the parallel port input pin high(used to reverse feed rate, if the current is higher than the preset value) it should set down the feed rate to -1, hence starts moving reverse.

Apart from the above-mentioned requirement also there should be a slider embedded in Axis, for operator control the feed rate when things get out of control.

Regards,
Kunal .

Please Log in or Create an account to join the conversation.

More
25 Apr 2017 17:57 #92090 by andypugh
Before committing to a current-only feedback system you might want to read the following threads:

sourceforge.net/p/emc/mailman/emc-develo...ail.com/#msg34885000

sourceforge.net/p/emc/mailman/message/35283209/

Please Log in or Create an account to join the conversation.

More
25 Apr 2017 18:59 #92097 by kpj10
Dear Andy,

The links you mentioned me in the previous comment, I have gone through those links previously. Also, I would like to point it out that I'm retrofitting Wire cut-EDM with reciprocating wire, but not a die-sinker EDM.

Let me address your concern about me committing to current-only feedback system:
In my system, only current monitoring can help to maintain the spark. If wire and job are shorted excessive current flows, and if a proper gap is maintained between the two there is the spark, and cutting progresses. We know the maximum current value to keep the spark, and if in the system current is more than that preset value the spark is gone, and there is no cutting afterwards.

In the link, Pete_Gruendeman says: "adaptive feed slows down till the velocity does not overshoot the removal rate", I'm also trying to achieve the same but in reverse. Meaning: Instead of starting at a higher feed rate, we start the machine at slower feed rates and raise the feed rate for optimum MRR.

Now, I'm stuck with how to do that, hope from your and Chris's guidance I'll probably achieve what I want.

Regards,
Kunal.

Please Log in or Create an account to join the conversation.

More
26 Apr 2017 11:50 - 26 Apr 2017 11:53 #92133 by andypugh
You might be able to do this with a mux4 HAL component.

If no pins then override = current value
If pin 1 then override = current value * 0.1
if pin 2 then override = -1
if pin1 AND pin2 then override = +1

The last part is critical, as otherwise there is a risk of continually multiplying -1 by 0.1 and reversing at increasing speed. So you need to make sure that pin1 goes true before pin2 goes false.

this is mux4

To make mux4 act as described above:
loadrt mux4
loadrt scale
addf mux4.0 servo-thread
addf scale.0 servo-thread

setp scale.0.gain 1.1

net feed-scale mux4.0.out => motion.adaptive-feed  mux4.0.in0  scale.0.in
net feed-inc scale.0.out => mux4.0.in1
setp mux4.0.in2 -1
setp mux4.0.in3 +1

net increment-pin parport.0.pin-NN-in => mux4.0.sel0
net reverse-pin parport.0.pin-NN-in => mix4.0.sel1

Please don't just paste this code and expect it to work, it is just intended as an instructional example.

A scale of 1.1 is almost certainly far too much, as this runs 1000 times per second. So the feed rate will double in 8mS.
Last edit: 26 Apr 2017 11:53 by andypugh.
The following user(s) said Thank You: kpj10

Please Log in or Create an account to join the conversation.

More
26 Apr 2017 16:37 #92157 by kpj10
Thank you, Andy, for the response. Will report you the results soon, please give me som time.

Regards,
Kunal.

Please Log in or Create an account to join the conversation.

More
27 Apr 2017 18:02 #92227 by kpj10
Dear Andy,

I have tried the setup suggested by you, but with little modification due to some change in hardware design. Yes, it is working as expected. Thank you.

Now, the functioning is as: two level of currents are set, as follows:

1. A preset value to maintain current below safety limit.

2. A preset value of current on which the wire is in complete contact with the job.

If both are false machine is running.
If current gets above the safety limit motion halts.
The other two cases are same, thus will reverse the motion.

The dry run was successful, now will add up current feedback hardware, and will report to you.

Regards,
Kunal

Please Log in or Create an account to join the conversation.

More
02 May 2017 17:19 #92528 by kpj10
Dear Andy,

Tested, results are as follows:

1. Machine feed is zero if current is above saftety limit.

2. On contact there is excess current causing the reverse feed to be activated.

Thank you,
Kunal.

Please Log in or Create an account to join the conversation.

Time to create page: 0.130 seconds
Powered by Kunena Forum