Re: [Emc-developers] What difference between using multi gcode commands and use multi functions in 1 gcode command?

2020-01-09 Thread Thắng
Tks Andy,
Your advice helped me figure out the problem. In this branch, the
*settings->kinsSwitch_flag* is used to indicate waiting for kinematics
switch done (handled in *execute_block* and return *INTERP_EXECUTE_FINISH*)
and it's set every G12.1 command so setting this flag twice in a gcode
command cause problem.

In order to avoid this problem, i tried create one more gcode command(i
call it G12), this command is used to switch kinematic to trivial kins. To
move joint:
 +  G12 (swtiching to trivial kin)
 +  G12.1 X_ Y_ Z_ (moving joints and switching back to original kin
after moving complete)
Using seperate command on two line work fine but if i put G12 and G12.1 in
one line, only G12 command is executed (this command has higher priority
order) , *G12.1 is skipped*. Then i have to find a way that make
interpreter wont skip this command.
Vào Th 3, 7 thg 1, 2020 vào lúc 20:15 andy pugh  đã
viết:

> On Sat, 28 Dec 2019 at 04:25, Thắng Lê  wrote:
>
> > So i just have a question: *What difference between using 3 gcode
> commands
> > and use 3 functions in 1 gcode command?*
>
> Three separate G-code commands will execute in strict sequence, and
> the second will not start until the first has completed.
>
> Three commands on the same line will execute in their priority order.
> Or, at least, they should.
>
> If you are using remap, maybe you have found a wrinkle in the logic,
> if that is not what you are seeing?
>
> --
> 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, 1912
>
>
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>


-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] What difference between using multi gcode commands and use multi functions in 1 gcode command?

2019-12-27 Thread Thắng
Hi,
I'm trying to creating a new gcode command to move joints.
Base on rushabhGH switchkin branch:
https://github.com/LinuxCNC/linuxcnc/compare/master...rushabhGH:switchKins
My idea is mixing G1 and G12.1 to a command that works like:
G12.1 P1 (Switch kinematic) ---> G1 (move joint) -->G12.1 P0 (Switch
back old kinematic).
1st: I try move joints by 3 commands:
   G12.1 P1
   G1 X40 F4200
   G12.1 P0
Everything look fine.

2nd: i change G12.1 to motion group-modal 1 (old group was modal 0), mixing
command in  interp_convert.cc file base on above idea: switch kinematic -->
use G1 function --> switch back old kinematic. source for this function
look like below:

> *int Interp::convert_kins_switch(block_pointer block, //!< pointer to
> a block of RS274 instructions*
>
*   setup_pointer settings)  //!< pointer to
machine settings*
*{*
*  settings->kinsSwitch_flag = true;*

*  ADJUST_KINS_OFFSET(1);*
*  CHP(convert_straight(G_1, block, settings)); //move joints*
*  settings->kinsSwitch_flag = true;*
*  ADJUST_KINS_OFFSET(0);*
*  return INTERP_OK;*
*}*

Motion isnt working like 1st case(look at below figure).
So i just have a question: *What difference between using 3 gcode commands
and use 3 functions in 1 gcode command?*
-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Change acceleration of tooltip

2019-03-08 Thread Thắng
Yes, i saw it but these pins ( global pins) doesnt work in Linuxcnc 2.8

Vào Th 6, 8 thg 3, 2019 vào lúc 22:17 andy pugh  đã
viết:

> On Fri, 8 Mar 2019 at 15:08, Thắng Lê  wrote:
> >
> > As i know, linuxcnc cant change accleration during run gcode. So i just
> > wanna change it when linuxcnc is in idle.
> > I tried add "maxacc" command to set acceleration of tooltip in python
> > interface.
>
> Can't you use the INI HAL pins?
>
> http://linuxcnc.org/docs/2.7/html/man/man1/milltask.1.html
>
> --
> 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
>
>
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>


-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] Change acceleration of tooltip

2019-03-08 Thread Thắng
As i know, linuxcnc cant change accleration during run gcode. So i just
wanna change it when linuxcnc is in idle.
I tried add "maxacc" command to set acceleration of tooltip in python
interface.

To do it i modified 2 files:
  src/emc/usr_intf/axis/extensions/emcmodule.cc (added maxacc function)
  src/emc/task/emctaskmain.cc (added more case in manual mode to set
acceleration)
Then i remake all src.
As i see, linuxcnc command will be go like this: python command -->
emcmodule.cc --> emctaskmain.cc --> taskinf.cc --> usrmotinf.cc -->
command.c. When i run Debug, i got "emcTrajSetAcceleration(500.)
returned 0" in shell if i use that command but the acceleration didnt
change both jog and auto mode.

-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]


setacc.rar
Description: Binary data
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Singularity avoidance

2019-02-21 Thread Thắng
 motion.addaptive-feed is only effect in auto mode, it's not effect in jog
mode ( except i set this pin to 0)

IMO you can use kinematics to numerically compute (local) Jacobian matrix (
> https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant) and then
> use
> eigenvalues of Jacobian matrix to determine how far from singularity you
> are (largest eigenvalue roughly correspond maximal 'multiplication factor'
> of current configuration).
>
> This is actuatly new for me, i just know i can calculate jacobian matrix
and det(J) but i dont understand.

>  largest eigenvalue roughly correspond maximal 'multiplication factor' of
> current configuration

Can you explain more detail? i would like to try this solution because it's
standard. Here i computed a jacobian matrix (local) of 4dof arm (4x4)
-128.1275  635.4552  292.2335   -4.1959
   80.8645  100.6462   46.2852   -0.6646
 0  -99.9125  -99.9125  -84.8938
 00.98770.98770.9877
Does these numbers have any mean?


Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Singularity avoidance

2019-02-15 Thread Thắng
>
>
> So, what would you like to happen when the robot is commanded to one
> of those positions?
> You can change the kinematics file to do anything you want.
> (including sending a signal out on a HAL pin)
>

