Re: [Emc-users] Another Mesa vhdl question (uart/pktuart)

2021-01-29 Thread Ralph Stirling
I've been looking at that today, but it does not use the send function.  I'd 
like to get a simple loopback test going.  I have a comp that sets up the pins 
and functions, but I don't see any data arrive in the rx bytes when I set data 
in tge tx bytes and set tx-count.  I guess it's been a decade since you wrote 
that driver.

Thanks again.
-- Ralph


On Jan 29, 2021 3:46 PM, andy pugh  wrote:
CAUTION: This email originated from outside the Walla Walla University email 
system.


On Fri, 29 Jan 2021 at 01:24, Ralph Stirling
 wrote:
>
>  Is there an example comp file illustrating
> its use, like mesa_uart.comp?

Have a look at:

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FLinuxCNC%2Flinuxcnc%2Fblob%2Fmaster%2Fsrc%2Fhal%2Fcomponents%2Fmesa_pktgyro_test.compdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7Cf74374093f3c4403433b08d8c4b0138b%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637475607819195609%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=BXyuLrW3ofdDRqMdaUIZTUYhIgNOpvdx5ivO4YKD0TY%3Dreserved=0

--
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-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7Cf74374093f3c4403433b08d8c4b0138b%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637475607819195609%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=pzSMKQuwt4DqehjaFNmVs%2F%2B%2BfzKZcROu0XdW9Y1mJ4o%3Dreserved=0

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


Re: [Emc-users] Another Mesa vhdl question (uart/pktuart)

2021-01-29 Thread andy pugh
On Fri, 29 Jan 2021 at 01:24, Ralph Stirling
 wrote:
>
>  Is there an example comp file illustrating
> its use, like mesa_uart.comp?

Have a look at:

https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/mesa_pktgyro_test.comp

-- 
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-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Another Mesa vhdl question (uart/pktuart)

2021-01-28 Thread Ralph Stirling
So I'm still looking at the hostmot2 uart/pktuart modules
for simple interfacing of microcontrollers for things like
A/D conversion, and have the vhdl end figured out.

The hostmot2 end is going to take some more work,
apparently.  The pktuart module is not a drop-in replacement
for the uart.  Is there an example comp file illustrating
its use, like mesa_uart.comp?  I can keep mucking around
to figure out the extra parameters, but a working example
would be a time saver.

>From hostmot2.h:

int hm2_uart_setup(char *name, int bitrate, rtapi_s32 tx_mode, rtapi_s32 
rx_mode);
int hm2_uart_send(char *name, unsigned char data[], int count);
int hm2_uart_read(char *name, unsigned char data[]);


int hm2_pktuart_setup(char *name, int bitrate, rtapi_s32 tx_mode, rtapi_s32 
rx_mode, int txclear, int rxclear);
int hm2_pktuart_send(char *name,  unsigned char data[], rtapi_u8 *num_frames, 
rtapi_u16 frame_sizes[]);
int hm2_pktuart_read(char *name, unsigned char data[],  rtapi_u8 *num_frames, 
rtapi_u16 *max_frame_length, rtapi_u16 frame_sizes[]);

Thanks again,
-- Ralph

From: Peter C. Wallace [p...@mesanet.com]
Sent: Monday, January 18, 2021 9:25 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Another Mesa vhdl question

...

The UART requires the alternate instance stride (stride 1) set to 0x10
This is done in the top level file (its a awful kludge and means some
typs of modules cannot be combined)

I would suggest using the PKTUART instead as the PKTUART
uses standard instance strides (0= 0x04,1=0x40)

Peter Wallace
Mesa Electronics

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7Ce3dee653e6b747bbf21208d8bbd61b92%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637465875556492398%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=EG2Z3ffyvGv4YYkJBBqtcEmaW2FqztqFe3lHJpwqaBY%3Dreserved=0


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-23 Thread Chris Albertson
On Fri, Jan 22, 2021 at 1:42 PM Ralph Stirling <
ralph.stirl...@wallawalla.edu> wrote:

> I don't think you are going to use an ADS1256 for
> servo feedback.  30khz sounds good, but when you
> look at the datasheet fine print, there are caveats.
> First, the inputs are multiplexed, so cycling the
> multiplexer drops your 30khz data rate to an effective
> 4.3khz rate.  There is also a 0.2msec settling time
> for the digital filter (which would be per channel).
> I'm not sure how much it affects CNC control, but
> I know in robotics applications non-simultaneous
> sampling causes problems.  The sequential multiplexing
> causes each axis to be sampled at a different time.
>

