Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds , Compilation changes required !!!

2016-04-28 Thread Gene Heskett
On Thursday 28 April 2016 08:39:00 adit bhargava wrote:

> THanks Gene and Andy for your inputs.
> After setting the GPIO pin in output mode, I am getting the output on
> CRO.  setp hm2_5i25.0.gpio.023.is_output TRUE
> setp hm2_5i25.0.gpio.023.invert_output FALSE
> net pwm-generate    <=  pwmgen.0.pwm
> net pwm-generate    => hm2_5i25.0.gpio.023.out
>
> But, still the problem persists that the period is not as per software
> PWMGEN (T-oN= 2ms , T-Off = 6.7 ms) , Although in Halscope I am
> getting the correct pulse output. I am using the software PWM for
> generating pulses like this:
> loadrt pwmgen output_type=0
> setp pwmgen.0.value 0.299
> setp pwmgen.0.pwm-freq 150

If the following line is how it exists in your hal file, its quite 
possible the 'addf' is never executed.  The addf's in the halfile 
control whether or not the module is added to the threads execution per 
instance of the thread, and the order of that execution.

> setp pwmgen.0.enable TRUEaddf pwmgen.make-pulses base-thread
> addf pwmgen.update  base-thread
>
> Then I think, maybe the write_gpio function in base-thread is not
> getting called correctly.I just registered that function in base
> thread like this: addf hm2_5i25.0.write_gpio base-thread
> Should I change something else ?
> Best Regards,Adit

Fix the bad edit above by moving that addf statement so that it executes 
in the order of that list, below the hm2_5i25.00.read and above the the 
hm2_5i25.00.write.  In feedback controlled hal stuffs, you should for 
instance read first the controling value from an encoder or?, then if it 
needs modification before being used, the modifying hal modules should 
be addf'd in the same sequence as that data flows thru them, that makes 
the full chain of the revelant modules all be executed with the same src 
data, and the result on the whole process is then at the end of that 
threads invocation, written back to the output being controlled, all in 
a single instance of that threads existence.  If out of order, there 
will be a one instance of that threads delay in the processing of the 
data, and that delay can and often will play tricks with the feedback 
because the correction of the error is delayed by one thread time for 
each instance the data flow is out of sequence.

There is one place in my hal file where I actually use that delay to move 
data thru a 4 stage FIFO when the input data changes.

Its made up of mux2 modules actually being used for floating point 
sample-hold's.  The addf first executes a compare module to see if there 
is any diff between the encoders instant output and what is in the 
first "hold", if there is, march the data in the last stage of fifo one 
bucket to the right, then the next thread moves the 3rd 's data into the 
4ths, wash, rinse and repeat for 4 thread times to do the whole fifo 
update.  The outputs are feed to a triplet of sum2's, whose gains are 
setp'd such that from the 4 bits of data in the s-h buckets are feed 
back out with a gain of 1, thereby gobbling up much of the timing noise 
generated by a spacing error or slot width in a homemade optical encoder 
disk and the slot interruptors that together form a spindle position 
encoder on either my lathe or my larger mill.  So LCNC knows where in 
the spindles rotation that it is, 268 times per turn. But since time is 
of the essence, and I have no base-thread, the servo-thread runs at 4x 
the normal rate of 1 millisecond, or 250 microseconds so I effectively 
have for spindle speed control, a 1 millisecond to fully update the 
encoder velocity update, but much ( 75% theoretically) of the mechanical 
errors such as a photo-interruptor out of place so the quadrature 
timeing is off a couple degrees from a perfect 90, or the slot width is 
such that the duty cycle is 52%on/48% off.  That computer has the 'iron' 
to do that on the mill, but thats pushing the slower D525MW board 
running the lathe.

>   From: Gene Heskett 
>  To: emc-users@lists.sourceforge.net
>  Sent: Wednesday, April 27, 2016 6:54 PM
>  Subject: Re: [Emc-users] Need to add a faster thread base-thread with
> 100 microseconds, Compilation changes required !!!
>
> On Wednesday 27 April 2016 12:12:22 adit bhargava wrote:
> > Hello Andy,
> >
> > I checked the pins 4 and 17 on the 5i25 header, but there is no
> > output.We do have a full set of wires connected to parallel port
> > cable.I don't know how to proceed now.
> >
> > BRÁdit
>
> In case you missed the read of the docs, those GPIO's so created are
> inputs. So to use as outputs, you need to add some hal file lines that
> turn them into outputs.
>
> An example from my mills .hal file might be helpfull:
> 
> #*
> # First - setup 5i25's p3-p17 for servo enable use
> #*
> setp hm2_5i25.0.gpio.007.is_output    true
> setp hm2_5i25.0.gpio.007.invert_output false
> net 

Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-28 Thread adit bhargava
Hello Andy, 

Now, the output comes on 7i78 daughter card via GPIO pin(disabled highest-num 
Stepgen) with the same period.Its fine with the period now .
Thanks for all the much needed help.

BRAdit


  From: andy pugh 
 To: adit bhargava  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Thursday, April 28, 2016 3:08 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 28 April 2016 at 13:39, adit bhargava  wrote:
> addf hm2_5i25.0.write_gpio base-thread
>
> Should I change something else ?

I believe that that ought to be enough.

If you connect to the HAL session from the command-line (halcmd -kf )
can you see the write_gpio function time changing in when you
repeatedly type "show funct" (possibly "show thread", I haven't tried
this for a while)

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-28 Thread andy pugh
On 28 April 2016 at 13:39, adit bhargava  wrote:
> addf hm2_5i25.0.write_gpio base-thread
>
> Should I change something else ?

I believe that that ought to be enough.