My head!!! I forgot i can make a hal pin to send signal out.
I would  like to keep sqrt(x) with x>=0, sending x out and link it to
*motion.adaptive−feed*  to reduce velocity. of course, robot cant reach
area that it cant but this solution can help robot not stuck somewhere and
joint velocity dont increase so high till it leave singularies and
vicinity.
-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Singularity avoidance

2019-02-15 Thread Thắng
>
> Would this not also require some gain and possibly an inversion, of the
> air brush output in order to prevent a puddle/run of the ink or paint
> being laid down while the wrist was being reversed?
> I get a headache just thinking about it, but one of my questions remains
> unresolved.
> Would not the matching 180 degree movement of the wrist be obviated by
> having joints able to move equal amounts in both directions?
> This problem, at least in some of the video's, seems like a non-problem
> if the joint can move equally well in either direction from straight
> out, so to me it looks like a poor mechanical design up front that
> allows it to get into that position in the first place.
> Which may show that I have no clue what I'm talking about, never having
> dealt with a 6 DOF arm. Adding the airbrush trigger modulation would
> seem like a no brainer, as it could prevent that big run while the wrist
> is essentially immobilized while making that turn. But I'm the service
> shop guy that inherited all the record changers to fix when I was a
> teenager because I could watch a mechanism try to work, and see what it
> wasn't doing correctly. I had the dreaded "nack" of those days...


https://www.youtube.com/watch?v=6Wmw4lUHlX8
The singularity show at last video is what happened to me, joint speed
increase suddenly so high then "crack".

Perhaps the kinematics file could handle this? kins files are "pluggable"

What is "pluggable" mean?

Let's take pumakin as an example, these are some of equation to find when
robot reach singularities:
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/kinematics/pumakins.c#L229-L230
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/kinematics/pumakins.c#L246-L247

Kinematics cant be calculated because of a square root of a negative
number.

-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \_|__|_
   \  -  \  (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] Singularity avoidance

2019-02-14 Thread Thắng
"Singularity avoidance has been a developing topic for many years"
This topic was introduced here:
https://robohub.org/3-types-of-robot-singularities-and-how-to-avoid-them/

There is a solution was mentioned: reduce velocity when robot goes near
singlarity.

Because i cant take result of inverse kinematic function (can make this
function return singularities)  and i dont want to touch linuxcnc-core so i
have idea create a new hal component to recalculator singulartities.

The last problem: how to reduce velocity when robot is near singularities
and return old velocity when robot passes it? Is there any hal pin could do
this?


-- 
Lê Thắng
Phone: (+84) 7722443855
Email: lethang12...@gmail.com
   ___ ___ ___
( __ ) __ __( _ )
 \  -  \   _|__|_
   \  -  \ (_/ \_)
 \  -  \
   __\_ -_\ __
  [_]

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] Mb2hal/tcp using as a slave?

2018-12-24 Thread Thắng
Hi,

I'm trying to use Mb2hal(tcp) to connect to my Phone, i cant find how to
set mb2hal as a slave in INI file, even i tried to look at src code of
mb2hal but no luck. Is it possible to do this with Mb2hal?

-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Programing quadratic spline

2018-11-14 Thread Thắng
sorry, the condition of above equation is X1
đã viết:

> The Spline you calculate til Xn-1
>
>
> 
> From: emc-developers-requ...@lists.sourceforge.net <
> emc-developers-requ...@lists.sourceforge.net>
> Sent: Wednesday, November 14, 2018 7:03 AM
> To: emc-developers@lists.sourceforge.net
> Subject: Emc-developers Digest, Vol 151, Issue 4
>
> Send Emc-developers mailing list submissions to
> emc-developers@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/emc-developers
> or, via email, send a message with subject or body 'help' to
> emc-developers-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
> emc-developers-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Emc-developers digest..."
>
>
> Today's Topics:
>
>1. Programing quadratic spline (Th?ng L?)
>
>
> --
>
> Message: 1
> Date: Wed, 14 Nov 2018 09:12:23 +0700
> From: Th?ng L? 
> To: EMC developers 
> Subject: [Emc-developers] Programing quadratic spline
> Message-ID:
>  yk0mmcvdkqkz_iecuardy-fjqekiunzy9dt9yx...@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> I'm writing a function to draw a quadratic spline via n points N1,N2,Nn
> base on G5.1. The method to draw Spline is described here:
>+  Part 1:  https://www.youtube.com/watch?v=j_jBK7zJ1vU
>+  Part 2:  https://www.youtube.com/watch?v=kCPMph3cPA8
> I'm having a problem when X(n) = X(n+1) that make me cant solve system of
> equation. Any idea for this problem
> --
> L? Th??ng
> Phone: (+84) 1222443855
> Email: lethang12...@gmail.com
>
>
> --
>
>
>
> --
>
> Subject: Digest Footer
>
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
>
> --
>
> End of Emc-developers Digest, Vol 151, Issue 4
> **
>
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>


-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] Programing quadratic spline

2018-11-13 Thread Thắng
I'm writing a function to draw a quadratic spline via n points N1,N2,Nn
base on G5.1. The method to draw Spline is described here:
   +  Part 1:  https://www.youtube.com/watch?v=j_jBK7zJ1vU
   +  Part 2:  https://www.youtube.com/watch?v=kCPMph3cPA8
I'm having a problem when X(n) = X(n+1) that make me cant solve system of
equation. Any idea for this problem
-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] custom DEBUG gui

2018-05-17 Thread Thắng
Hi, i would like to build a debug gui that has: classicladder, halshow,
calibration,halscope, linuxcnctop because i dont want to open too many
windows.