With robots, the way this is fixed is that the ROS "TF" or geometry
transform messages are timestamped.   Then the TF package can interpolate
the transform for any desired time.  So if say you have an arm with 6
joints and each sensor is sampled at different rates it still works.   THis
works because the parts have mass and can't teleport instantly to random
places.  so you can compute the position of the "fingers" even if all the
joints are sampled at random times.   The TF package hides all this

Basically if you know the transfom at any two points in time then you can
estimate the transform at any point in time near those two measured
points.  And again, this is all hidden inside the infrastructure.

I say "transform" because in general even though mostly we use rotation
(angle) only it might be any kind of linear transform.   Yes it is a lot of
real-time math but 16-core Xeon computers are cheap now.

>
> A precision single-turn pot for a linear axis sounds
> like a problem for other reasons.  You would have a
> giant discontinuity every revolution.
>
> Anyway, this ADS1256 on these Chinese cards does
> look very interesting for other, non-realtime applications.
>
> -- Ralph
>
> 
> From: Gene Heskett [ghesk...@shentel.net]
> Sent: Friday, January 22, 2021 12:45 PM
> To: emc-users@lists.sourceforge.net
> Subject: Re: [Emc-users] Another Mesa vhdl question (STMBL summary with
> added pico-pi?)
>
> On Friday 22 January 2021 14:37:56 andy pugh wrote:
>
> > On Fri, 22 Jan 2021 at 18:41, Gene Heskett 
> wrote:
> > > What comparison can be made between the very limited, fixed scale
> > > A-D conversion of a mesa card's 1st 4 inputs on say a 7i76, and the
> > > A/D speed and scaling that $4 pico-pi might be able to do when
> > > running the STMBL code, and how fast could it do it?
> >
> > If you want lots of high resolution A to D, have a look for ADS1256
> > boards on eBay.
>
> That's a sweet price for that much precision, and 30ksps sounds like its
> plenty fast enough to run a servo feedback from precision pots. Good
> thing about the precision being 24 bits, as the max of 3 volts full
> scale says it will need scaled at the inputs to live with 5 volt or
> higher circuits. With an SPI interface, working that out to cohabit with
> a 7i90 looks to be an interesting project. And I just ordered a 4
> channel digital scope so I can see this stuff better. A 2GS input gets
> pricey though.
>
> Thanks Andy.
>
> 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)
> If we desire respect for the law, we must first make the law respectable.
>  - Louis D. Brandeis
> Genes Web page <
> https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgeneslinuxbox.net%3A6309%2Fgenedata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C7b16a513d0b74475828608d8bf16aa15%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637469451362247427%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=DjcpC5qnBuyCYsgQU71FG8kTK7DNym23XrYlK277ItQ%3Dreserved=0
> >
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
>
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C7b16a513d0b74475828608d8bf16aa15%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637469451362247427%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=a20RBPKaM0pedhfPRU4R6WsbazAyJpUMdYABIiImbs8%3Dreserved=0
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>


-- 

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread Gene Heskett
On Friday 22 January 2021 16:12:00 andy pugh wrote:

> On Fri, 22 Jan 2021 at 20:47, Gene Heskett  
wrote:
> > thing about the precision being 24 bits, as the max of 3 volts full
> > scale says it will need scaled at the inputs to live with 5 volt or
> > higher circuits.
>
> The boards always seem to have lots of unpopulated pads. I assume that
> these are for voltage dividers, but haven't bothered to check as the
> project that I am using with them is 3.3V throughout.

$DayJob, or your stuff? Since I haven't had a $DayJob in going on 19 
years, I sometimes forget the difference.  My bad in that case.

What I see for us, is a need for a higher voltage, equally efficient 
version of the 7 dollar or less, BTS-7960 boards. Zero heat while 
running a 100watt, 24 volt motor from 24 volts, yet its only rated for 
27 volts max. Run it by a mesa pwmgen in mode 2, and it just works. 
Sweet.

