Re: [Emc-users] Possible simplification of my code

2017-03-14 Thread Kurt Jacobson
>
> sudo halcompile --install mux2s32.comp
> worked a treat.  Is there a man page?


Excellent, I'm glad it worked. Here is the man page for the HAL comp
generator:
http://linuxcnc.org/docs/html/hal/comp.html

I just modified the code for the mux2, simply changed any instance of float
to s32. It is not very picky about types, I have found you can make a HAL
comp to convert float to s32 as simply as this:

pin in float in;
pin out s32 out;
function _;
;;
FUNCTION(_) {
out = in
}

I though there was no way it would work, but it did. I hear C is much less
picky about types than Python though.

*seen on a t-shirt at Walmart: "I'll go to work when my coffee does." :)


I'll have to remember that one!
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Possible simplification of my code

2017-03-14 Thread Jon Elson
On 03/14/2017 07:15 PM, Gene Heskett wrote:
> Greetings everybody;
>
> In doing this rewrite, I find a need for a reverse s32 mux, where I can
> take a single s32 value and steer it to one target or another.
There is a select8 standard component.  If you really need 
32 outputs, you could use select8 as your base,
expand to 32-wide, and then have it pass the input to the 
selected output, instead of sending just a constant 1 to the 
selected output.  The value input and outputs need to be 
float instead of bits.  select8 is all of 19 lines of code, 
it should be fairly easy to see how it works.

here's a link to the source code :
http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=src/hal/components/select8.comp

Jon

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Possible simplification of my code

2017-03-14 Thread Gene Heskett
On Tuesday 14 March 2017 20:57:36 Kurt Jacobson wrote:

> Gene,
> Why don't you write your own component? I have several times found it
> easier to write a component that does just what need rather than
> cobbling something together with the existing HAL comps.
>
> Here is the code for a mux2 that handles s32. To install I would run:
sudo halcompile --install mux2s32.comp

worked a treat.  Is there a man page?

> Don't know if you have the dev packages to do that on your pi though.
>
>
> component mux2s32 "Select from one of two input values";
> pin in bit sel;
> pin out s32 out "Follows the value of in0 if sel is FALSE, or in1 if
> sel is TRUE";
> pin in s32 in1;
> pin in s32 in0;
> function _;
> license "GPL";
> ;;
> FUNCTION(_) {
> if(sel) out = in1;
> else out = in0;
> }

I'll see how far it gets up the flagpole tomorrow once the coffee* kicks 
in, thanks a bunch, Kurt.

*seen on a t-shirt at Walmart: "I'll go to work when my coffee does." :)
>
> Regards,
> Kurt
>
> On Tue, Mar 14, 2017 at 8:15 PM, Gene Heskett  
wrote:
> > Greetings everybody;
> >
> > In doing this rewrite, I find a need for a reverse s32 mux, where I
> > can take a single s32 value and steer it to one target or another.
> >
> > Such a beast would negate the need to put a "conv this to that"
> > around almost everything I try to net together in this hal code.
> >
> > A mux2 that handled s32's would be a godsend. Every one of those
> > would get rid of 2 conversion modules and make 3 lines of code into
> > one.
> >
> > Is there something in /usr/share/man/man9 hiding under a different
> > name that could do that? I would save me at least 8 of the conv
> > modules and make my code a heck of a lot easier to understand for
> > everyone including me.
> >
> > Thanks everybody.
> >
> > Cheers, Gene Heskett
> > --
> > "There are four boxes to be used in defense of liberty:
> >  soap, ballot, jury, and ammo. Please use in that order."
> > -Ed Howdershelt (Author)
> > Genes Web page 
> >
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
> --
> Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Possible simplification of my code

2017-03-14 Thread Kurt Jacobson
Gene,
Why don't you write your own component? I have several times found it
easier to write a component that does just what need rather than cobbling
something together with the existing HAL comps.

Here is the code for a mux2 that handles s32. To install I would run:
halcompile
--install mux2s32.comp
Don't know if you have the dev packages to do that on your pi though.


component mux2s32 "Select from one of two input values";
pin in bit sel;
pin out s32 out "Follows the value of in0 if sel is FALSE, or in1 if sel is
TRUE";
pin in s32 in1;
pin in s32 in0;
function _;
license "GPL";
;;
FUNCTION(_) {
if(sel) out = in1;
else out = in0;
}

Regards,
Kurt


On Tue, Mar 14, 2017 at 8:15 PM, Gene Heskett  wrote:

> Greetings everybody;
>
> In doing this rewrite, I find a need for a reverse s32 mux, where I can
> take a single s32 value and steer it to one target or another.
>
> Such a beast would negate the need to put a "conv this to that" around
> almost everything I try to net together in this hal code.
>
> A mux2 that handled s32's would be a godsend. Every one of those would
> get rid of 2 conversion modules and make 3 lines of code into one.
>
> Is there something in /usr/share/man/man9 hiding under a different name
> that could do that? I would save me at least 8 of the conv modules and
> make my code a heck of a lot easier to understand for everyone including
> me.
>
> Thanks everybody.
>
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> Genes Web page 
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] jogging again

2017-03-14 Thread Gene Heskett
On Tuesday 14 March 2017 18:22:51 andy pugh wrote:

> On 14 March 2017 at 17:50, Gene Heskett  wrote:
> > I can do that, but the real fix has apparently been removed in the
> > 2.8-pre branch. What I needed, and the manpage says its there on
> > this machine, and in the manpage out there, and that was the
> > encoder.L.x4-mode.
>
> I don't think that the Mesa encoders have ever had that parameter.

And, while they do have a scale, my attempts to set it to a value that 
returns an additional 1 per click, have been ignored, without reporting 
any error.  I've tried the powers of 2 up to 16, but one click is 4 at 
the count output regardless. I either don't understand the man page, or 
its broken. Probably the former.

I can run it thru a mult2 by .25 and get something resembling the 
correct count, but returning the dial to zero doesn't always return the 
output to zero, and thats no good if you want to take .0065" off the 
part to get the correct size.  This might be an artifact of the slower 
200hz jog-thread, or even the servo-thread is occasionally missing a 
count. And for some reason, I may have to change that .25 multiplier 
to a -0.250, its moving backwards.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Possible simplification of my code

2017-03-14 Thread Gene Heskett
Greetings everybody;

In doing this rewrite, I find a need for a reverse s32 mux, where I can 
take a single s32 value and steer it to one target or another.

Such a beast would negate the need to put a "conv this to that" around 
almost everything I try to net together in this hal code.

A mux2 that handled s32's would be a godsend. Every one of those would 
get rid of 2 conversion modules and make 3 lines of code into one.

Is there something in /usr/share/man/man9 hiding under a different name 
that could do that? I would save me at least 8 of the conv modules and 
make my code a heck of a lot easier to understand for everyone including 
me.

Thanks everybody.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] How to configure a basic system using Pncconf

2017-03-14 Thread Tiklack
Spam. I was trying to avoid Google always watching and registrering all you do. 
That is the reason why I try to use protonmail. Tanks a lot for info about the 
spam filter.

Pncconf. Thank you for info about the firmware control of the pins. That saved 
me a lot of time. When you are new to 5i25 the Mesa manual is not very clear 
about this. My intention was to replace the par port with the 5i25. I can see 
some hardware chances may be neccessary when some of the pins have fixed 
functions.
 Original Message 
On 13. mar. 2017 21.39, andy pugh wrote:

Sorry, this message got sent to spam because of "Why is this message
in Spam? It has a from address in protonmail.com but has failed
protonmail.com's required tests for authentication."
(This means that your ISP does not understand about mailing lists)
This might be why you got no replies.

On 18 February 2017 at 17:19, Tiklack  wrote:

> If you are looking into the generated HAL file there seems to be no signals 
> for step pulses? When a parallel port and Stepconf is used you get an "xstep" 
> signal connected to the step pulse input of the motor drive.

That is correct. The routing of the step pulses to output pins is
configured by the FPGA firmware, it is not routed through HAL. The
HAL interface is just position or velocity commands and scale and
timing parameters

--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] jogging again

2017-03-14 Thread John Thornton
The encoder.N.x4-mode is still in master but it's for the software 
encoder...

JT


