pyvcp et bouton déplacement

  • lapenduledargent
  • lapenduledargent's Avatar Topic Author
  • Visitor
  • Visitor
18 Feb 2013 05:37 #30231 by lapenduledargent
pyvcp et bouton déplacement was created by lapenduledargent
Bonjour,

J'ai un panneau pyvcp comme indiqué ici :
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding_Custom_MDI_Buttons

Mais je souhaite que le bouton puisse faire avancer l'axe d'une certaine quantité.
par exemple 1mm, 0.5mm, 0.1mm et 0.1mm

J'ai trouvé ce post : www.linuxcnc.org/index.php/french/forum/...alui-incremental-jog

Mais comment faire pour lier l'ensemble à mon panneau pvycp ?

Pierre

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

More
18 Feb 2013 17:52 #30271 by ArcEye
Replied by ArcEye on topic pyvcp et bouton déplacement
Hi

Mais je souhaite que le bouton puisse faire avancer l'axe d'une certaine quantité.
par exemple 1mm, 0.5mm, 0.1mm et 0.1mm


First of all, you can move your axes incrementally from Axis, click on the drop down combo box under the axis radio buttons and change 'Continuous' to the required distance.

If you don't like the increments you can change them in the .ini file
[DISPLAY]
INCREMENTS = 5mm 1mm 0.1mm 0.01mm for instance

If you want to duplicate this, or implement it another way, you will need to do some reading.

The wiki you quoted - wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding_Custom_MDI_Buttons
shows you how to implement buttons and link them to halui pins in a postgui.hal file (albeit the MDI command ones)

linuxcnc.org/docs/2.5/html/gui/halui.html
shows you all the halui pins and parameters

J'ai trouvé ce post : www.linuxcnc.org/index.php/french/forum/...alui-incremental-jog

and the lesson from this post is that you have to set a jog speed or the axes will not move.
( which is far from clear, reading the pin descriptions you might think it only required if using continuous jog plus and minus )

So create a panel with buttons which relate to functions provided by the halui.jog- pins that you wish to use, and link them to those pins in the postgui.hal file as demonstrated in the wiki

regards

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

  • lapenduledargent
  • lapenduledargent's Avatar Topic Author
  • Visitor
  • Visitor
19 Feb 2013 14:52 - 19 Feb 2013 14:53 #30310 by lapenduledargent
Replied by lapenduledargent on topic pyvcp et bouton déplacement
Bonsoir ArcEye,

Merci de t'intéresser à mon problème :)

Alors, dans custompanel.xml, je fais un bouton :
  <!-- le bouton choix vitesse -->
        
        <radiobutton>
            <choices>["Lent","Rapide"]</choices> 
            <halpin>"jog-speed"</halpin> 
        </radiobutton> 


 <!-- le bouton quantite deplacement -->

 	<radiobutton>
            <choices>["5.0","1.0","0.5","0.1","0.01"]</choices> 
            <halpin>"jog-deplacement"</halpin> 
        </radiobutton> 

 <!-- le bouton de jog de l'axe X -->
        <hbox>
            <relief>RAISED</relief>
            
            <button>
                <font>("Helvetica",12)</font>
                <width>4</width>

                <halpin>"x-moins"</halpin>
                <text>"X-"</text>
            </button>
            <button>
                <font>("Helvetica",12)</font>
                <width>4</width>
                <halpin>"x-plus"</halpin>
                <text>"X+"</text>
            </button>

        </hbox>

Mais mon problème est de lier mon bouton à halui

Dans la doc, il est écrit :
halui.jog.<n>.minus (bit, in) - jog en direction négative

Ce qui donne :
net my-jogxmoins halui.jog.0.minus <= pyvcp.x-moins

Mais je ne trouve rien sur la quantité de déplacement, par exemple pour faire avancer de 1mm l'axe X dans la direction négative.

Est-ce possible ?
Last edit: 19 Feb 2013 14:53 by lapenduledargent.

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

More
19 Feb 2013 18:00 #30313 by ArcEye
Replied by ArcEye on topic pyvcp et bouton déplacement
Hi