But if the PID is tuned wrong, gets into windup and it overshoots, it 
will attempt to reverse the motor at speed, and that will crowbar a 400 
watt 24 volt switcher.  Shuts itself down for about 3 minutes to cool.

But since the BTS-7960 has a 43 Amp rating, It isn't bothered a bit, even 
by that.

Thanks Andy.

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)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread Ralph Stirling
I don't think you are going to use an ADS1256 for
servo feedback.  30khz sounds good, but when you
look at the datasheet fine print, there are caveats.
First, the inputs are multiplexed, so cycling the
multiplexer drops your 30khz data rate to an effective
4.3khz rate.  There is also a 0.2msec settling time
for the digital filter (which would be per channel).
I'm not sure how much it affects CNC control, but
I know in robotics applications non-simultaneous
sampling causes problems.  The sequential multiplexing
causes each axis to be sampled at a different time.

A precision single-turn pot for a linear axis sounds
like a problem for other reasons.  You would have a
giant discontinuity every revolution.

Anyway, this ADS1256 on these Chinese cards does
look very interesting for other, non-realtime applications.

-- Ralph


From: Gene Heskett [ghesk...@shentel.net]
Sent: Friday, January 22, 2021 12:45 PM
To: emc-users@lists.sourceforge.net
Subject: Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added 
pico-pi?)

On Friday 22 January 2021 14:37:56 andy pugh wrote:

> On Fri, 22 Jan 2021 at 18:41, Gene Heskett 
wrote:
> > What comparison can be made between the very limited, fixed scale
> > A-D conversion of a mesa card's 1st 4 inputs on say a 7i76, and the
> > A/D speed and scaling that $4 pico-pi might be able to do when
> > running the STMBL code, and how fast could it do it?
>
> If you want lots of high resolution A to D, have a look for ADS1256
> boards on eBay.

That's a sweet price for that much precision, and 30ksps sounds like its
plenty fast enough to run a servo feedback from precision pots. Good
thing about the precision being 24 bits, as the max of 3 volts full
scale says it will need scaled at the inputs to live with 5 volt or
higher circuits. With an SPI interface, working that out to cohabit with
a 7i90 looks to be an interesting project. And I just ordered a 4
channel digital scope so I can see this stuff better. A 2GS input gets
pricey though.

Thanks Andy.

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)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 
<https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgeneslinuxbox.net%3A6309%2Fgenedata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C7b16a513d0b74475828608d8bf16aa15%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637469451362247427%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=DjcpC5qnBuyCYsgQU71FG8kTK7DNym23XrYlK277ItQ%3Dreserved=0>


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C7b16a513d0b74475828608d8bf16aa15%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637469451362247427%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=a20RBPKaM0pedhfPRU4R6WsbazAyJpUMdYABIiImbs8%3Dreserved=0


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread andy pugh
On Fri, 22 Jan 2021 at 20:47, Gene Heskett  wrote:

> thing about the precision being 24 bits, as the max of 3 volts full
> scale says it will need scaled at the inputs to live with 5 volt or
> higher circuits.

The boards always seem to have lots of unpopulated pads. I assume that
these are for voltage dividers, but haven't bothered to check as the
project that I am using with them is 3.3V throughout.

-- 
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-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread Gene Heskett
On Friday 22 January 2021 14:37:56 andy pugh wrote:

> On Fri, 22 Jan 2021 at 18:41, Gene Heskett  
wrote:
> > What comparison can be made between the very limited, fixed scale
> > A-D conversion of a mesa card's 1st 4 inputs on say a 7i76, and the
> > A/D speed and scaling that $4 pico-pi might be able to do when
> > running the STMBL code, and how fast could it do it?
>
> If you want lots of high resolution A to D, have a look for ADS1256
> boards on eBay.

That's a sweet price for that much precision, and 30ksps sounds like its 
plenty fast enough to run a servo feedback from precision pots. Good 
thing about the precision being 24 bits, as the max of 3 volts full 
scale says it will need scaled at the inputs to live with 5 volt or 
higher circuits. With an SPI interface, working that out to cohabit with 
a 7i90 looks to be an interesting project. And I just ordered a 4 
channel digital scope so I can see this stuff better. A 2GS input gets 
pricey though.

Thanks Andy.

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)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread Gene Heskett
On Friday 22 January 2021 14:10:22 Ralph Stirling wrote:

> I really don't know yet how much work it would be to
> port STMBL to the Pico.  A stock STMBL drive, with
> an STM32F405VG processor has four analog inputs
> (as far as I can tell).  Those are 12bit, and can be scaled
> in stmbl's local hal.  I haven't investigated the sampling
> rate for those conversions.  The STM32F4xx processors
> have a lot more analog inputs available, but teasing out
> which ones don't conflict with needed digital i/o, and how
> to route them inside the stmbl code is more than I've done.
> The Pico pinout seems to indicate only 3 analog inputs.

Thanks Ralph, but all my mills are 4 axis. And the pico is probably too 
slow for that to be used as servo feedback anyway.  So do carry on.  Its 
an interesting discussion for sure.

> -- Ralph
> 
> From: Gene Heskett [ghesk...@shentel.net]
> Sent: Friday, January 22, 2021 10:38 AM
> To: emc-users@lists.sourceforge.net
> Subject: Re: [Emc-users] Another Mesa vhdl question (STMBL summary
> with added pico-pi?)
>
>
> What comparison can be made between the very limited, fixed scale A-D
> conversion of a mesa card's 1st 4 inputs on say a 7i76, and the A/D
> speed and scaling that $4 pico-pi might be able to do when running the
> STMBL code, and how fast could it do it?
>
> Having those figures at hand would determine just how usefull the
> pico-pi might be.
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread andy pugh
On Fri, 22 Jan 2021 at 18:41, Gene Heskett  wrote:

> What comparison can be made between the very limited, fixed scale A-D
> conversion of a mesa card's 1st 4 inputs on say a 7i76, and the A/D
> speed and scaling that $4 pico-pi might be able to do when running the
> STMBL code, and how fast could it do it?

If you want lots of high resolution A to D, have a look for ADS1256
boards on eBay.

-- 
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-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread Ralph Stirling
I really don't know yet how much work it would be to
port STMBL to the Pico.  A stock STMBL drive, with
an STM32F405VG processor has four analog inputs
(as far as I can tell).  Those are 12bit, and can be scaled
in stmbl's local hal.  I haven't investigated the sampling
rate for those conversions.  The STM32F4xx processors
have a lot more analog inputs available, but teasing out
which ones don't conflict with needed digital i/o, and how
to route them inside the stmbl code is more than I've done.
The Pico pinout seems to indicate only 3 analog inputs.

-- Ralph

From: Gene Heskett [ghesk...@shentel.net]
Sent: Friday, January 22, 2021 10:38 AM
To: emc-users@lists.sourceforge.net
Subject: Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added 
pico-pi?)


What comparison can be made between the very limited, fixed scale A-D
conversion of a mesa card's 1st 4 inputs on say a 7i76, and the A/D
speed and scaling that $4 pico-pi might be able to do when running the
STMBL code, and how fast could it do it?

Having those figures at hand would determine just how usefull the pico-pi
might be.


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary with added pico-pi?)

2021-01-22 Thread Gene Heskett
On Friday 22 January 2021 12:24:14 Ralph Stirling wrote:

> I finally succeeded in getting the STMBL code on a STM32F407
> Discovery eval board talking to a Mesa 7I90 via sserial.  The
> final issue was assuming the wrong pin for sserial tx on the F407.
>
> Here is my final summary of everything necessary to replicate
> what I did, for anybody else trying this.
>
> Steps on F407 end:
> 1. Compile STMBL code following their docs.
> 2. Plug in F407 Discovery st-link usb cable.
> 3. Copy obj_boot/blboot.bin to the F407 st-link drive
> 4. Plug in F407 Discovery otg usb cable (micro-b)
> 5. Run "make all_btburn", which should give flashing progress
> 6. Connect F407 ground to 7I90 ground
> 7. Connect F407 PA0 pin to sserial rx pin on 7I90
> 8. Connect F407 PA10 pin to sserial tx pin on 7I90
> 9. Run STMBL servoterm and connect
> 10. Edit config to have these lines:
>load sserial
>sserial0.rt_prio = 2.0
>sserial0.frt_prio = 2.0
> 11. Save config and type "reset"
> 12. On linuxcnc computer, run "halcmd -I"
> 13. Type:
> loadrt hostmot2
> loadrt hm2_x config=" sserial_port_0=0XXX"
>
> I believe this will work with a variety of STM32F4xx chips and
> boards.  It looks like the stock stmbl code is about 303K in size,
> so a 512K flash cpu is probably the minimum.  The stats given
> by servoterm seem to indicate that cpu usage is low, though,
> so a slower clock may be OK.  I wonder if it would run on the
> new RPi Pico with modest modifications?