If you connect to the HAL session from the command-line (halcmd -kf )
can you see the write_gpio function time changing in when you
repeatedly type "show funct" (possibly "show thread", I haven't tried
this for a while)

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-28 Thread adit bhargava
THanks Gene and Andy for your inputs.
After setting the GPIO pin in output mode, I am getting the output on CRO. 
setp hm2_5i25.0.gpio.023.is_output TRUE
setp hm2_5i25.0.gpio.023.invert_output FALSE
net pwm-generate    <=  pwmgen.0.pwm
net pwm-generate    => hm2_5i25.0.gpio.023.out

But, still the problem persists that the period is not as per software PWMGEN 
(T-oN= 2ms , T-Off = 6.7 ms) , Although in Halscope I am getting the correct 
pulse output.
I am using the software PWM for generating pulses like this:
loadrt pwmgen output_type=0
setp pwmgen.0.value 0.299
setp pwmgen.0.pwm-freq 150
setp pwmgen.0.enable TRUEaddf pwmgen.make-pulses base-thread
addf pwmgen.update  base-thread

Then I think, maybe the write_gpio function in base-thread is not getting 
called correctly.I just registered that function in base thread like this:
addf hm2_5i25.0.write_gpio base-thread
Should I change something else ?
Best Regards,Adit


  From: Gene Heskett 
 To: emc-users@lists.sourceforge.net 
 Sent: Wednesday, April 27, 2016 6:54 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On Wednesday 27 April 2016 12:12:22 adit bhargava wrote:

> Hello Andy,
>
> I checked the pins 4 and 17 on the 5i25 header, but there is no
> output.We do have a full set of wires connected to parallel port
> cable.I don't know how to proceed now.
>
> BRÁdit

In case you missed the read of the docs, those GPIO's so created are 
inputs. So to use as outputs, you need to add some hal file lines that 
turn them into outputs.

An example from my mills .hal file might be helpfull:

#*
# First - setup 5i25's p3-p17 for servo enable use
#*
setp hm2_5i25.0.gpio.007.is_output    true
setp hm2_5i25.0.gpio.007.invert_output false
net spindle-enable  <=  motion.spindle-on => boot.spindle.enable
net spindle-enable => hm2_5i25.0.gpio.007.out # pwmgen-enable on P3-17

This signal serves as the enabling input to one of the Pico Systems
PWM-Servo amplifiers that I am using as the spindle motor driver, a 1HP 
rated PM DC motor, from a 125 volt DC source good for about 2KW in ICAS.  
1500 watts CCS.  This enable signal is used because the PWMGEN facility 
in the 5i25 does not supply that enabling signal to the outputs, it only 
supply's the PWM and DIR.

The boot.spindle.enable is a module that goes with the PWM-Servo and it 
issues both fwd and reverse pulses to the PWM-Servo to properly 
pre-charge the output hexfets gate driving working voltages. They are so 
short the motor never moves but they do the job. You do not see its 
additional hal "wiring" in the above snippet as it contributes nothing 
to this lesson.

The same I assume must be done in order to use P3-pin 4, you'll need to 
get the GPIO numbers from the dmesg after running LCNC as their is 
little to zero relationship between the p2|3 pin number and the 3 digit 
GPIO numbers you see above.  The above is mine, get yours for the 
corresponding pin, like p3-17 FROM your dmesg output.  They will be 
consistent from run to run as long as the hal files loadrt line remains 
the same, and you don't mesaflash a different configuration into the 
5i25.

I hope this helps?

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 

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread Gene Heskett
On Wednesday 27 April 2016 12:12:22 adit bhargava wrote:

> Hello Andy,
>
> I checked the pins 4 and 17 on the 5i25 header, but there is no
> output.We do have a full set of wires connected to parallel port
> cable.I don't know how to proceed now.
>
> BRÁdit

In case you missed the read of the docs, those GPIO's so created are 
inputs. So to use as outputs, you need to add some hal file lines that 
turn them into outputs.

An example from my mills .hal file might be helpfull:

#*
# First - setup 5i25's p3-p17 for servo enable use
#*
setp hm2_5i25.0.gpio.007.is_output true
setp hm2_5i25.0.gpio.007.invert_output false
net spindle-enable  <=  motion.spindle-on => boot.spindle.enable
net spindle-enable => hm2_5i25.0.gpio.007.out # pwmgen-enable on P3-17

This signal serves as the enabling input to one of the Pico Systems
PWM-Servo amplifiers that I am using as the spindle motor driver, a 1HP 
rated PM DC motor, from a 125 volt DC source good for about 2KW in ICAS.  
1500 watts CCS.  This enable signal is used because the PWMGEN facility 
in the 5i25 does not supply that enabling signal to the outputs, it only 
supply's the PWM and DIR.

The boot.spindle.enable is a module that goes with the PWM-Servo and it 
issues both fwd and reverse pulses to the PWM-Servo to properly 
pre-charge the output hexfets gate driving working voltages. They are so 
short the motor never moves but they do the job. You do not see its 
additional hal "wiring" in the above snippet as it contributes nothing 
to this lesson.

The same I assume must be done in order to use P3-pin 4, you'll need to 
get the GPIO numbers from the dmesg after running LCNC as their is 
little to zero relationship between the p2|3 pin number and the 3 digit 
GPIO numbers you see above.  The above is mine, get yours for the 
corresponding pin, like p3-17 FROM your dmesg output.  They will be 
consistent from run to run as long as the hal files loadrt line remains 
the same, and you don't mesaflash a different configuration into the 
5i25.

I hope this helps?

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 

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread andy pugh
On 27 April 2016 at 17:12, adit bhargava  wrote:

> I checked the pins 4 and 17 on the 5i25 header, but there is no output.
> We do have a full set of wires connected to parallel port cable.
> I don't know how to proceed now.

Have you set the GPIO pins to output mode?
http://linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#General Purpose I/O



-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread adit bhargava
Hello Andy,

I checked the pins 4 and 17 on the 5i25 header, but there is no output.We do 
have a full set of wires connected to parallel port cable.I don't know how to 
proceed now.