Ce qui donne :
net my-jogxmoins halui.jog.0.minus <= pyvcp.x-moins
Mais je ne trouve rien sur la quantité de déplacement, par exemple pour faire avancer de 1mm l'axe X dans la direction négative.
Est-ce possible ?


If you study the documentation (linuxcnc.org/docs/2.5/html/gui/halui.html)
you will see that there are 2 different jog methods catered for

halui.jog.<n>.minus and halui.jog.<n>.plus are for continuous jogs at the speed entered in halui.jog-speed

If you want an incremental jog, you need to set halui.jog.<n>.increment to the increment figure you want
then use halui.jog.<n>.increment-minus or halui.jog.<n>.increment-plus to move the axis

Don't forget the thread you found www.linuxcnc.org/index.php/french/forum/...alui-incremental-jog
You will need to set a default figure for halui.jog-speed, even though you are not using continuous mode.
That will set the speed at which the axis moves, albeit only for a very short distance.
Unless set, it will not move.

Using your example (which I have not tested)
something similar to
setp halui.jog-speed 300
setp halui.jog.0.increment 1.00
net my-jogxmoins halui.jog.0.increment-minus <= pyvcp.x-moins
net my-jogxplus halui.jog.0.increment-plus <= pyvcp.x-plus

You can make it even simpler and use the halui.jog.selected.increment-?? pins and your jog actions will work with whichever axis is currently selected

regards

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

  • lapenduledargent
  • lapenduledargent's Avatar Topic Author
  • Visitor
  • Visitor
20 Feb 2013 15:25 - 20 Feb 2013 15:26 #30350 by lapenduledargent
Replied by lapenduledargent on topic pyvcp et bouton déplacement
Bonjour,

Ah super ça fonctionne :)

Il me reste à faire fonctionner mon radiobutton.

Dans custom-postgui j'ai fait :
loadrt mux4 count=1
addf mux4.0 servo-thread

setp mux4.0.in0 5
setp mux4.0.in1 1
setp mux4.0.in2 0.1
setp mux4.0.in3 0.01

net deplacement mux4.0.sel <= pyvcp.jog-speed.Rapide

Mais ça me retourne une erreur :

Print file information:
custom_postgui.hal:20: Pin 'mux4.0.sel' does not exist

Peux-tu m'aider svp à configurer mon radiobutton et hal ??
J'ai cherché dans la doc, mais il y a peu d'exemples.
Last edit: 20 Feb 2013 15:26 by lapenduledargent.

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

More
20 Feb 2013 17:13 #30353 by ArcEye
Replied by ArcEye on topic pyvcp et bouton déplacement
Bonne Matin

Ah super ça fonctionne :)


Glad it worked for you.

The mux4 question is simple, there is no pin called mux4.<n>.sel, it is either sel0 or sel1 and the combination of the two gives you 4 possible input values to output.

sel1=FALSE, sel0=FALSE out follows in0
sel1=FALSE, sel0=TRUE out follows in1
sel1=TRUE, sel0=FALSE out follows in2
sel1=TRUE, sel0=TRUE out follows in3


I suggest you read these documents which give examples of using mux4 to control jog increments in different ways, and decide upon a method that suits your buttons etc
linuxcnc.org/docs/html/examples/mpg.html
wiki.linuxcnc.org/cgi-bin/wiki.pl?Adding...imple_Remote_Pendant

regards

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

  • lapenduledargent
  • lapenduledargent's Avatar Topic Author
  • Visitor
  • Visitor
22 Feb 2013 04:18 - 22 Feb 2013 04:27 #30425 by lapenduledargent
Replied by lapenduledargent on topic pyvcp et bouton déplacement
Bonsoir,

Glad it worked for you.


Ok, je vais regarder du côté de glad. En attendant, avec pyvcp je vais utiliser des simples boutons :)

Merci pour ton aide.

Pierre
Last edit: 22 Feb 2013 04:27 by lapenduledargent.

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

Time to create page: 0.083 seconds
Powered by Kunena Forum