classicladder: written by C and GTK
halshow: written by TCL ( i'm very new to this language)
calibration : written by TCL
halscope: unknown ( i cant find source code)
linuxcnctop: python.

My idea is create a GUI  that has pages include these guis:

page 1: contain a gui written by TCL include control buttons and 2 pages
   page 1.1: contain halshow
   page 1.2: mix calibration and halscope (not sure if it is posible)
   I saw tklinuxcnc GUI written by TCL so i think i can create a GUI that
can control linuxcnc  and  see status of linuxcncs. I take this idea from
mach3 tuning and setup window.

page 2: contain classicladder (not sure if it is posible)

page 3: contain linuxcnctop (this might easy)

So i have some questions:

1. where can i find halscope source?

2. Is there anyway to creat a GUI like above idea? I had some experience to
creat GUI by gladevcp from tutorials, really great if i can use this to
create new GUI.
-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] use python interface to develop a GUI?

2018-05-10 Thread Thắng
I know python interface can read status and send command to linuxcnc. I
would like to use it to create a new GUI. Is this way a right way?

-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-23 Thread Thắng
2018-03-23 21:14 GMT+07:00 Peter C. Wallace <p...@mesanet.com>:

> On Fri, 23 Mar 2018, Th?ng L? wrote:
>
> Date: Fri, 23 Mar 2018 16:04:47 +0700
>> From: "[UTF-8] Th?ng L?" <lethang12...@gmail.com>
>> Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
>> To: EMC developers <emc-developers@lists.sourceforge.net>
>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>> absolute
>> encoder
>>
>> i guess i cant contact UART on mesa 5i25 by linuxcnc, just only can get
>> data from FIFO. I found a way to solve this problem without touchich
>> uart.c
>> source but it's not complete.
>>
>> in 8 bytes serial, the first data is "P" (80 in hexa) and last bytes is
>> "CR" (13 in hexa).
>>
>> if i read FIFO data every 1 ms ( speed to read 1 bytes at 9600 baudrate
>> and
>> 10 bit frames), function will stop reading when it sees 80 ( or 13) but i
>> get only 1 byte that is 80 (or 13). I guess RX FIFO is cleared everytime i
>> read but i didnt find where that function is in:
>>
>
>
> When you start looking for the serial data do you clear the FIFO first?
> (writing to the FIFO count register clears the FIFO)
>
No, i didnt, ,the hm2_uart_read doesnt have function to clear RX_FIFO. It
doesnt contain function:
hm2->llio->write(hm2->llio, inst->rx_fifo_count_addr, , sizeof(u32));
I wonder why do we need to clear it, it already clear in setup function. I
will try add this function in HAL component, if it is impossible i probably
modify low level read function


> Does the low level read function wait for data? (FIFO count not 0)
>
Yes, it has a function:
hm2->llio->read(hm2->llio, hm2->uart.instance[inst].rx_fifo_count_addr , ,
sizeof(u32));

If you dont do these things its not likely you will get usable data



> Also you should read _all_ characters in the FIFO every ms
> (meaning you must read the FIFO count first to determine how many to read)

Exactly i got all correct data if the channel A of encoder back idle state
after send 8 bytes serial data.




2018-03-23 22:23 GMT+07:00 Gene Heskett <ghesk...@shentel.net>:

> On Friday 23 March 2018 05:04:47 Thắng Lê wrote:
>
> > i guess i cant contact UART on mesa 5i25 by linuxcnc, just only can
> > get data from FIFO. I found a way to solve this problem without
> > touchich uart.c source but it's not complete.
> >
> > in 8 bytes serial, the first data is "P" (80 in hexa) and last bytes
> > is "CR" (13 in hexa).
> >
> > if i read FIFO data every 1 ms ( speed to read 1 bytes at 9600
> > baudrate and 10 bit frames), function will stop reading when it sees
> > 80 ( or 13) but i get only 1 byte that is 80 (or 13). I guess RX FIFO
> > is cleared everytime i read but i didnt find where that function is
> > in:
> 9600 baud? Run that up to as fast as you can. At 9600, you'll be watching
> grass grow. 256k or better.


No, i cant change baudrate because it's abs_encoder baudrate


> > > --
> > > Lê Thắng
> > > Phone: (+84) 1222443855
> > > Email: lethang12...@gmail.com
>
>
>
> --
> 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 <http://geneslinuxbox.net:6309/gene>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>

I also thank you very much, just a bit more before finish this project

-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-23 Thread Thắng
i guess i cant contact UART on mesa 5i25 by linuxcnc, just only can get
data from FIFO. I found a way to solve this problem without touchich uart.c
source but it's not complete.

in 8 bytes serial, the first data is "P" (80 in hexa) and last bytes is
"CR" (13 in hexa).

if i read FIFO data every 1 ms ( speed to read 1 bytes at 9600 baudrate and
10 bit frames), function will stop reading when it sees 80 ( or 13) but i
get only 1 byte that is 80 (or 13). I guess RX FIFO is cleared everytime i
read but i didnt find where that function is in:

https://github.com/araisrobo/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/uart.c#L267

So I "read" data in RX FIFO as fast as time to send/receive 8 bytes data,
function will stop when it sees  80 . For UART has 9600 baudrate, 10
bit/byte and 8 bytes. My formula to caculate thread :
100us/bit * 10bit/byte * 8bytes * 2 ( for tx and rx).
This time i get all data but sometimes lost last bytes.

Below is my modified mesa_uart.comp file.

2018-03-23 10:47 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:

> i read uart.c that is written by Andy and found some lines that maybe can
> clear FIFO:
>
> https://github.com/araisrobo/linuxcnc/blob/master/src/hal/
> drivers/mesa-hostmot2/uart.c#L164-L165
>
> the data receive RX at:
> https://github.com/araisrobo/linuxcnc/blob/master/src/hal/
> drivers/mesa-hostmot2/uart.c#L296-L332
>
> When you said "disable RX", does that mean disable RX on 5i25 or RX on
> this driver?
>
> 2018-03-22 10:18 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:
>
>> i 'm looking at* hm2_uart_setup,* the rx_mode describe:
>> *   Bit 0* = FalseStart bit Status, 1 = false start bit detected
>>*Bit 1* = OverRun Status, 1 = overrun condition detected (no
>> valid stop bit)
>>*Bit 2* = RXMaskEnable, 1= enable RXMask for half duplex
>> operation, 0 = ingore RXMask
>>*Bit 4* = FIFOError, indicates that a host read has attemped to
>> read more data than available. (mainly for driver debugging)
>>*Bit 5* = LostDataError, indicates that data was received with no
>> room in FIFO,
>> *   Bit 6* = RXMask, RO RXMASK status
>> *   Bit 7* = FIFO Has Data
>>
>> I'm not very clearly understand when i read it,i dont see how to clear
>> FIFO or disable RX from these 7 bits. I guess u mention pktuart, right?
>>
>>
>>
>> 2018-03-22 0:28 GMT+07:00 Peter C. Wallace <p...@mesanet.com>:
>>
>>> On Wed, 21 Mar 2018, Th?ng L? wrote:
>>>
>>> Date: Wed, 21 Mar 2018 15:20:12 +0700
>>>> From: "[UTF-8] Th?ng L?" <lethang12...@gmail.com>
>>>> Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
>>>> To: EMC developers <emc-developers@lists.sourceforge.net>
>>>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>>>> absolute
>>>> encoder
>>>>
>>>> i'm using mesa_uart to read serial data but i have a issue. Sometimes,
>>>>
>>> after sending 8 bytes, the  phase A isnt come back idle state-5V state
>>> (it
>>> keeps 0V state).  This mean uart is still getting data after first 8
>>> bytes,then
>>> the UART data shows me rx-bytes = 16, all  rx-data = 0.
>>>
>>>
>>>
>>>
>>>
>>> Is mesa_uart posible to limit the number bytes UART read?
>>>
>>>
>>> No, but this is expected if the input is driven low after the data
>>> you must only clear the UART/FIFO when the data line is idle
>>>
>>> You can disable RX if you know when the input data will become invalid
>>>
>>> (you would also expect to see the framing error bit set in this
>>> circumstance)
>>>
>>>
>>>
>>> 2018-03-16 23:52 GMT+07:00 Peter C. Wallace <p...@mesanet.com>:
>>>
>>> On Fri, 16 Mar 2018, Th?ng L? wrote:
>>>>
>>>> Date: Fri, 16 Mar 2018 23:43:49 +0700
>>>>
>>>>> From: "[UTF-8] Th?ng L?" <lethang12...@gmail.com>
>>>>> Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
>>>>> To: EMC developers <emc-developers@lists.sourceforge.net>
>>>>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>>>>> absolute
>>>>> encoder
>>>>>
>>>>> ah, i understood what you mean. thank you very much
>>>>>
>>>>>
>>>> 2018-03-16 23:30 GMT+07:00 andy pugh <bodge...@gmail.com>:
>>>>
&g

Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-22 Thread Thắng
i read uart.c that is written by Andy and found some lines that maybe can
clear FIFO:

https://github.com/araisrobo/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/uart.c#L164-L165

the data receive RX at:
https://github.com/araisrobo/linuxcnc/blob/master/src/hal/drivers/mesa-hostmot2/uart.c#L296-L332

When you said "disable RX", does that mean disable RX on 5i25 or RX on this
driver?

2018-03-22 10:18 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:

> i 'm looking at* hm2_uart_setup,* the rx_mode describe:
> *   Bit 0* = FalseStart bit Status, 1 = false start bit detected
>*Bit 1* = OverRun Status, 1 = overrun condition detected (no valid
> stop bit)
>*Bit 2* = RXMaskEnable, 1= enable RXMask for half duplex
> operation, 0 = ingore RXMask
>*Bit 4* = FIFOError, indicates that a host read has attemped to
> read more data than available. (mainly for driver debugging)
>*Bit 5* = LostDataError, indicates that data was received with no
> room in FIFO,
> *   Bit 6* = RXMask, RO RXMASK status
> *   Bit 7* = FIFO Has Data
>
> I'm not very clearly understand when i read it,i dont see how to clear
> FIFO or disable RX from these 7 bits. I guess u mention pktuart, right?
>
>
>
> 2018-03-22 0:28 GMT+07:00 Peter C. Wallace <p...@mesanet.com>:
>
>> On Wed, 21 Mar 2018, Th?ng L? wrote:
>>
>> Date: Wed, 21 Mar 2018 15:20:12 +0700
>>> From: "[UTF-8] Th?ng L?" <lethang12...@gmail.com>
>>> Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
>>> To: EMC developers <emc-developers@lists.sourceforge.net>
>>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>>> absolute
>>> encoder
>>>
>>> i'm using mesa_uart to read serial data but i have a issue. Sometimes,
>>>
>> after sending 8 bytes, the  phase A isnt come back idle state-5V state (it
>> keeps 0V state).  This mean uart is still getting data after first 8
>> bytes,then
>> the UART data shows me rx-bytes = 16, all  rx-data = 0.
>>
>>
>>
>>
>>
>> Is mesa_uart posible to limit the number bytes UART read?
>>
>>
>> No, but this is expected if the input is driven low after the data
>> you must only clear the UART/FIFO when the data line is idle
>>
>> You can disable RX if you know when the input data will become invalid
>>
>> (you would also expect to see the framing error bit set in this
>> circumstance)
>>
>>
>>
>> 2018-03-16 23:52 GMT+07:00 Peter C. Wallace <p...@mesanet.com>:
>>
>> On Fri, 16 Mar 2018, Th?ng L? wrote:
>>>
>>> Date: Fri, 16 Mar 2018 23:43:49 +0700
>>>
>>>> From: "[UTF-8] Th?ng L?" <lethang12...@gmail.com>
>>>> Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
>>>> To: EMC developers <emc-developers@lists.sourceforge.net>
>>>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>>>> absolute
>>>> encoder
>>>>
>>>> ah, i understood what you mean. thank you very much
>>>>
>>>>
>>> 2018-03-16 23:30 GMT+07:00 andy pugh <bodge...@gmail.com>:
>>>
>>> On 16 March 2018 at 16:27, Thng L <lethang12...@gmail.com>
>>> wrote:
>>>
>>>> > this is a great idea but how can i right-shift the data? Both your way
>>>> and
>>>> > Peter's way seem have to touch UART  source
>>>>
>>>> No, you can shift the raw data in the HAL component that interprets the
>>>> data.
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>> Actually theres no shifting involved, only manipulating bit 7 of the
>>> 8 bit data
>>>
>>> Peter Wallace
>>> Mesa Electronics
>>>
>>> 
>>> --
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> ___
>>> Emc-developers mailing list
>>> Emc-developers@lists.sourceforge.net
>>> https://lists.sourcefor

Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-21 Thread Thắng
i 'm looking at* hm2_uart_setup,* the rx_mode describe:
*   Bit 0* = FalseStart bit Status, 1 = false start bit detected
   *Bit 1* = OverRun Status, 1 = overrun condition detected (no valid
stop bit)
   *Bit 2* = RXMaskEnable, 1= enable RXMask for half duplex operation,