What comparison can be made between the very limited, fixed scale A-D 
conversion of a mesa card's 1st 4 inputs on say a 7i76, and the A/D 
speed and scaling that $4 pico-pi might be able to do when running the 
STMBL code, and how fast could it do it?

Having those figures at hand would determine just how usefull the pico-pi 
might be. 

> Thanks for the help and suggestions from Andy and Peter.
> -- Ralph
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Another Mesa vhdl question (STMBL summary)

2021-01-22 Thread Ralph Stirling
I finally succeeded in getting the STMBL code on a STM32F407
Discovery eval board talking to a Mesa 7I90 via sserial.  The
final issue was assuming the wrong pin for sserial tx on the F407.

Here is my final summary of everything necessary to replicate
what I did, for anybody else trying this.

Steps on F407 end:
1. Compile STMBL code following their docs.
2. Plug in F407 Discovery st-link usb cable.
3. Copy obj_boot/blboot.bin to the F407 st-link drive
4. Plug in F407 Discovery otg usb cable (micro-b)
5. Run "make all_btburn", which should give flashing progress
6. Connect F407 ground to 7I90 ground
7. Connect F407 PA0 pin to sserial rx pin on 7I90
8. Connect F407 PA10 pin to sserial tx pin on 7I90
9. Run STMBL servoterm and connect
10. Edit config to have these lines:
   load sserial
   sserial0.rt_prio = 2.0
   sserial0.frt_prio = 2.0
11. Save config and type "reset"
12. On linuxcnc computer, run "halcmd -I"
13. Type:
loadrt hostmot2
loadrt hm2_x config=" sserial_port_0=0XXX"

I believe this will work with a variety of STM32F4xx chips and
boards.  It looks like the stock stmbl code is about 303K in size,
so a 512K flash cpu is probably the minimum.  The stats given
by servoterm seem to indicate that cpu usage is low, though,
so a slower clock may be OK.  I wonder if it would run on the
new RPi Pico with modest modifications?

Thanks for the help and suggestions from Andy and Peter.
-- Ralph

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


Re: [Emc-users] Another Mesa vhdl question

2021-01-20 Thread Peter C. Wallace

On Wed, 20 Jan 2021, Ralph Stirling wrote:


Date: Wed, 20 Jan 2021 22:27:34 +
From: Ralph Stirling 
Reply-To: "Enhanced Machine Controller (EMC)"

To: "Enhanced Machine Controller (EMC)" 
Subject: Re: [Emc-users] Another Mesa vhdl question

I've tried it both ways, and while the pulse train
moves to the other trace, I get no more response.

-- Ralph


Well its  neccesary  for FPGA TX --> uC RX  and  uC TX --> FPGA RX
but clearly not sufficient. Are you sure the uC baud rate is correct?





From: Peter C. Wallace [p...@mesanet.com]
Sent: Wednesday, January 20, 2021 2:15 PM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Another Mesa vhdl question

Looks like you have RX connected to RX and TX to TX
you need RX to TX and TX to RX


Peter Wallace
Mesa Electronics


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C0e7d00f65ecf41153a6008d8bd90fffa%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C63746766597506%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=D%2FZGjx23N2UME8DmtbJiSfE1D%2F%2FL7ejXyuici0XXkPs%3Dreserved=0


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



Peter Wallace
Mesa Electronics

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.



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


Re: [Emc-users] Another Mesa vhdl question

2021-01-20 Thread Ralph Stirling
I've tried it both ways, and while the pulse train
moves to the other trace, I get no more response.

-- Ralph

From: Peter C. Wallace [p...@mesanet.com]
Sent: Wednesday, January 20, 2021 2:15 PM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Another Mesa vhdl question

Looks like you have RX connected to RX and TX to TX
you need RX to TX and TX to RX


Peter Wallace
Mesa Electronics


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C0e7d00f65ecf41153a6008d8bd90fffa%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C63746766597506%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=D%2FZGjx23N2UME8DmtbJiSfE1D%2F%2FL7ejXyuici0XXkPs%3Dreserved=0


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