BRÁdit


  From: andy pugh 
 To: adit bhargava  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Wednesday, April 27, 2016 4:46 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 27 April 2016 at 15:33, adit bhargava  wrote:

> But, I am not able to get the pulses on the Oscilloscope connected to 7i78
> between Pin 21 and GND.(Find attached 7i78 pin diagram).

maybe try pins 4 and 17 on the 5i25 header, as shown in the dmesg.

[ 2136.149174] hm2/hm2_5i25.0:    IO Pin 023 (P2-04): IOPort
[ 2136.149176] hm2/hm2_5i25.0:    IO Pin 024 (P2-17): IOPort

Your annotation to the drawing makes me wonder if you have a problem
with the 7i78 (or maybe with the parallel-port cable, many do not
contain the full set of wires)

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread andy pugh
On 27 April 2016 at 15:33, adit bhargava  wrote:

> But, I am not able to get the pulses on the Oscilloscope connected to 7i78
> between Pin 21 and GND.(Find attached 7i78 pin diagram).

maybe try pins 4 and 17 on the 5i25 header, as shown in the dmesg.

[ 2136.149174] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
[ 2136.149176] hm2/hm2_5i25.0: IO Pin 024 (P2-17): IOPort

Your annotation to the drawing makes me wonder if you have a problem
with the 7i78 (or maybe with the parallel-port cable, many do not
contain the full set of wires)

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread adit bhargava
Hello Andy,
Thanks for suggestion.Now I am getting the software PWM output pulses  on GPIO 
I/O pin 23 :hm2_5i25.0.gpio.023.out
show pin
 5  bit   OUT FALSE  hm2_5i25.0.gpio.023.in
 5  bit   OUT  TRUE  hm2_5i25.0.gpio.023.in_not
 5  bit   IN  FALSE  hm2_5i25.0.gpio.023.out
 5  bit   OUT FALSE  hm2_5i25.0.gpio.024.in
 5  bit   OUT  TRUE  hm2_5i25.0.gpio.024.in_not
 5  bit   IN  FALSE  hm2_5i25.0.gpio.024.out

But, I am not able to get the pulses on the Oscilloscope connected to 7i78 
between Pin 21 and GND.(Find attached 7i78 pin diagram).
Where to check the output on the 7i78 if its hardwired to disabled highest 
stepgen(GPIO pin 23)? 

BRAdit

  


         

  From: andy pugh 
 To: adit bhargava  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Wednesday, April 27, 2016 2:17 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 27 April 2016 at 13:08, adit bhargava  wrote:
> I tried to redirect the PWM output to one of this pin as follows but it says
> this pin dosen't exist
>
> net pwm-generate    => hm2_5i25.0.gpio.023

You can get a pin listing by starting the driver from the command-line

halrun
loadrt hostmot2
loadrt hm2_pci config="num_stepgens=8"
show pin
exit

See what that lists as GPIO pins on the 5i25.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread andy pugh
On 27 April 2016 at 13:08, adit bhargava  wrote:
> I tried to redirect the PWM output to one of this pin as follows but it says
> this pin dosen't exist
>
> net pwm-generate=> hm2_5i25.0.gpio.023

You can get a pin listing by starting the driver from the command-line

halrun
loadrt hostmot2
loadrt hm2_pci config="num_stepgens=8"
show pin
exit

See what that lists as GPIO pins on the 5i25.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-27 Thread adit bhargava
Hello Andy,
I tried to disable the highest numbered Stepgen(9th in our case) and got the 
following DMESG o/P : 

