Mesa 7i96s PWM outputs

More
14 Apr 2023 20:02 - 16 Apr 2023 07:34 #269028 by mwidlok
Hello,
I have a small entry-level lathe-mill with 3 steppers, 2 spindles, and 1 encoder (on lathe spindle). Both spindles are controlled by PWM signals and separate direction pin, while steppers use typical step + dir signals. Now I would like to control everything with Mesa 7i96s card, that seems to be just enough for this machine.

While steppers and encored are clear, I am not sure how to set up PWM outputs. Original firmware "7i96s_d" has 1 PWM module (according to mesaflash), but I can not find any info at which pins, most likely it is internally connected to analog output. There is also "7i96s_2pwmd" firmware, but I can find only one PWM signal in pin file (I red somewhere that it replaces stepegen 4). For me ideal option would be to replace 2 stepgens with PWMs (with direction), and keep all other I/Os as general purpose limit switches, buttons, etc.
Can it be done with current firmware (7i96s_d or 7i96s_2pwmd)? If yes, then where I can find info about pinouts?
If not, then the only option is to build custom firmware - am I right?

Thanks in advance,
Michael Widlok
 
Last edit: 16 Apr 2023 07:34 by mwidlok.

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

More
14 Apr 2023 21:37 - 14 Apr 2023 21:38 #269037 by besriworld
Replied by besriworld on topic Mesa 7i96s PWM outputs
You can see the pin configuration with this code :
sudo mesaflash --device 7i96s -- addr 10.10.10.10 --readhmid
Then upload the bit file with the two pwm outputs and read again. and you will find the new pins .
sudo mesaflash --device 7i96s --addr 10.10.10.10 --write name_of_the_bitfile
sudo mesaflash --device 7i96s --addr 10.10.10.10 --reload

If there is a problem I think I can help with the bit file
Last edit: 14 Apr 2023 21:38 by besriworld.
The following user(s) said Thank You: mwidlok

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

More
14 Apr 2023 23:47 #269043 by PCW
Replied by PCW on topic Mesa 7i96s PWM outputs
The 2pwmd config has 2 PWMGens but as you surmised, one is for the built in
analog output.

I can make a  3pwmd config if you like, but probably over the weekend.
 
The following user(s) said Thank You: mwidlok

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

More
15 Apr 2023 07:34 #269063 by mwidlok
Replied by mwidlok on topic Mesa 7i96s PWM outputs
Thank You for quick answers!
Bestworld, I've tried these commands and seems that as a novice in Mesa cards I missed a few details. First PWM never showed up, the second is on TB2-2,3, while TB2-3,4 are free, so I assume that these can be used as direction outputs.

PCW, If You can make the bitfile it's great - Thanks! However I have some experience with FPGAs or VHDL, and it would be nice if I could prepare the firmware myself. Is there any tutorial or video available? I've downloaded firmware and sources from Mesa, but their "readme" files are almost not existent. Also there is no info how to compile for example "_2pwmd" or any other bitfile from source.
Efinix provide good documentation for theirs software and T20 FPGAs, and I assume that this is the softwrare used to build Mesa firmwares (T20 development kit even has a video).

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

More
15 Apr 2023 08:04 - 15 Apr 2023 08:05 #269065 by besriworld
Replied by besriworld on topic Mesa 7i96s PWM outputs
I think the best lesson is this: lesson

Since I understood the idea of compiling bit files . 

I am attaching the file you need . 3pwm and 3 step/dir

 

File Attachment:

File Name: 7i96s_3pwmd.bit.txt
File Size:333 KB


If you want to learn to compile files yourself, you can try. (it's not difficult) If you have a problem I can try to help. :)
Attachments:
Last edit: 15 Apr 2023 08:05 by besriworld.

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

More
15 Apr 2023 09:42 #269082 by andypugh
Replied by andypugh on topic Mesa 7i96s PWM outputs
I think that you are probably sorted out now, but it is very unlikely that you will want to run both spindles at the same time on a lathe-mill.
So you could send the analogue conttol voltage to both spindles and only turn on the one that you want to operate.
(This assumes that the spindle drives support analogue voltage as well as PWM)

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

More
15 Apr 2023 13:47 #269103 by mwidlok
Replied by mwidlok on topic Mesa 7i96s PWM outputs
Machine is controlled from my own DIY driver board that expects 2 separate PWMs for both spindles, even if only one is used at any given time. To overcome this I will need to add some logic or relays, so I thought that reprogramming Mesa would be a better option. Anyway my driver was designed specially for "allwincnc" forum.linuxcnc.org/18-computer/39037-linuxcnc-orange-pi but I failed trying to install this project on modern armbian.

Bestworld, Yours file seems to be for a different board. 7i96s is build over Efinix Trion T20F256 FPGA, Yours file is for Xilinx FPGA - I think it is for 7i96 without 'S'. Now I'm watching the video, unfortunately I can not speak German :-(. I assume that Xilinx and Efinix software is similar, I will try follow the same process on Efinix.

 

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

More
15 Apr 2023 14:45 #269112 by besriworld
Replied by besriworld on topic Mesa 7i96s PWM outputs
oops my mistake. I looked at the descriptions... I didn't see that there is another processor.
I'll try to fix the file tonight.

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

More
15 Apr 2023 15:28 #269115 by mwidlok
Replied by mwidlok on topic Mesa 7i96s PWM outputs
I've just downloaded Efinix software and it successfully build the default bin file from Mesa sources, project "seveni96s.xml". The board programmed and booted OK, however this one does not have any encored modules according to mesaflash --readhimd. I assume that this, as well as number of PWMs needs to be configured in the source.

Bestworld, If You could provide me some info about firmware organization and setting modules/pinouts it would be great. I found a few examples (on this forum), but none is for 7i96s with Efinix FPGA. Thanks!!

 

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

More
15 Apr 2023 15:59 - 15 Apr 2023 16:16 #269118 by PCW
Replied by PCW on topic Mesa 7i96s PWM outputs
 

File Attachment:

File Name: 7i96s_3pwmd.zip
File Size:247 KB
Attachments:
Last edit: 15 Apr 2023 16:16 by PCW.
The following user(s) said Thank You: mwidlok

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

Time to create page: 0.081 seconds
Powered by Kunena Forum