Re: [Emc-users] Another Mesa vhdl question

2021-01-20 Thread Peter C. Wallace

On Wed, 20 Jan 2021, Ralph Stirling wrote:


Date: Wed, 20 Jan 2021 22:06:45 +
From: Ralph Stirling 
Reply-To: "Enhanced Machine Controller (EMC)"

To: "Enhanced Machine Controller (EMC)" 
Subject: Re: [Emc-users] Another Mesa vhdl question

I've got the STMBL code flashed on an STM32F407G Discovery
eval board, and running with the Servoterm control software
(which I am very delighted to have achieved).

I seem to be missing something in setting up sserial in Linuxcnc
though.  Axis loads without error, but shows only gpio for the
pins that are supposed to be sserial.  Here is what I've done:

1. Vhdl file has sserial module tag defined.

   (SSerialTag,x"00",  ClockLowTag,x"01",  
SSerialCommandAddr,SSerialNumRegs, x"10",  SSerialMPBitMask),

2. Vhdl file has sserial pins defined.

   IOPortTag & x"00" & SSerialTag & SSerialRX0Pin,  -- I/O 48
   IOPortTag & x"00" & SSerialTag & SSerialTX0Pin,  -- I/O 49
   IOPortTag & x"00" & SSerialTag & SSerialTXEn0Pin,-- I/O 50

3. HAL file has config including sserial_port_0 defined.  Linuxcnc version is 
2.8.1
  running on Raspberry Pi 3b+ buster.

  loadrt hostmot2 debug_idrom=1
  loadrt hm2_rpspi config="num_encoders=2 num_pwmgens=2 num_stepgens=4 
sserial_port_0=0XXX" spiclk_rate=12500

4. The STMBL sserial rx pin (PA10) is connected to the 7i90 pin P3-01 and 
sserial tx pin (PA8) is connected to 7i90 P3-03.

5. When I run linuxcnc, those pins show up as gpio.

  hm2/hm2_7i90.0: Smart Serial Firmware Version 43
  
  hm2/hm2_7i90.0: IO Pin 048 (P3-01): IOPort
  hm2/hm2_7i90.0: IO Pin 049 (P3-03): IOPort

6. A scope watching PA8/P3-03 and PA10/P3-01 shows
   a series of 10us active low pulses on PA8/P3-03.
   PA10/P3-01 has short glitches.  To minimize signal
   integrity issues, I stacked some connectors to join
   the STMBL board and the 7I90.  Signals were the
   same using 6" jumper wires though.