[ 2136.149105] hm2/hm2_5i25.0: 34 I/O Pins used:
[ 2136.149109] hm2/hm2_5i25.0: IO Pin 000 (P3-01): StepGen #0, pin 
Direction (Output)
[ 2136.149112] hm2/hm2_5i25.0: IO Pin 001 (P3-14): StepGen #0, pin Step 
(Output)
[ 2136.149115] hm2/hm2_5i25.0: IO Pin 002 (P3-02): StepGen #1, pin 
Direction (Output)
[ 2136.149118] hm2/hm2_5i25.0: IO Pin 003 (P3-15): StepGen #1, pin Step 
(Output)
[ 2136.149121] hm2/hm2_5i25.0: IO Pin 004 (P3-03): StepGen #2, pin 
Direction (Output)
[ 2136.149123] hm2/hm2_5i25.0: IO Pin 005 (P3-16): StepGen #2, pin Step 
(Output)
[ 2136.149126] hm2/hm2_5i25.0: IO Pin 006 (P3-04): StepGen #3, pin 
Direction (Output)
[ 2136.149129] hm2/hm2_5i25.0: IO Pin 007 (P3-17): StepGen #3, pin Step 
(Output)
[ 2136.149131] hm2/hm2_5i25.0: IO Pin 008 (P3-05): StepGen #4, pin 
Direction (Output)
[ 2136.149134] hm2/hm2_5i25.0: IO Pin 009 (P3-06): StepGen #4, pin Step 
(Output)
[ 2136.149137] hm2/hm2_5i25.0: IO Pin 010 (P3-07): Smart Serial Interface 
#0, pin TxData0 (Output)
[ 2136.149140] hm2/hm2_5i25.0: IO Pin 011 (P3-08): Smart Serial Interface 
#0, pin RxData0 (Input)
[ 2136.149143] hm2/hm2_5i25.0: IO Pin 012 (P3-09): IOPort
[ 2136.149145] hm2/hm2_5i25.0: IO Pin 013 (P3-10): IOPort
[ 2136.149148] hm2/hm2_5i25.0: IO Pin 014 (P3-11): Encoder #0, pin Index 
(Input)
[ 2136.149150] hm2/hm2_5i25.0: IO Pin 015 (P3-12): Encoder #0, pin B (Input)
[ 2136.149153] hm2/hm2_5i25.0: IO Pin 016 (P3-13): Encoder #0, pin A (Input)
[ 2136.149156] hm2/hm2_5i25.0: IO Pin 017 (P2-01): StepGen #5, pin 
Direction (Output)
[ 2136.149158] hm2/hm2_5i25.0: IO Pin 018 (P2-14): StepGen #5, pin Step 
(Output)
[ 2136.149161] hm2/hm2_5i25.0: IO Pin 019 (P2-02): StepGen #6, pin 
Direction (Output)
[ 2136.149165] hm2/hm2_5i25.0: IO Pin 020 (P2-15): StepGen #6, pin Step 
(Output)
[ 2136.149167] hm2/hm2_5i25.0: IO Pin 021 (P2-03): StepGen #7, pin 
Direction (Output)
[ 2136.149172] hm2/hm2_5i25.0: IO Pin 022 (P2-16): StepGen #7, pin Step 
(Output)
[ 2136.149174] hm2/hm2_5i25.0: IO Pin 023 (P2-04): IOPort
[ 2136.149176] hm2/hm2_5i25.0: IO Pin 024 (P2-17): IOPort
[ 2136.149179] hm2/hm2_5i25.0: IO Pin 025 (P2-05): PWMGen #0, pin Out0 (PWM 
or Up) (Output)
[ 2136.149182] hm2/hm2_5i25.0: IO Pin 026 (P2-06): PWMGen #0, pin 
Not-Enable (Output)
[ 2136.149185] hm2/hm2_5i25.0: IO Pin 027 (P2-07): PWMGen #0, pin Out1 (Dir 
or Down) (Output)
[ 2136.149187] hm2/hm2_5i25.0: IO Pin 028 (P2-08): IOPort
[ 2136.149189] hm2/hm2_5i25.0: IO Pin 029 (P2-09): IOPort
[ 2136.149191] hm2/hm2_5i25.0: IO Pin 030 (P2-10): IOPort
[ 2136.149194] hm2/hm2_5i25.0: IO Pin 031 (P2-11): Encoder #1, pin Index 
(Input)
[ 2136.149196] hm2/hm2_5i25.0: IO Pin 032 (P2-12): Encoder #1, pin B (Input)
[ 2136.149199] hm2/hm2_5i25.0: IO Pin 033 (P2-13): Encoder #1, pin A (Input)
I changed num_stepgen=8 in config string  rather than 9 earlier.
So, the highest numbered stepgen become GPIO pins as 023 and 024 .
I tried to redirect the PWM output to one of this pin as follows but it says 
this pin dosen't exist
net pwm-generate    => hm2_5i25.0.gpio.023

1.) How should I use this pin now ?
And also, I called write_gpio function as follows within base thread:
 addf hm2_5i25.0.write_gpio base-thread
BRAdit
  From: andy pugh 
 To: adit bhargava  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Friday, April 22, 2016 4:50 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 22 April 2016 at 15:43, adit bhargava  wrote:
> Does this mean that if I redirect the PWM output to 5i25 GPIO pin(after
> disabling the stepgen),
> the PWM signal will be forwarded to 7i76 also ?

No, the 5i25 pins currently associated with the highest-numbered
stepgen are hard-wired to the port that you (probably) have the 7i78
connected to.
Though you could swap the 7i78 and 7i76 ports.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread adit bhargava
So the highest-numbered  5i25 pin is connected to 7i78 and not 7i76 on which I 
was earlier redirecting output.I may connect the CRO to 7i78 then.

  From: andy pugh 
 To: adit bhargava  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Friday, April 22, 2016 4:50 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 22 April 2016 at 15:43, adit bhargava  wrote:
> Does this mean that if I redirect the PWM output to 5i25 GPIO pin(after
> disabling the stepgen),
> the PWM signal will be forwarded to 7i76 also ?

No, the 5i25 pins currently associated with the highest-numbered
stepgen are hard-wired to the port that you (probably) have the 7i78
connected to.
Though you could swap the 7i78 and 7i76 ports.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread andy pugh
On 22 April 2016 at 15:43, adit bhargava  wrote:
> Does this mean that if I redirect the PWM output to 5i25 GPIO pin(after
> disabling the stepgen),
> the PWM signal will be forwarded to 7i76 also ?

No, the 5i25 pins currently associated with the highest-numbered
stepgen are hard-wired to the port that you (probably) have the 7i78
connected to.
Though you could swap the 7i78 and 7i76 ports.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread adit bhargava
Does this mean that if I redirect the PWM output to 5i25 GPIO pin(after 
disabling the stepgen),the PWM signal will be forwarded to 7i76 also ? So, it 
means I don't need to change the connection of Oscilloscope which is connected 
to 7i76 right now ? Just redirect the PWM output to 5i25 GPIO pin and it will 
reach oscilloscope ?

  From: andy pugh 
 To: "adit_bh...@yahoo.com"  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Friday, April 22, 2016 4:31 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 22 April 2016 at 15:18, adit bhargava  wrote:

> For serial_port_N option, is it for 7i76 card?

One chanel  of sserial is for the GPIO and some other features on the
7i76. The second channel is for any smart-serial device attached to
the expansion port on the 7i76.

> I remember you suggested me to just disable the Stepgen on 5i25 card which
> can be done using only num_stepgens parameter and then this pin can be used
> for software PWM rather than 7i76 .

Almost. The highest-numbered stepgen (the one that you will be
disabling) will probably be connected to physical pins on the 7i78.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread andy pugh
On 22 April 2016 at 15:18, adit bhargava  wrote:

> For serial_port_N option, is it for 7i76 card?

One chanel  of sserial is for the GPIO and some other features on the
7i76. The second channel is for any smart-serial device attached to
the expansion port on the 7i76.

> I remember you suggested me to just disable the Stepgen on 5i25 card which
> can be done using only num_stepgens parameter and then this pin can be used
> for software PWM rather than 7i76 .