On 3/14/2017 12:50 PM, Gene Heskett wrote:
> On Tuesday 14 March 2017 11:26:41 John Kasunich wrote:
>
>> On Tue, Mar 14, 2017, at 10:56 AM, Gene Heskett wrote:
>>> Greetings all;
>>>
>>> I threw out quite a few lines of code, but while its now working,
>>> its working at 4x the movement I am asking it for.
>>>
>>> I am now sending my distance increment to the axis.x.scale and
>>> joint.0.scale inputs.
>>>
>>> and sending the hm2...encoder.count to axis.x.counts and
>>> joint.0.counts
>>>
>>> It seems that regardless of what I
>>> setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale at,from 1 to 16
>>> tested, one click is a count of 4 at the count output. So I am
>>> getting 4x the movement I want.  So sending a .0002", gets me .0008"
>>> rad change and .0016" dia change.
>>>
>>> Is there a fix for this unwanted 4 per click?  Or am I getting a 4x
>>> multiplier because I am feeding both axis and joint the encoder
>>> count?
>>>
>>> Thanks all;
>>>
>>> Cheers, Gene Heskett
>>> --
>> The jog scale inputs are "distance you want to travel per jogwheel
>> count".
>>
>> Your wheel sends four counts for one detent.
>>
>> If you want one detent to be 0.001" set jog-scale to 1/4 of that,
>> 0.00025".
>>
>> If you want one detent to be 0.010", set jog-scale to 0.0025".
>>
>> And so on...
>>
>> hm2_[HOSTMOT2](BOARD).0.encoder.01.scale has nothing to do with it.
>> That is used INSIDE the encoder driver to scale the floating point
>> output of the encoder. Wheel jogging doesn't use the floating point
>> output of the encoder, it uses the raw counts.
>>
>> The reason for that is so that you can change the jog-scale any time
>> you want.
> I can do that, but the real fix has apparently been removed in the
> 2.8-pre branch. What I needed, and the manpage says its there on this
> machine, and in the manpage out there, and that was the
> encoder.L.x4-mode.
>
> I can put a mul2 in with one input setp to .25, but why was the x4-mode
> removed AND left at the default of counting every edge, which obviously
> gives an output of 4 for one click. Thats simpler and I'll try that
> first, but...
>
> I have another problem too, halshow now cannot see anything from
> hostmot2! To me thats a genuine bug.  ISTR it worked a week ago. Version
> now on the pi is 2.8.0-pre1-2771-gdc2ff49, fresh last night.
>
> I just tried the counter-mode FALSE so it only counts the rising edge of
> phase a. But as I suspected, it very quickly looses track of where it is
> on the dials reversal. Gr.  I may have a better idea. Ignore the
> encoders count output entirely. I am already developing a click(x|z)
> signal that is only true when both phases of the encoders input are
> true, and a direction derived from its velocity output. I'll take the
> steered up and down count pulses from that and feed them to another
> updown, and use its output to drive the jog-counts inputs to motion.
> Thats also one count per click, but its presumably at the peak of the
> area between detents, and need not be clamped since it will be zerored
> when the timer times out, disabling the jogwheel entirely. At that
> point, the direction outputs I am using should be accurate. But I expect
> I'd better start nearly from square one and rewrite 95% of it.
>
> Cheers, Gene Heskett


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] jogging again

2017-03-14 Thread andy pugh
On 14 March 2017 at 17:50, Gene Heskett  wrote:
> I can do that, but the real fix has apparently been removed in the
> 2.8-pre branch. What I needed, and the manpage says its there on this
> machine, and in the manpage out there, and that was the
> encoder.L.x4-mode.

I don't think that the Mesa encoders have ever had that parameter.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Example configuration for THC + stepper

2017-03-14 Thread John Thornton
I've never used gmoccapy... the gmoccapy section on the forum is quite 
active.

JT


On 3/13/2017 10:53 AM, Alexander Brock wrote:
> On 03/13/2017 03:49 PM, John Thornton wrote:
>> It really has nothing to do with the GUI, it's something you add to your
>> hal file. I just use a setp to enable it when I start my GUI ( I used to
>> use a check box but would forget to check it lol).
> How can I create a configuration which provides the nice gmoccapy-plasma
> gui, runs my steppers using the parport and uses thcud for THC?
>
> Best Regards,
> Alexander
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] jogging again

2017-03-14 Thread Gene Heskett
On Tuesday 14 March 2017 11:26:41 John Kasunich wrote:

> On Tue, Mar 14, 2017, at 10:56 AM, Gene Heskett wrote:
> > Greetings all;
> >
> > I threw out quite a few lines of code, but while its now working,
> > its working at 4x the movement I am asking it for.
> >
> > I am now sending my distance increment to the axis.x.scale and
> > joint.0.scale inputs.
> >
> > and sending the hm2...encoder.count to axis.x.counts and
> > joint.0.counts
> >
> > It seems that regardless of what I
> > setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale at,from 1 to 16
> > tested, one click is a count of 4 at the count output. So I am
> > getting 4x the movement I want.  So sending a .0002", gets me .0008"
> > rad change and .0016" dia change.
> >
> > Is there a fix for this unwanted 4 per click?  Or am I getting a 4x
> > multiplier because I am feeding both axis and joint the encoder
> > count?
> >
> > Thanks all;
> >
> > Cheers, Gene Heskett
> > --
>
> The jog scale inputs are "distance you want to travel per jogwheel
> count".
>
> Your wheel sends four counts for one detent.
>
> If you want one detent to be 0.001" set jog-scale to 1/4 of that,
> 0.00025".
>
> If you want one detent to be 0.010", set jog-scale to 0.0025".
>
> And so on...
>
> hm2_[HOSTMOT2](BOARD).0.encoder.01.scale has nothing to do with it.
> That is used INSIDE the encoder driver to scale the floating point
> output of the encoder. Wheel jogging doesn't use the floating point
> output of the encoder, it uses the raw counts.
>
> The reason for that is so that you can change the jog-scale any time
> you want.

I can do that, but the real fix has apparently been removed in the 
2.8-pre branch. What I needed, and the manpage says its there on this 
machine, and in the manpage out there, and that was the 
encoder.L.x4-mode.

I can put a mul2 in with one input setp to .25, but why was the x4-mode 
removed AND left at the default of counting every edge, which obviously 
gives an output of 4 for one click. Thats simpler and I'll try that 
first, but...

I have another problem too, halshow now cannot see anything from 
hostmot2! To me thats a genuine bug.  ISTR it worked a week ago. Version 
now on the pi is 2.8.0-pre1-2771-gdc2ff49, fresh last night.

I just tried the counter-mode FALSE so it only counts the rising edge of 
phase a. But as I suspected, it very quickly looses track of where it is 
on the dials reversal. Gr.  I may have a better idea. Ignore the 
encoders count output entirely. I am already developing a click(x|z) 
signal that is only true when both phases of the encoders input are 
true, and a direction derived from its velocity output. I'll take the 
steered up and down count pulses from that and feed them to another 
updown, and use its output to drive the jog-counts inputs to motion. 
Thats also one count per click, but its presumably at the peak of the 
area between detents, and need not be clamped since it will be zerored 
when the timer times out, disabling the jogwheel entirely. At that 
point, the direction outputs I am using should be accurate. But I expect 
I'd better start nearly from square one and rewrite 95% of it.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] jogging again

2017-03-14 Thread John Kasunich


On Tue, Mar 14, 2017, at 10:56 AM, Gene Heskett wrote:
> Greetings all;
> 
> I threw out quite a few lines of code, but while its now working, its 
> working at 4x the movement I am asking it for.
> 
> I am now sending my distance increment to the axis.x.scale and 
> joint.0.scale inputs.
> 
> and sending the hm2...encoder.count to axis.x.counts and joint.0.counts
> 
> It seems that regardless of what I 
> setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale at,from 1 to 16 tested, one 
> click is a count of 4 at the count output. So I am getting 4x the 
> movement I want.  So sending a .0002", gets me .0008" rad change 
> and .0016" dia change.
> 
> Is there a fix for this unwanted 4 per click?  Or am I getting a 4x 
> multiplier because I am feeding both axis and joint the encoder count?
> 
> Thanks all;
> 
> Cheers, Gene Heskett
> -- 

The jog scale inputs are "distance you want to travel per jogwheel count".

Your wheel sends four counts for one detent.

If you want one detent to be 0.001" set jog-scale to 1/4 of that, 0.00025".

If you want one detent to be 0.010", set jog-scale to 0.0025".

And so on...

hm2_[HOSTMOT2](BOARD).0.encoder.01.scale has nothing to do with it.
That is used INSIDE the encoder driver to scale the floating point output of 
the encoder.
Wheel jogging doesn't use the floating point output of the encoder, it uses the 
raw counts.

The reason for that is so that you can change the jog-scale any time you want.

-- 
  John Kasunich
  jmkasun...@fastmail.fm

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] jogging again

2017-03-14 Thread Gene Heskett
Greetings all;

I threw out quite a few lines of code, but while its now working, its 
working at 4x the movement I am asking it for.

I am now sending my distance increment to the axis.x.scale and 
joint.0.scale inputs.

and sending the hm2...encoder.count to axis.x.counts and joint.0.counts

It seems that regardless of what I 
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.scale at,from 1 to 16 tested, one 
click is a count of 4 at the count output. So I am getting 4x the 
movement I want.  So sending a .0002", gets me .0008" rad change 
and .0016" dia change.

Is there a fix for this unwanted 4 per click?  Or am I getting a 4x 
multiplier because I am feeding both axis and joint the encoder count?

Thanks all;

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users