(see photos at 
https://gab.wallawalla.edu/~ralph.stirling/projects/linuxcnc/stmbl)

7. On the STMBL board, I have a config of:

load sserial
load adc

sserial0.pos_fb = adc0.cos0

I'm hoping there is just some simple step I'm missing.  I
don't know if the problem lies at the STMBL or 7I90 end.


Looks like you have RX connected to RX and TX to TX
you need RX to TX and TX to RX


Peter Wallace
Mesa Electronics


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


Re: [Emc-users] Another Mesa vhdl question

2021-01-20 Thread Ralph Stirling
I've got the STMBL code flashed on an STM32F407G Discovery
eval board, and running with the Servoterm control software
(which I am very delighted to have achieved).

I seem to be missing something in setting up sserial in Linuxcnc
though.  Axis loads without error, but shows only gpio for the
pins that are supposed to be sserial.  Here is what I've done:

1. Vhdl file has sserial module tag defined.

(SSerialTag,x"00",  ClockLowTag,x"01",  
SSerialCommandAddr,SSerialNumRegs, x"10",  SSerialMPBitMask),

2. Vhdl file has sserial pins defined.

IOPortTag & x"00" & SSerialTag & SSerialRX0Pin,  -- I/O 48
IOPortTag & x"00" & SSerialTag & SSerialTX0Pin,  -- I/O 49
IOPortTag & x"00" & SSerialTag & SSerialTXEn0Pin,-- I/O 50

3. HAL file has config including sserial_port_0 defined.  Linuxcnc version is 
2.8.1
   running on Raspberry Pi 3b+ buster.

   loadrt hostmot2 debug_idrom=1
   loadrt hm2_rpspi config="num_encoders=2 num_pwmgens=2 num_stepgens=4 
sserial_port_0=0XXX" spiclk_rate=12500

4. The STMBL sserial rx pin (PA10) is connected to the 7i90 pin P3-01 and 
sserial tx pin (PA8) is connected to 7i90 P3-03.

5. When I run linuxcnc, those pins show up as gpio.

   hm2/hm2_7i90.0: Smart Serial Firmware Version 43
   
   hm2/hm2_7i90.0: IO Pin 048 (P3-01): IOPort
   hm2/hm2_7i90.0: IO Pin 049 (P3-03): IOPort

6. A scope watching PA8/P3-03 and PA10/P3-01 shows
a series of 10us active low pulses on PA8/P3-03.
PA10/P3-01 has short glitches.  To minimize signal
integrity issues, I stacked some connectors to join
the STMBL board and the 7I90.  Signals were the
same using 6" jumper wires though.

 (see photos at 
https://gab.wallawalla.edu/~ralph.stirling/projects/linuxcnc/stmbl)

7. On the STMBL board, I have a config of:

 load sserial
 load adc

 sserial0.pos_fb = adc0.cos0

I'm hoping there is just some simple step I'm missing.  I
don't know if the problem lies at the STMBL or 7I90 end.

Thanks again.
-- Ralph

From: andy pugh [bodge...@gmail.com]
Sent: Monday, January 18, 2021 10:24 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Another Mesa vhdl question

CAUTION: This email originated from outside the Walla Walla University email 
system.


On Mon, 18 Jan 2021 at 16:42, Ralph Stirling
 wrote:
>
> The AD7740 v-to-f converters don't work as well
> as I'd like, and I'm thinking about just using a
> little microcontroller, like the STM32G031 to do
> my A/D conversion.

One option there might be to use the STMBL source, that converts the
STM32 into a smart-serial device, that could pass the voltage as an
all-digital number straight to HAL.
(STMBL does far more than that too, but you wouldn't need all of it)

--
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-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Another Mesa vhdl question

2021-01-18 Thread Ralph Stirling
I have started looking at STMBL, but it is way, way more
complicated than I need at present, and will take some
care to strip it down to the essentials.  I was looking at
the STM32G031 soic-8 $1.72 part, which would be as
minimalist as possible, for the present purpose.
Too many ways to solve a problem :-).

-- Ralph

From: andy pugh [bodge...@gmail.com]
Sent: Monday, January 18, 2021 10:24 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Another Mesa vhdl question

On Mon, 18 Jan 2021 at 16:42, Ralph Stirling
 wrote:
>
> The AD7740 v-to-f converters don't work as well
> as I'd like, and I'm thinking about just using a
> little microcontroller, like the STM32G031 to do
> my A/D conversion.

One option there might be to use the STMBL source, that converts the
STM32 into a smart-serial device, that could pass the voltage as an
all-digital number straight to HAL.
(STMBL does far more than that too, but you wouldn't need all of it)

--
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-users mailing list
Emc-users@lists.sourceforge.net
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Femc-usersdata=04%7C01%7Cralph.stirling%40wallawalla.edu%7C547b2bc89ca54ba7745808d8bbde71ad%7Cd958f048e43142779c8debfb75e7aa64%7C0%7C0%7C637465911357095541%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=iB80P%2FtA3M3oyAMk6R3T1oQoWGBTzQ4yEAOAvKwQHTA%3Dreserved=0


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


Re: [Emc-users] Another Mesa vhdl question

2021-01-18 Thread andy pugh
On Mon, 18 Jan 2021 at 16:42, Ralph Stirling
 wrote:
>
> The AD7740 v-to-f converters don't work as well
> as I'd like, and I'm thinking about just using a
> little microcontroller, like the STM32G031 to do
> my A/D conversion.

One option there might be to use the STMBL source, that converts the
STM32 into a smart-serial device, that could pass the voltage as an
all-digital number straight to HAL.
(STMBL does far more than that too, but you wouldn't need all of it)

--
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-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Another Mesa vhdl question

2021-01-18 Thread Peter C. Wallace

On Mon, 18 Jan 2021, Ralph Stirling wrote:


Date: Mon, 18 Jan 2021 16:40:29 +
From: Ralph Stirling 
Reply-To: "Enhanced Machine Controller (EMC)"

To: "emc-users@lists.sourceforge.net" 
Subject: [Emc-users] Another Mesa vhdl question

The AD7740 v-to-f converters don't work as well
as I'd like, and I'm thinking about just using a
little microcontroller, like the STM32G031 to do
my A/D conversion.  While I could generate a
pulse train with frequency or period proportional
to voltage, I got to looking at bit files that include
a UART.  For the tiny amounts of data I need to
send, the simple UART with 115kbaud rate should
work fine at normal servo thread periods.

So, I have tried both stock *UA* bitfiles and a custom
bitfile with UART incorporated, and I get errors about
InstanceStride not matching expectations with either.

Turning on debug_idrom, I see that InstanceStride is
either 0x04 or 0x40, but the expected value is 0x10.
It isn't clear to me whether I want to select Instance
Stride 0 or 1 in my vhdl, but neither would match the
expected value.

hm2/hm2_7i90.0: Instance Stride 0: 0x0004
hm2/hm2_7i90.0: Instance Stride 1: 0x0040
hm2/hm2_7i90.0: Register Stride 0: 0x0100
hm2/hm2_7i90.0: Register Stride 1: 0x0100
hm2/hm2_7i90.0: inconsistent Module Descriptor for UART Transmit Channel, not 
loading driver
hm2/hm2_7i90.0: Version = 0, expected 0
hm2/hm2_7i90.0: NumRegisters = 4, expected 4
hm2/hm2_7i90.0: InstanceStride = 0x0040, expected 0x0010
hm2/hm2_7i90.0: MultipleRegisters = 0x000F, expected 0x000F
hm2/hm2_7i90.0: inconsistent Module Descriptor!
hm2/hm2_7i90.0: failed to parse Module Descriptor 4

Am I doing something wrong, has a bug crept into the
code, or is this just untested territory?  If it is a bug, is
it in the vhdl or the hostmot2 code?

Thanks again,
-- Ralph

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



Note that you can improve V-F readout performance by setting the
encoders "hires-timestamp" pin true

The UART requires the alternate instance stride (stride 1) set to 0x10
This is done in the top level file (its a awful kludge and means some
typs of modules cannot be combined)

I would suggest using the PKTUART instead as the PKTUART
uses standard instance strides (0= 0x04,1=0x40)

Peter Wallace
Mesa Electronics

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.



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


[Emc-users] Another Mesa vhdl question

2021-01-18 Thread Ralph Stirling
The AD7740 v-to-f converters don't work as well
as I'd like, and I'm thinking about just using a
little microcontroller, like the STM32G031 to do
my A/D conversion.  While I could generate a
pulse train with frequency or period proportional
to voltage, I got to looking at bit files that include
a UART.  For the tiny amounts of data I need to
send, the simple UART with 115kbaud rate should
work fine at normal servo thread periods.

So, I have tried both stock *UA* bitfiles and a custom
bitfile with UART incorporated, and I get errors about
InstanceStride not matching expectations with either.

Turning on debug_idrom, I see that InstanceStride is
either 0x04 or 0x40, but the expected value is 0x10.
It isn't clear to me whether I want to select Instance
Stride 0 or 1 in my vhdl, but neither would match the
expected value.

hm2/hm2_7i90.0: Instance Stride 0: 0x0004
hm2/hm2_7i90.0: Instance Stride 1: 0x0040
hm2/hm2_7i90.0: Register Stride 0: 0x0100
hm2/hm2_7i90.0: Register Stride 1: 0x0100
hm2/hm2_7i90.0: inconsistent Module Descriptor for UART Transmit Channel, not 
loading driver
hm2/hm2_7i90.0: Version = 0, expected 0
hm2/hm2_7i90.0: NumRegisters = 4, expected 4
hm2/hm2_7i90.0: InstanceStride = 0x0040, expected 0x0010
hm2/hm2_7i90.0: MultipleRegisters = 0x000F, expected 0x000F
hm2/hm2_7i90.0: inconsistent Module Descriptor!
hm2/hm2_7i90.0: failed to parse Module Descriptor 4

Am I doing something wrong, has a bug crept into the
code, or is this just untested territory?  If it is a bug, is
it in the vhdl or the hostmot2 code?

Thanks again,
-- Ralph

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