0 = ingore RXMask
   *Bit 4* = FIFOError, indicates that a host read has attemped to read
more data than available. (mainly for driver debugging)
   *Bit 5* = LostDataError, indicates that data was received with no
room in FIFO,
*   Bit 6* = RXMask, RO RXMASK status
*   Bit 7* = FIFO Has Data

I'm not very clearly understand when i read it,i dont see how to clear FIFO
or disable RX from these 7 bits. I guess u mention pktuart, right?



2018-03-22 0:28 GMT+07:00 Peter C. Wallace :

> On Wed, 21 Mar 2018, Th?ng L? wrote:
>
> Date: Wed, 21 Mar 2018 15:20:12 +0700
>> From: "[UTF-8] Th?ng L?" 
>> Reply-To: EMC developers 
>> To: EMC developers 
>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>> absolute
>> encoder
>>
>> i'm using mesa_uart to read serial data but i have a issue. Sometimes,
>>
> after sending 8 bytes, the  phase A isnt come back idle state-5V state (it
> keeps 0V state).  This mean uart is still getting data after first 8
> bytes,then
> the UART data shows me rx-bytes = 16, all  rx-data = 0.
>
>
>
>
>
> Is mesa_uart posible to limit the number bytes UART read?
>
>
> No, but this is expected if the input is driven low after the data
> you must only clear the UART/FIFO when the data line is idle
>
> You can disable RX if you know when the input data will become invalid
>
> (you would also expect to see the framing error bit set in this
> circumstance)
>
>
>
> 2018-03-16 23:52 GMT+07:00 Peter C. Wallace :
>
> On Fri, 16 Mar 2018, Th?ng L? wrote:
>>
>> Date: Fri, 16 Mar 2018 23:43:49 +0700
>>
>>> From: "[UTF-8] Th?ng L?" 
>>> Reply-To: EMC developers 
>>> To: EMC developers 
>>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>>> absolute
>>> encoder
>>>
>>> ah, i understood what you mean. thank you very much
>>>
>>>
>> 2018-03-16 23:30 GMT+07:00 andy pugh :
>>
>> On 16 March 2018 at 16:27, Thng L  wrote:
>>
>>> > this is a great idea but how can i right-shift the data? Both your way
>>> and
>>> > Peter's way seem have to touch UART  source
>>>
>>> No, you can shift the raw data in the HAL component that interprets the
>>> data.
>>>
>>> --
>>> 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
>>>
>>>
>> Actually theres no shifting involved, only manipulating bit 7 of the
>> 8 bit data
>>
>> Peter Wallace
>> Mesa Electronics
>>
>> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> Emc-developers mailing list
>> Emc-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
>>
>>
>
> --
> Lÿÿ Thng
> Phone: (+84) 1222443855
> Email: lethang12...@gmail.com
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
> Peter Wallace
> Mesa Electronics
>
> (\__/)
> (='.'=) This is Bunny. Copy and paste bunny into your
> (")_(") signature to help him gain world domination.
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
>


-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-21 Thread Thắng
i'm using mesa_uart to read serial data but i have a issue. Sometimes,
after sending 8 bytes, the  phase A isnt come back idle state-5V state (it
keeps 0V state).  This mean uart is still getting data after first 8 bytes,then
the UART data shows me rx-bytes = 16, all  rx-data = 0.

Is mesa_uart posible to limit the number bytes UART read?

2018-03-16 23:52 GMT+07:00 Peter C. Wallace :

> On Fri, 16 Mar 2018, Th?ng L? wrote:
>
> Date: Fri, 16 Mar 2018 23:43:49 +0700
>> From: "[UTF-8] Th?ng L?" 
>> Reply-To: EMC developers 
>> To: EMC developers 
>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>> absolute
>> encoder
>>
>> ah, i understood what you mean. thank you very much
>>
>
> 2018-03-16 23:30 GMT+07:00 andy pugh :
>
> On 16 March 2018 at 16:27, Thяяng Lяя  wrote:
>> > this is a great idea but how can i right-shift the data? Both your way
>> and
>> > Peter's way seem have to touch UART  source
>>
>> No, you can shift the raw data in the HAL component that interprets the
>> data.
>>
>> --
>> 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
>>
>
> Actually theres no shifting involved, only manipulating bit 7 of the
> 8 bit data
>
> Peter Wallace
> Mesa Electronics
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
>


-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-16 Thread Thắng
ah, i understood what you mean. thank you very much

2018-03-16 23:30 GMT+07:00 andy pugh <bodge...@gmail.com>:

> On 16 March 2018 at 16:27, Thắng Lê <lethang12...@gmail.com> wrote:
> > this is a great idea but how can i right-shift the data? Both your way
> and
> > Peter's way seem have to touch UART  source
>
> No, you can shift the raw data in the HAL component that interprets the
> data.
>
> --
> 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-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-16 Thread Thắng
this is a great idea but how can i right-shift the data? Both your way and
Peter's way seem have to touch UART  source. I dont mind to modify it but
if need to change firmware is a bit problem with me

2018-03-16 17:53 GMT+07:00 andy pugh <bodge...@gmail.com>:

> On 16 March 2018 at 08:52, Thắng Lê <lethang12...@gmail.com> wrote:
> > The data frame is: 1 bit start + character 7 bits + 1 bit even parity +
>  1
> > bit stop. I dont need creat this Frame for TX, if there is anyway that i
> > can configure this Frame for RX without touching uart firmware and
> > component source?
>
> It sounds like you should be able to configure the UART for 1 start, 1
> stop and no-parity and then right-shift the data to lose the parity
> bit
> (Possibly after checking parity manually)
>
> --
> 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-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-16 Thread Thắng
The data frame is: 1 bit start + character 7 bits + 1 bit even parity +   1
bit stop. I dont need creat this Frame for TX, if there is anyway that i
can configure this Frame for RX without touching uart firmware and
component source?

2018-03-15 5:09 GMT+07:00 Peter C. Wallace :

> On Wed, 14 Mar 2018, Rene Hopf wrote:
>
> Date: Wed, 14 Mar 2018 22:53:59 +0100
>> From: Rene Hopf 
>> Reply-To: EMC developers 
>> To: EMC developers 
>> Subject: Re: [Emc-developers] writing new firmware to read yaskawa
>> absolute
>> encoder
>>
>>
>> On 14. Mar 2018, at 17:54, Peter C. Wallace  wrote:
>>>
>>> Typically there would be no issue sending and receiving 7 bit characters
>>> with the PacketUART (just mask bit 7 on RX and set it to the line idle
>>> (high) state on TX )
>>>
>>
>> thats not how uart works, if there is a stop bit, and usually there is.
>>
>
> Umm, works for me...
>
> That is for TX you can add the stop bit in the data (extra stop bits on TX
> only slow the data rate slightly) Note that stop bits are in the idle line
> state.
>
> for RX 7 bit data in a 8 bit UART will work fine as long as data has 2
> stop bits or a parity bit (or is not sent with end-end characters)
>
>
> 
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> Emc-developers mailing list
>> Emc-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
>>
> Peter Wallace
> Mesa Electronics
>
> (\__/)
> (='.'=) This is Bunny. Copy and paste bunny into your
> (")_(") signature to help him gain world domination.
>
>
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-13 Thread Thắng
unfortunately, channel A use serial interface with ASCII 7bits, i guess i
cant use mesa_uart without modify uart.c. Does pktuart allow me to change
frames? I was looking at hm2_pktuart_setup function, there is  an option
"Bit 20..16 Frames received", is this what i need?

2018-03-10 17:40 GMT+07:00 andy pugh :

> On 10 March 2018 at 09:25, Rene Hopf  wrote:
>
> > hm2_pktuart_send is provided by https://github.com/LinuxCNC/
> linuxcnc/blob/af15a4d90e1d51d5309db65fe1c9511e486df411/src/hal/drivers/
> mesa-hostmot2/pktuart.c
> > you need to load that before you load the others.
>
> Specifically something like this at the command line (or in a HAL file)
>
> halrun
> loadrt hostmtot2
> loadrt hm2_pci
>
> If the 5i25 is flashed with the right firmware then the hosmot2 driver
> will have loaded the appropriate UART drivers.
>
> At that poiint
>
> loadrt mesa_uart names="the name of a uart from the output above"
>
> Will be able to hook-in to the UART.
>
> At this point nothing happens still, as the real-time functions are
> not being called. You can get a list of the functions that exist to be
> added to threads with
> show thread
>
> Then load and link the threads:
>
> loadrt threads
> addf hm2_5i25.read thread1
> addf mesa_uart thread1
> addf hm2_5i25.write thread1
> start
>
> Will get the realtime threads going.
>
>
> --
> 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-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-09 Thread Thắng
in my 2.8 pre linuxcnc, i also changed the path in mesa_uart.comp to
compile it

2018-03-10 14:45 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:

> When i try run mesa_uart or mesa_pktgyro_test in halcmd, terminal shows me
> "*undefined symbol: hm2_uart_read" or " undefind symbol:
> hm2_pktuart_send" *. Any idea why do this happen?
>
> 2018-03-10 11:55 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:
>
>> i'm stucked at uarts because i dont really understand how UART work , i
>> see there are many files like mesa_uart.c, mesa_uart.comp, uart.c,
>> pktuart.c, I guess uart.c and pktuart.c contains uart's functions and
>> mesa_uart.comp or mesa_pktgyro_test.comp will use these functions so i just
>> need creat a component like mesa_uart.comp or mesa_pktgyro_test.comp.
>>
>> I made a bitfile for UART, in xilinx it's name "work.PIN_UA2_34.all"
>> (there are many firmware pktuart and uart in librarybut i cant make bitfile
>> for 5i25, also see two line *work.PIN_7i74_PKT_34.all* and  
>> *work.PIN_7i74x2_PKT_34.all
>> *in TopPCIHosMot2.vhd but there is no file in library therefore i cant
>> use ptkuart too) . If i use this firmware   "work.PIN_UA2_34.all" , do i
>> need to modify something on it before make bitfile?
>>
>>
>>
>>
>>
>>
>> 2018-03-09 23:12 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:
>>
>>> sorry, my abs_encoder is 15 bit type, showing at page 56 (63 is pdf
>>> page), it hasn't phase S.
>>>
>>> The problem is phase A has 2 functions, send serial data and incremental
>>> pulses so i think i will connect it to 1 UART port and 1 encoder counter
>>> port, after receive serial data, i will reset counter. Seem there is not
>>> 5i25 firmware support both function so i think i have to make one.
>>>
>>> I will try use UART to get first serial data output.
>>>
>>>
>>> 2018-03-09 4:35 GMT+07:00 andy pugh <bodge...@gmail.com>:
>>>
>>>> On 8 March 2018 at 09:39, Thắng Lê <lethang12...@gmail.com> wrote:
>>>>
>>>> > +  Writing a firmware file absyaskawa.vhd with VHDL language then add
>>>> in
>>>> > xilinx library so i can flash new firmware for my mesa card (i'm very
>>>> new
>>>> > with FPGA,i need to learn VHDL first).
>>>>
>>>> You might not need to do this.
>>>>
>>>> It looks like the absolute data is available on the S channel as
>>>> simple serial data.
>>>>
>>>> So you might be able to use the Mesa UART or PktUART Hostmot2 modules.
>>>>
>>>> You would need a simple HAL component to interpret the data. This
>>>> would output the various fault bits and add the start-up offset to the
>>>> output of a conventional encoder module.
>>>>
>>>> Here is a HAL driver that uses the pktUART Hostmot2 component. (Note
>>>> that there is a typo in the line where is says "loadrt mesa_uart...".
>>>> For that HAL component it should be "loadrt mesa_pktgyro_test"
>>>>
>>>> As the data is ASCII coded the HAL component would need to change that
>>>> to floating point engineering units.
>>>>
>>>> --
>>>> 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-developers mailing list
>>>> Emc-developers@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>>>
>>>
>>>
>>>
>>> --
>>> Lê Thắng
>>> Phone: (+84) 1222443855
>>> Email: lethang12...@gmail.com
>>>
>>
>>
>>
>> --
>> Lê Thắng
>> Phone: (+84) 1222443855
>> Email: lethang12...@gmail.com
>>
>
>
>
> --
> Lê Thắng
> Phone: (+84) 1222443855
> Email: lethang12...@gmail.com
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-09 Thread Thắng
i'm stucked at uarts because i dont really understand how UART work , i see
there are many files like mesa_uart.c, mesa_uart.comp, uart.c, pktuart.c, I
guess uart.c and pktuart.c contains uart's functions and mesa_uart.comp or
mesa_pktgyro_test.comp will use these functions so i just need creat a
component like mesa_uart.comp or mesa_pktgyro_test.comp.

I made a bitfile for UART, in xilinx it's name "work.PIN_UA2_34.all" (there
are many firmware pktuart and uart in librarybut i cant make bitfile for
5i25, also see two line *work.PIN_7i74_PKT_34.all* and
*work.PIN_7i74x2_PKT_34.all
*in TopPCIHosMot2.vhd but there is no file in library therefore i cant use
ptkuart too) . If i use this firmware   "work.PIN_UA2_34.all" , do i need
to modify something on it before make bitfile?






2018-03-09 23:12 GMT+07:00 Thắng Lê <lethang12...@gmail.com>:

> sorry, my abs_encoder is 15 bit type, showing at page 56 (63 is pdf page),
> it hasn't phase S.
>
> The problem is phase A has 2 functions, send serial data and incremental
> pulses so i think i will connect it to 1 UART port and 1 encoder counter
> port, after receive serial data, i will reset counter. Seem there is not
> 5i25 firmware support both function so i think i have to make one.
>
> I will try use UART to get first serial data output.
>
>
> 2018-03-09 4:35 GMT+07:00 andy pugh <bodge...@gmail.com>:
>
>> On 8 March 2018 at 09:39, Thắng Lê <lethang12...@gmail.com> wrote:
>>
>> > +  Writing a firmware file absyaskawa.vhd with VHDL language then add in
>> > xilinx library so i can flash new firmware for my mesa card (i'm very
>> new
>> > with FPGA,i need to learn VHDL first).
>>
>> You might not need to do this.
>>
>> It looks like the absolute data is available on the S channel as
>> simple serial data.
>>
>> So you might be able to use the Mesa UART or PktUART Hostmot2 modules.
>>
>> You would need a simple HAL component to interpret the data. This
>> would output the various fault bits and add the start-up offset to the
>> output of a conventional encoder module.
>>
>> Here is a HAL driver that uses the pktUART Hostmot2 component. (Note
>> that there is a typo in the line where is says "loadrt mesa_uart...".
>> For that HAL component it should be "loadrt mesa_pktgyro_test"
>>
>> As the data is ASCII coded the HAL component would need to change that
>> to floating point engineering units.
>>
>> --
>> 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-developers mailing list
>> Emc-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-developers
>>
>
>
>
> --
> Lê Thắng
> Phone: (+84) 1222443855
> Email: lethang12...@gmail.com
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-09 Thread Thắng
sorry, my abs_encoder is 15 bit type, showing at page 56 (63 is pdf page),
it hasn't phase S.

The problem is phase A has 2 functions, send serial data and incremental
pulses so i think i will connect it to 1 UART port and 1 encoder counter
port, after receive serial data, i will reset counter. Seem there is not
5i25 firmware support both function so i think i have to make one.

I will try use UART to get first serial data output.


2018-03-09 4:35 GMT+07:00 andy pugh <bodge...@gmail.com>:

> On 8 March 2018 at 09:39, Thắng Lê <lethang12...@gmail.com> wrote:
>
> > +  Writing a firmware file absyaskawa.vhd with VHDL language then add in
> > xilinx library so i can flash new firmware for my mesa card (i'm very new
> > with FPGA,i need to learn VHDL first).
>
> You might not need to do this.
>
> It looks like the absolute data is available on the S channel as
> simple serial data.
>
> So you might be able to use the Mesa UART or PktUART Hostmot2 modules.
>
> You would need a simple HAL component to interpret the data. This
> would output the various fault bits and add the start-up offset to the
> output of a conventional encoder module.
>
> Here is a HAL driver that uses the pktUART Hostmot2 component. (Note
> that there is a typo in the line where is says "loadrt mesa_uart...".
> For that HAL component it should be "loadrt mesa_pktgyro_test"
>
> As the data is ASCII coded the HAL component would need to change that
> to floating point engineering units.
>
> --
> 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-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-08 Thread Thắng
Thank Andy, that is a big help!

So all the things i need to do are:

+  Writing a firmware file absyaskawa.vhd with VHDL language then add in
xilinx library so i can flash new firmware for my mesa card (i'm very new
with FPGA,i need to learn VHDL first).
+  Modifying  the abs_encoder.c file to add new HAL pin for yaskawa then
recompiling source.

are they enough? I feel i lack something but i cant explain.


2018-03-07 18:27 GMT+07:00 andy pugh <bodge...@gmail.com>:

> On 7 March 2018 at 10:57, Thắng Lê <lethang12...@gmail.com> wrote:
>
> > can i ask for a way to write a new firmware to get yaskawa absolute
> encoder.
> ...
> > So first of all, i need a way to confirm the data i send is true. i
> assume
> > i can use combo 5i25-->7i74--> converter rs-485 to rs-232 ( or usb) -->
> pc
> > to debug in terminal. After that i will write a new firmware base on old
> > firmware
>
>
> I assume that you are talking about using Mesa cards, and writing a
> new firmware for those.
>
> There is existing firmware for some absolute encoders with driver
> support in LinuxCNC:
> (SSI, BiSS and Fanuc)
> http://linuxcnc.org/docs/devel/html/man/man9/hostmot2.9.html#Synchronous
> Serial Interface (SSI)
>
> As well as modifying the firmware you would also have to add the HAL
> layer support to the Hostmot2 driver:
> https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/
> drivers/mesa-hostmot2/abs_encoder.c
> (I note that I forgot to update the file comments after I had added
> the BiSS and Fanuc)
>
> The Mesa firmware module for the Fanuc absolute encoders  is here:
> https://github.com/LinuxCNC/hostmot2-firmware/blob/master/src/fanucabs.vhd
>
> A Yaskawa module for Hostmot2 and HAL would be a very nice addition to
> LinuxCNC.
>
>
> There is an alternative option which swaps a software problem for a
> hardware problem:
> https://github.com/rene-dev/stmbl/blob/a0a41864f9a40fc7122f1369a4373d
> 9f459a3136/docs/src/Getting%20Started.adoc
> The STMBL servo drive connects to LinuxCNC via a Mesa card using smart
> serial (so could be used in place of your RS-485 to RS232 converter in
> the hardware you outlined above)
> You could either use it just as a Yaskawa to Smart-Serial converter or
> utilise it as the servo drive for your system.
>
> The STMBL firmware is written in C rather than VHDL so is probably not
> directly usable in a Mesa firmware module.
>
> I have lots of unpopulated circuit boards, but assembled drives or
> populated boards are rather rarer. (I had a batch of 50 made, but they
> are all allocated to recipients).
>
> If you are needing a lot of boards then I can put you in touch with a
> company in China who have all the files and can make populated boards
> (less power semiconductor) for £50 a board in batches of 50.
>
> --
> 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-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] writing new firmware to read yaskawa absolute encoder

2018-03-07 Thread Thắng
Hi EMC developers,

can i ask for a way to write a new firmware to get yaskawa absolute encoder.

My knowedge is limit so i cant find the way by myself therefore i need a
little bit help.

The yaskawa abs_encoder is a serial abs_encoder but it's using quadrature.
>From the the yaskawa document below, i see each phase is each channel
rs-422. To read this data i need a new firmware for another baudrate and
data format.

So first of all, i need a way to confirm the data i send is true. i assume
i can use combo 5i25-->7i74--> converter rs-485 to rs-232 ( or usb) --> pc
to debug in terminal. After that i will write a new firmware base on old
firmware

Is this right?

-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com


absenc.pdf
Description: Adobe PDF document
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] Genserkins

2018-01-24 Thread Thắng
Hi,

i'm trying to use Genserkins for redundancy robot. Since Genserkins is
using moore-penrose method to compute pseudoinverse that has problem at
singularities so i wanna replace it by singular value decomposition(SVD)
method to compute pseudoinverse.

I found out lapack library can compute SVD, is it posible use lapack in
linuxcnc?


-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] how to change arm robot config

2017-11-19 Thread Thắng
mhm, i think genserkins is so hard for me to understand. Anyway, my
solution work if i increase FERROR but i dont know what happen if FERROR is
too high. if i'm not wrong this variable only effect if i use pwm

2017-11-18 23:54 GMT+07:00 andy pugh <bodge...@gmail.com>:

> On 17 November 2017 at 01:44, Thắng Lê <lethang12...@gmail.com> wrote:
> > Hi,
> >
> > Is there anyway that i can change robot config? Example in pumakins,
> there
> > is a flag call "iflag" that discribe the config of elbow, shoulder and
> > wrist. I want to change the elbow config of robot from up to behind. i
> > already tried make a new hal pin for kinematic then set this pin to
> change
> > iflag from M code but it does not work.
>
> I think that Pumakins has too many hard-coded values, and that you
> should perhaps look at Genserkins.
>
> --
> 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-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>



-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] how to change arm robot config

2017-11-16 Thread Thắng
Hi,

Is there anyway that i can change robot config? Example in pumakins, there
is a flag call "iflag" that discribe the config of elbow, shoulder and
wrist. I want to change the elbow config of robot from up to behind. i
already tried make a new hal pin for kinematic then set this pin to change
iflag from M code but it does not work.

-- 
Lê Thắng
Phone: (+84) 1222443855
Email: lethang12...@gmail.com
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers