Beginner: RPi Pico as a board

More
25 Nov 2023 04:17 #286437 by rthorntn
Hi,

I was recently told about RasPiPicoSDK_PicoDRO, the RPi Pico being used as the interface between some RS422 glass scales and TouchDRO (using USB between the Pico & Android).

I don't really want to use TouchDRO or a tablet, I'd rather use LCNC with MDRO and my TTL scales.

​​Can someone help a (perpetual) beginner out, if I was aiming to get a Pico interfaced to an LCNC PC for the MDRO use case, what would output from the Pico (some sort of count) and what interface would I use (USB)?

My thinking is, I don't want to waste an FPGA (when the Pico's PIO & DMA is all I need) for the MDRO use case, I also don't just want to buy an off-the-shelf DRO.

Thanks.
Richard

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

More
25 Nov 2023 05:52 #286439 by cornholio
The following user(s) said Thank You: rthorntn

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

More
25 Nov 2023 10:30 - 25 Nov 2023 10:35 #286445 by rthorntn
Reading a bit on Remora now.

So I have a few RP2040 here and it looks like SPI would be the way to have a RP2040 talk to LCNC running on a RPi4.

So perhaps it's adding TTL scale support and modifying the RasPiPicoSDK_PicoDRO code to talk SPI.

I don't know much about SPI but I assume that there's documentation on how a driver board should communicate with LCNC over SPI?

I'm guessing that there's documentation around how an encoders data should be encoded by the driver board ready for LCNC to use?

Basically I'm looking for a cheap (<$10 in parts) easy (I'm not a coder) way to get a Sino 5V TTL glass scale signal into an RPi running LCNC. 

The speed, complexity and massive I/O of an FPGA just feels like massive overkill for a DIY DRO.
Last edit: 25 Nov 2023 10:35 by rthorntn.

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

More
25 Nov 2023 11:47 #286447 by cornholio
Might be able to use linuxcnc.org/docs/devel/html/de/drivers/hal_gpio.html all you would need to to translate the 5v signal to 3.3, 74lvc245 would be a pretty easy way. Got a whole lot in the "useful bag" and a PCB that could be used.
The following user(s) said Thank You: rthorntn

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

More
25 Nov 2023 16:26 #286472 by jmelson
I think you could use a Beagle Bone Black with one of the capes for 3D printers, and the Machnekit package, whihc is an offshoot of LinuxCNC. It has fast microcontrollers that can read encoders.
Jon
The following user(s) said Thank You: rthorntn, tommylight

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

More
25 Nov 2023 19:30 #286489 by cornholio
Old mate is looking for a solution that’s under $10 in parts.

How’s MK going ? I haven’t looked at since before it was split. Actually to tell the truth since it was running with Wheezy. Used it for a bit to run my mill with the PRUs.
The following user(s) said Thank You: rthorntn

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

More
25 Nov 2023 19:54 #286492 by cakeslob


Basically I'm looking for a cheap (<$10 in parts) easy (I'm not a coder) way to get a Sino 5V TTL glass scale signal into an RPi running LCNC.  




Hey, the pico branch is missing the module for encoder at the moment. Ive been looking into adding the encoder, but have not started yet because I am also not a coder.

but if 5v + $10 + RPi is your parameters, I have what you are looking for, if you are down to clown.


Stm32F411 black pill + rpi proto board.

I havent tested to much hardware yet, but if you are interested I can make an encoder version for you to test out. Dont know how high a resolution it can handle. Working on some PCB;s for this but drawing PCBs is never as fun as I think it will be.

github.com/cakeslob/Remora/tree/blackpill

 


STM32F446 (or other F4xx boards) Nucleo boards. These might not be $10 but I got mine for $15 CAD.
This setup I am using with 1 highspeed high res encoder, and 3 lower speed encoders. I havent done a stress test to see how high the low speed encoders can be, or how it will translate to linear scales. I have a sino linear scale I can test out later.

github.com/cakeslob/Remora/tree/nucleo_static
Attachments:
The following user(s) said Thank You: rthorntn

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

More
25 Nov 2023 20:00 #286494 by cakeslob

Old mate is looking for a solution that’s under $10 in parts.

How’s MK going ? I haven’t looked at since before it was split. Actually to tell the truth since it was running with Wheezy. Used it for a bit to run my mill with the PRUs.


Last time I checked it was still so fucking hard do anything, and there was a bug in the os so I couldnt change my screen res to 800x480. I upgrade from weezy to stretch/buster a few years ago and its so damn hard. I usually look to pocketNC repo for MK stuff because they still use it on their machine.


Chole, I like your boards. I wanna copy them to make a generic breakout MCU dev boards
The following user(s) said Thank You: rthorntn

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

More
25 Nov 2023 22:29 - 25 Nov 2023 23:27 #286506 by rthorntn
Wow, a big thanks to all who replied here!

I'm attempting to process it all, so by my simple math my 5um scales will generate 200 pulses per mm, can hal_gpio on RPi4 support me moving my wee lathe handles as fast as I could without dropping pulses, from what I read it should do that no problem?

In saying this I was kinda wanting a digital RPM readout (and maybe it's phase 1 of an ELS) on the lathe (I have installed a 1024PPR encoder driven by the headstock spindle) which I think gives 4096PPR, so at 2000RPM that would be like 140K pulses per second...but this is definitely a future project (after I added a VFD/3PH) and if I was just using it for RPM (no ELS) then I would probably swap out the encoder for something simpler...

​​​​​​The priority is definately getting MDRO up on my lathe for the two TTL scales.

I did run MachineKit for a while, I do have a DE0 but that was all a bit too hard.

Blackpill look interesting, I don't think I have one of these boards though.  Same with BBB.

I also read the RPi5 has a half hidden PIO thats better than the RP2040s one.

In addition this looks interesting, maybe as an interface to use instead of SPI:
Pi SMI
Last edit: 25 Nov 2023 23:27 by rthorntn.

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

More
25 Nov 2023 22:48 #286509 by cakeslob
Well, if you decide to try any of the remora STM options, let me know. The my lathe is using an encoder with 16384 ppr to get spindle speed without issue, and 200 pulse/mm is definitely do-able with remora.


Also, your link doesnt work when I click it, which is odd, it looks the same url.
iosoft.blog/2020/07/16/raspberry-pi-smi/
The following user(s) said Thank You: rthorntn

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

Moderators: PCWjmelson
Time to create page: 0.133 seconds
Powered by Kunena Forum