Almost. The highest-numbered stepgen (the one that you will be
disabling) will probably be connected to physical pins on the 7i78.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread adit bhargava
Hello Andy,
For serial_port_N option, is it for 7i76 card?I remember you suggested me to 
just disable the Stepgen on 5i25 card which can be done using only num_stepgens 
parameter and then this pin can be used for software PWM rather than 7i76 .
BRAdit

Sent from Yahoo Mail on Android 
 
  On Fri, 22 Apr, 2016 at 15:54, andy pugh wrote:   On 22 
April 2016 at 14:26, adit bhargava  wrote:

> For disabling the stepgens in config string, I think the value of 
> "num_stepgens"  be changed :Does this is all I need to do for disabling 
> stepgens ?

Yes. But be aware that it is the highest-numbered stepgen pins that
will become the GPIO pins.

> And I saw some option of sserial_port_N: Should I need to change something in 
> this as well ?

You can if you wish. That would enable features such as MPG counters
and analogue inputs on the 7i76 card.
You can see the software modes listed in the dmesg output. They are
also listed in the 7i76man.pdf file

-- 
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  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread andy pugh
On 22 April 2016 at 14:26, adit bhargava  wrote:

> For disabling the stepgens in config string, I think the value of 
> "num_stepgens"  be changed :Does this is all I need to do for disabling 
> stepgens ?

Yes. But be aware that it is the highest-numbered stepgen pins that
will become the GPIO pins.

> And I saw some option of sserial_port_N: Should I need to change something in 
> this as well ?

You can if you wish. That would enable features such as MPG counters
and analogue inputs on the 7i76 card.
You can see the software modes listed in the dmesg output. They are
also listed in the 7i76man.pdf file

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-22 Thread adit bhargava
Hello Andy,
For disabling the stepgens in config string, I think the value of 
"num_stepgens"  be changed :Does this is all I need to do for disabling 
stepgens ?
num_stepgens [optional, default: -1]Only enable the first N stepgens. If N is 
-1, all stepgens are enabled. If N is 0, no stepgens are enabled. If N is 
greater than the number of stepgens available in the firmware, the board will 
fail to register.


And I saw some option of sserial_port_N: Should I need to change something in 
this as well ? See below:

sserial_port_N (N = 0 .. 3) [optional, default:  for all 
ports]Up to 32 Smart Serial devices can be connected to a Mesa Anything IO 
board depending on the firmware used and the number of physical connections on 
the board. These are arranged in 1-4 ports of 1 to 8 channels. 
Some Smart Serial (SSLBP) cards offer more than one load-time configuration, 
for example all inputs, or all outputs, or offering additional analogue input 
on some digital pins. 
To set the modes for port 0 use, for example sserial_port_0=0120 
A ’0’in the string sets the corresponding port to mode 0, 1 to mode 1, and so 
on up to mode 9. An "x" in any position disables that channel and makes the 
corresponding FPGA pins available as GPIO. 
The string can be up to 8 characters long, and if it defines more modes than 
there are channels on the port then the extras are ignored. Channel numbering 
is left to right so the example above would set sserial device 0.0 to mode 0, 
0.2 to mode2 and disable channels 0.4 onwards. 
The sserial driver will auto-detect connected devices, no further configuration 
should be needed. Unconnected channels will default to GPIO, but the pin values 
will vary semi-randomly during boot when card-detection runs, to it is best to 
actively disable any channel that is to be used for GPIO.

BR Adit  From: andy pugh 
 To: Enhanced Machine Controller (EMC)  
 Sent: Thursday, April 21, 2016 2:08 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 21 April 2016 at 13:00, adit bhargava  wrote:

> My mentor dosen't want to make any change in hardware FPGA cards.
> He instead suggest to use Universal Pulse Generator UPG100
> http://www.eurias.nl/pdf/UPG100.pdf

I think that he is misunderstanding the suggestions then. Flashing a
different firmware is not a modification, and it entirely reversible.

But first you should try disabling the last stepgen in the
configuration string and using software PWM on the associated pin.
This will need you to add the write_gpio function to the fast thread,
as suggested by Seb.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-21 Thread Nicklas Karlsson
On Thu, 21 Apr 2016 13:08:41 +0100
andy pugh  wrote:

> On 21 April 2016 at 13:00, adit bhargava  wrote:
> 
> > My mentor dosen't want to make any change in hardware FPGA cards.
> > He instead suggest to use Universal Pulse Generator UPG100
> > http://www.eurias.nl/pdf/UPG100.pdf
> 
> I think that he is misunderstanding the suggestions then. Flashing a
> different firmware is not a modification, and it entirely reversible.

Yes, it might be good to think self there exist a limit then getting another 
mentor is a good idea.

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-21 Thread andy pugh
On 21 April 2016 at 13:00, adit bhargava  wrote:

> My mentor dosen't want to make any change in hardware FPGA cards.
> He instead suggest to use Universal Pulse Generator UPG100
> http://www.eurias.nl/pdf/UPG100.pdf

I think that he is misunderstanding the suggestions then. Flashing a
different firmware is not a modification, and it entirely reversible.

But first you should try disabling the last stepgen in the
configuration string and using software PWM on the associated pin.
This will need you to add the write_gpio function to the fast thread,
as suggested by Seb.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-21 Thread adit bhargava
Hello Andy/Sebastian,
My mentor dosen't want to make any change in hardware FPGA cards. 
He instead suggest to use Universal Pulse Generator UPG100 
http://www.eurias.nl/pdf/UPG100.pdf
However, he wants to control the UPG100 through software, rather than manually 
changing the T-On and T-Off times.Are there any such PWM generator devices 
available which we can control through software?Or rather build our own PWM 
circuits implemented it in MATLAB or PSPICE tools ?  

BRAdit

  From: andy pugh 
 To: Enhanced Machine Controller (EMC)  
Cc: adit bhargava 
 Sent: Wednesday, April 20, 2016 5:40 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 20 April 2016 at 16:06, Sebastian Kuzminsky  wrote:
> The hostmot2 driver exports a "write_gpio" function exactly for this
> kind of use case.  It updates just the gpios, runs quickly, and is
> intended to be called from a faster thread.

Yes, but the GPIO on the 7i76 is smart-serial. This is why I was
suggesting using some 5i25 pins wired as step/dir on the 7i76  as GPIO
for the purpose.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-20 Thread andy pugh
On 20 April 2016 at 16:06, Sebastian Kuzminsky  wrote:
> The hostmot2 driver exports a "write_gpio" function exactly for this
> kind of use case.  It updates just the gpios, runs quickly, and is
> intended to be called from a faster thread.

Yes, but the GPIO on the 7i76 is smart-serial. This is why I was
suggesting using some 5i25 pins wired as step/dir on the 7i76  as GPIO
for the purpose.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-20 Thread Sebastian Kuzminsky


On 04/20/2016 02:32 AM, andy pugh wrote:
> On 20 April 2016 at 09:13, adit bhargava  wrote:
>
>> I can't understand why I can't get the correct output on FPGA, although I am
>> getting on HALSCOPE ?
>
> Which output pin are you trying to drive? The IO pins on the 7i76 only
> update every 1mS.
> Haslcope (and the PWM function) are updating every 100uS.

The hostmot2 driver exports a "write_gpio" function exactly for this 
kind of use case.  It updates just the gpios, runs quickly, and is 
intended to be called from a faster thread.


-- 
Sebastian Kuzminsky

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-20 Thread andy pugh
On 20 April 2016 at 09:13, adit bhargava  wrote:

> I can't understand why I can't get the correct output on FPGA, although I am
> getting on HALSCOPE ?

Which output pin are you trying to drive? The IO pins on the 7i76 only
update every 1mS.
Haslcope (and the PWM function) are updating every 100uS.

> Also, is there any tutorial to " how to disable one of the step/dir
> channels" on 5i25  ?

There is this (which is somewhat out of date in that it does not
mention the newer cards, like the 5i25, which have a flashed-in
firmware and do not need firmware download when LinuxCNC starts)
http://linuxcnc.org/docs/2.7/html/drivers/hostmot2.html

And then there is the up-to-date but less well-written:
http://linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html
(The "config modparam" section is the part that really matters, you
typically don't use any options on the "loadrt hostmot2" line in the
HAL file.)

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-20 Thread adit bhargava
Hello Andy,

Yes, I am using the software PWM component output to MESA fpga card. Still, I 
can't understand why I can't get the correct output on FPGA, although I am 
getting on HALSCOPE ?

Why hardware PWM and new firmware is needed and how can I get it ? 

Also, is there any tutorial to " how to disable one of the step/dir channels" 
on 5i25  ?


Best Regards,Adit 

  From: andy pugh 
 To: adit bhargava  
Cc: Enhanced Machine Controller (EMC) 
 Sent: Monday, April 18, 2016 8:48 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 18 April 2016 at 19:34, adit bhargava  wrote:

> Oscilloscope connect to 7176 daughtercard
>
> Plus:      TB6 PIN24  => OUT7
> Gnd:      TB3 PIN15 => GND
>
> PWM Signal Routed to OUT 7

So, you are using software PWM with a Mesa FPGA card?
It would be better to use hardware PWM in the FPGA, but that might
need a different firmware.

The GPIO on the 7i76 is only updated once per mS, at the servo-thread rate.

There is an option to control _5i25_ GPIO at a faster rate by running
the hm2_5i25.0.write_gpio function in the faster thread.
This is not the same as the 7i76 GPIO.
By default all of the 5i25 GPIO is allocated. What you could do is
disable one of the step/dir channels and use that as GPIO (the
step/dir channels are wired direct to the 5i25, the 7i76 channels are
addressed by a serial interface and handled on the 7i76). Once you
have disabled the step generator and worked out which 5i25 IO pin that
corresponds to (the dmesg output will tell you) then you can run
software PWM to that pin.

However, I think that this would also disable all the step/dir
channels on the 7i78. So it would be better to disable only one
step/dir channel for this purpose.

Better still would be a custom firmware with a PWM generator connected
to one of the step-dir pins.

Alternatively, another user recently connected the 7i76
spindle-control potentiometer output in place of the potentiometer of
one of these devices to run an RC ESC:
http://www.ebay.co.uk/itm/Mini-3CH-Servo-Tester-Servo-Consistency-Master-Tester-for-RC-Helicopter-UK-/291289742212?hash=item43d238bb84:g:kMgAAOSwrx5UXGe~
and apparently it worked well.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-18 Thread Nicklas Karlsson
I wrote an incomplete software driver for a Micro controller which may output 
PWM. Unless you are familiar with programming in C on micro controllers I guess 
Hosmot is the best solution, especially if you already have one of these cards.




On Mon, 18 Apr 2016 19:48:41 +0100
andy pugh  wrote:

> On 18 April 2016 at 19:34, adit bhargava  wrote:
> 
> > Oscilloscope connect to 7176 daughtercard
> >
> > Plus:  TB6 PIN24  => OUT7
> > Gnd:  TB3 PIN15 => GND
> >
> > PWM Signal Routed to OUT 7
> 
> So, you are using software PWM with a Mesa FPGA card?
> It would be better to use hardware PWM in the FPGA, but that might
> need a different firmware.
> 
> The GPIO on the 7i76 is only updated once per mS, at the servo-thread rate.
> 
> There is an option to control _5i25_ GPIO at a faster rate by running
> the hm2_5i25.0.write_gpio function in the faster thread.
> This is not the same as the 7i76 GPIO.
> By default all of the 5i25 GPIO is allocated. What you could do is
> disable one of the step/dir channels and use that as GPIO (the
> step/dir channels are wired direct to the 5i25, the 7i76 channels are
> addressed by a serial interface and handled on the 7i76). Once you
> have disabled the step generator and worked out which 5i25 IO pin that
> corresponds to (the dmesg output will tell you) then you can run
> software PWM to that pin.
> 
> However, I think that this would also disable all the step/dir
> channels on the 7i78. So it would be better to disable only one
> step/dir channel for this purpose.
> 
> Better still would be a custom firmware with a PWM generator connected
> to one of the step-dir pins.
> 
> Alternatively, another user recently connected the 7i76
> spindle-control potentiometer output in place of the potentiometer of
> one of these devices to run an RC ESC:
> http://www.ebay.co.uk/itm/Mini-3CH-Servo-Tester-Servo-Consistency-Master-Tester-for-RC-Helicopter-UK-/291289742212?hash=item43d238bb84:g:kMgAAOSwrx5UXGe~
> and apparently it worked well.
> 
> -- 
> 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
> 
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-18 Thread andy pugh
On 18 April 2016 at 19:34, adit bhargava  wrote:

> Oscilloscope connect to 7176 daughtercard
>
> Plus:  TB6 PIN24  => OUT7
> Gnd:  TB3 PIN15 => GND
>
> PWM Signal Routed to OUT 7

So, you are using software PWM with a Mesa FPGA card?
It would be better to use hardware PWM in the FPGA, but that might
need a different firmware.

The GPIO on the 7i76 is only updated once per mS, at the servo-thread rate.

There is an option to control _5i25_ GPIO at a faster rate by running
the hm2_5i25.0.write_gpio function in the faster thread.
This is not the same as the 7i76 GPIO.
By default all of the 5i25 GPIO is allocated. What you could do is
disable one of the step/dir channels and use that as GPIO (the
step/dir channels are wired direct to the 5i25, the 7i76 channels are
addressed by a serial interface and handled on the 7i76). Once you
have disabled the step generator and worked out which 5i25 IO pin that
corresponds to (the dmesg output will tell you) then you can run
software PWM to that pin.

However, I think that this would also disable all the step/dir
channels on the 7i78. So it would be better to disable only one
step/dir channel for this purpose.

Better still would be a custom firmware with a PWM generator connected
to one of the step-dir pins.

Alternatively, another user recently connected the 7i76
spindle-control potentiometer output in place of the potentiometer of
one of these devices to run an RC ESC:
http://www.ebay.co.uk/itm/Mini-3CH-Servo-Tester-Servo-Consistency-Master-Tester-for-RC-Helicopter-UK-/291289742212?hash=item43d238bb84:g:kMgAAOSwrx5UXGe~
and apparently it worked well.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-18 Thread adit bhargava
I mean the pulses the coming on Hardware CROscilloscope but not with same 
period (6.7 ms)

  From: adit bhargava 
 To: andy pugh ; Enhanced Machine Controller (EMC) 
 
 Sent: Monday, April 18, 2016 8:34 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
Hello Andy, 


Thanks you for suggestions. I am able to add a new faster thread ( 100 
microseconds ) now.But, now the problem is I am not getting the output as 
desired on hardware although I am getting correct output on HALSCOPE.

RECAP: 

I wanted a square pulse of T-On = 2 ms and T-Off = 4.7 ms 
I used pwmgen as suggested by you with Freq = 150 Hz and Duty cycle = 29.9%I am 
getting the pulses correctly with 6.7 ms period on HALSCOPE but not on hardware 
FPGA  which is connected to CROscilloscope.
Following are details of my hardware:

MESA 5I25 I/O FPGA Card with two breakout cards    MESA 7I76 STEP/IO  Step 
plus I/O daughtercard  and MESA 7I78 Step daughtercard     Oscilloscope 
connect to 7176 daughtercard    Plus:  TB6 PIN24  => OUT7  Gnd:  TB3 
PIN15 => GND    PWM Signal Routed to OUT 7

BRAdit 
  From: andy pugh 
 To: adit bhargava ; Enhanced Machine Controller (EMC) 
 
 Sent: Monday, April 18, 2016 5:07 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
  
On 18 April 2016 at 15:36, adit bhargava  wrote:

> 1. TFP_Steurung.ini - In this file, I have under [EMCMOT] section, 
> SERVO_PERIOD = 100(1 ms)
>  Should I put my BASE_PERIOD = 10 (100 microsec) ?

The actual thread is created by the "loadrt motmod " line in the HAL file.
Values may be substituted into that line from the INI, but adding
values to the INI that are not referenced in the HAL will not have any
effect.

Your HAL file might well have "loadrt [EMCMOT]EMCMOT ..." though there
is no defined standard here, just custom and habit.
Basically the INI file can contain almost anything, it is up to the
HAL file (and HAL components) how that data is used.

So, there are a couple of things you can do, either edit the "loadrt
[EMCMOT]EMCMOT... line to create two threads according to the format
in the manual page, or just write it all out explicitly.
I prefer the second option in my own configs.
loadrt motmod base_period_ns=10 servo_period_ns=100 (and the
rest to match the existing config).

To add a thread _slower_ than existing threads you can use the
"threads" HAL call:
http://linuxcnc.org/docs/2.7/html/man/man9/threads.9.html
And that lets you choose the name of the threads too. However I doubt
that would work well with motmod, which likes to create threads with
defined names, and  as threads need to be created fastest to slowest I
suspect this way would be more trouble

> I tried to change base  period, but seems my file dosen't compile. I don't 
> have any idea how to compile this file. Can you please suggest something how 
> to compile ?

You _really_ don't need to recompile motion to achieve what you want
to achieve. You just need to pass the corrct parameters to the motion
component.

-- 
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

   

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-18 Thread adit bhargava
Hello Andy, 


Thanks you for suggestions. I am able to add a new faster thread ( 100 
microseconds ) now.But, now the problem is I am not getting the output as 
desired on hardware although I am getting correct output on HALSCOPE.

RECAP: 

I wanted a square pulse of T-On = 2 ms and T-Off = 4.7 ms 
I used pwmgen as suggested by you with Freq = 150 Hz and Duty cycle = 29.9%I am 
getting the pulses correctly with 6.7 ms period on HALSCOPE but not on hardware 
FPGA  which is connected to CROscilloscope.
Following are details of my hardware:

MESA 5I25 I/O FPGA Card with two breakout cards    MESA 7I76 STEP/IO  Step 
plus I/O daughtercard  and MESA 7I78 Step daughtercard     Oscilloscope 
connect to 7176 daughtercard    Plus:  TB6 PIN24  => OUT7  Gnd:  TB3 
PIN15 => GND    PWM Signal Routed to OUT 7

BRAdit 
  From: andy pugh 
 To: adit bhargava ; Enhanced Machine Controller (EMC) 
 
 Sent: Monday, April 18, 2016 5:07 PM
 Subject: Re: [Emc-users] Need to add a faster thread base-thread with 100 
microseconds, Compilation changes required !!!
   
On 18 April 2016 at 15:36, adit bhargava  wrote:

> 1. TFP_Steurung.ini - In this file, I have under [EMCMOT] section, 
> SERVO_PERIOD = 100(1 ms)
>  Should I put my BASE_PERIOD = 10 (100 microsec) ?

The actual thread is created by the "loadrt motmod " line in the HAL file.
Values may be substituted into that line from the INI, but adding
values to the INI that are not referenced in the HAL will not have any
effect.

Your HAL file might well have "loadrt [EMCMOT]EMCMOT ..." though there
is no defined standard here, just custom and habit.
Basically the INI file can contain almost anything, it is up to the
HAL file (and HAL components) how that data is used.

So, there are a couple of things you can do, either edit the "loadrt
[EMCMOT]EMCMOT... line to create two threads according to the format
in the manual page, or just write it all out explicitly.
I prefer the second option in my own configs.
loadrt motmod base_period_ns=10 servo_period_ns=100 (and the
rest to match the existing config).

To add a thread _slower_ than existing threads you can use the
"threads" HAL call:
http://linuxcnc.org/docs/2.7/html/man/man9/threads.9.html
And that lets you choose the name of the threads too. However I doubt
that would work well with motmod, which likes to create threads with
defined names, and  as threads need to be created fastest to slowest I
suspect this way would be more trouble

> I tried to change base  period, but seems my file dosen't compile. I don't 
> have any idea how to compile this file. Can you please suggest something how 
> to compile ?

You _really_ don't need to recompile motion to achieve what you want
to achieve. You just need to pass the corrct parameters to the motion
component.

-- 
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

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-18 Thread andy pugh
On 18 April 2016 at 15:36, adit bhargava  wrote:

> 1. TFP_Steurung.ini - In this file, I have under [EMCMOT] section, 
> SERVO_PERIOD = 100(1 ms)
>  Should I put my BASE_PERIOD = 10 (100 microsec) ?

The actual thread is created by the "loadrt motmod " line in the HAL file.
Values may be substituted into that line from the INI, but adding
values to the INI that are not referenced in the HAL will not have any
effect.

Your HAL file might well have "loadrt [EMCMOT]EMCMOT ..." though there
is no defined standard here, just custom and habit.
Basically the INI file can contain almost anything, it is up to the
HAL file (and HAL components) how that data is used.

So, there are a couple of things you can do, either edit the "loadrt
[EMCMOT]EMCMOT... line to create two threads according to the format
in the manual page, or just write it all out explicitly.
I prefer the second option in my own configs.
loadrt motmod base_period_ns=10 servo_period_ns=100 (and the
rest to match the existing config).

To add a thread _slower_ than existing threads you can use the
"threads" HAL call:
http://linuxcnc.org/docs/2.7/html/man/man9/threads.9.html
And that lets you choose the name of the threads too. However I doubt
that would work well with motmod, which likes to create threads with
defined names, and  as threads need to be created fastest to slowest I
suspect this way would be more trouble

> I tried to change base  period, but seems my file dosen't compile. I don't 
> have any idea how to compile this file. Can you please suggest something how 
> to compile ?

You _really_ don't need to recompile motion to achieve what you want
to achieve. You just need to pass the corrct parameters to the motion
component.

-- 
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

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Need to add a faster thread base-thread with 100 microseconds, Compilation changes required !!!

2016-04-18 Thread adit bhargava
Hello All,

 I want to create a base thread as a fast thread than my servo thread.
 I have 3 files :
1. TFP_Steurung.ini - In this file, I have under [EMCMOT] section, SERVO_PERIOD 
= 100(1 ms)
 Should I put my BASE_PERIOD = 10 (100 microsec) ?
2. TFP_Steurung.hal - In this file, I want to attach the base-thread to my 
function.   But, right now when I do, it says base-thread does not exist. Which 
means it's not created.
 3. emc-gui/src/emc/motion/motion.c In this file, I have a piece of code where 
its mentioned create base thread only if its faster than servo thread. Right 
now, its equal to servo period.

I tried to change base  period, but seems my file dosen't compile. I don't have 
any idea how to compile this file. Can you please suggest something how to 
compile ? Because I put my rtapi_print msgs and it also doesnt appear in dmesg.

I checked in emc-gui/docs/INSTALL these are the steps but not sure if this will 
disturb some linuxcnc settings :

File : 

emc-gui/docs/INSTALL 


"From the top level directory, switch to the source directory:

cd src

In the source directory, build LinuxCNC:

./autogen.sh  (this builds the configure script)
./configure [--with-realtime=uspace|/usr/rtai...]
make clean
make
sudo make setuid

to run the software go back to the top level directory, and issue:

source scripts/rip-environment
linuxcnc
"
 
    
Can you please suggest me the changes I need to make to create a base thread.?
THank you 


Best Regards,ADit Bhargava




    

  
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users