Pico GrblHAL? #206
Replies: 18 comments 94 replies
-
id be down to help out where I can with this, but i probably dont know enough about grblHAL (only familar with plain old grbl) to do this on my own. just ordered a few of those pico pi's though. should get here in the next few weeks. |
Beta Was this translation helpful? Give feedback.
-
Hmmm, an interesting thing about PicoPi, the Flash is in an off chip QSPI device and can be treated as a USB drive. It looks like the program actually runs out of RAM like the Teensy 4.x's iMXRT1062. Since there is more Flash (2 MB) than RAM (264KB), flash can be used for additional thing. But, I love the idea of being able to just drop a new version of grblHAL on a drive to update the system. |
Beta Was this translation helpful? Give feedback.
-
A quick and dirty pin assignment to see what is possible and get people thinking. The Pico (and RP2040) is pretty pin limited. This assignment doesn't take into account any pin restrictions, I just wanted to see how many pins we could use and determine any tradeoffs that might need to be made. Several questions spring up.
This is pretty much the bare minimum for a CNC controller. Now, if we could use an IO expander, that would open up a lot of possibilities by freeing up gpio pins: UART channel, SPI interface (TMC stepsticks). Worth considering. We could probably put step enable and direction pins on an expander which would liberate a lot of gpios. Spindle enable and direction, similarly. I know there are some complexities to that so it may not be a good idea. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
A driver to start with is now available in the test branch. I have attemted to code serial over UART but I do not yet have a board to test with so a small miracle if it actually works. driver.c has been copied over from the STM32F4xx driver and a lot of code has been removed or commented out. It compiles - on my RPI4. Should we set up a task list for who does what? |
Beta Was this translation helpful? Give feedback.
-
@terjeio apologies for being silent here.....i just received some picos in the mail on Friday last week and was still just getting up and running with them over the weekend. ill chime in again once I feel comfortable with just working with them & grblHAL as well. |
Beta Was this translation helpful? Give feedback.
-
I have tested the serial and made modification to it to make it work. I can now connect with LaserGRBL throught the UART. I haven't looked into the USB. I will now start working on the Step timer and step pulse, I have already made the PIO code and need to try it when I have a bit of time. Should I create a pull request ? |
Beta Was this translation helpful? Give feedback.
-
I'd like to start laying out a breakout board but it looks like we are already close to being out of pins based on generic_map.h. Including StepA, there is 1 pin left and we haven't yet allocated SPI for TMCs or I2C. I think an I2C expander is the only way to make this work. Move limits and inputs to the expander? Frees up 8 but loses 3 to the expander so we would net up 5 more pins for a total of 6. SPI will cost 3 (maybe 4). UART takes the other 2? With a 16 GPIO expander, we could free up 9 inputs/limits. not sure it is necessary. For what it's worth, JLCPCB (the proto house I frequently use) has quite a few 8 GPIO I2C expanders - listed here. Note that they have a lot more listed but at 0 stock levels and I would never spec in a chip that they don't keep stocked. There is still a risk that chips they show having stock today may not get reordered. I bias toward the higher inventory ones. To get a datasheet, copy the LCSC C-number, go to lcsc.com and search with that number. [Edit: I realized I didn't mention something important. I will get a set of boards made with all (or most) of the SMD parts on it and will give one to each contributor for the cost of postage. I reserve the right to define "contributor" but basically, if you add code, you fit the category.] For what it's worth, the TCA6408APWR looks like a good choice - lots of stock, 5V tolerant inputs, voltage translation. Only big limitation I saw from a brief read of the DS is 400 kHz only. It's a TSSOP package so soldering by hand can be challenging to some. I would also want to see if there are other expanders that are pin compatible to allow alternate choice without a board redesign.
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil, I'd strongly suggest you look at and use SPI IO expanders instead of i2c, as the latter is susceptible lockups due to EMI noise. Not a good thing for CNC and industrial control. Cheers, Peter |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay, I was busy on other things going on. I was experiencing intermittent lockups of the i2C bus that I narrowed down to EMI from a spindle motor. I could have eliminated the effects of the EMI, but it highlighted an issue with i2C. If one of the i2c slave devices gets into an incorrect state, it gets difficult to reset the device without cycling its power. The advantage of the SPI bus is that the slave select line resets the devices comms. For this application, I'm not sure that the speed advantage of the SPI bus is not a consideration. Cheers, Peter |
Beta Was this translation helpful? Give feedback.
-
I have started looking at limits pins init and debounce and noticed that the control input (except safety door) are not debounced, would it be interesting to also debounce those ? |
Beta Was this translation helpful? Give feedback.
-
unless you need to count how many times you push a button I don't much point in debouncing |
Beta Was this translation helpful? Give feedback.
-
Sparkfun Thing Plus RP2040 - They claim 30 GPIOs which may be enough to avoid an I/O extender. Though I think supporting I/O extenders in grblHAL is a good idea in general. The Thing Plus (who names these? terrible name) lists for $18 USD but is back ordered. [editorial - I'd use a Teensy 4.0 before that]. There is very little on how they get to 30 GPIOs - there are only about 20 I/O pins around the edge of the board. There is a 2x6 1.27mm header that must be the source of the additional I/Os. No info on that at all. |
Beta Was this translation helpful? Give feedback.
-
Performance of the Pico. As expected, the Cortex M0 chip is at a disadvantage to the M4 (and M7) chips. The video linked below discusses this in the context of the Arduino IDE/Compiler but the results should be similar for any IDE/Compiler. Fast forward to 2:20 if you don't care about Arduino. Results at about 3:00 and shown here. Note that these tests do not reflect any benefit of PIO which may be significant in some cases but certainly not when it comes to floating point performance. Double FP does not matter here, I believe. The net result is the Pico performs above an STM32F10x, below an STM32F4xx, well below an ESP32 and WAY below the iMXRT10602 (Teensy 4.x). |
Beta Was this translation helpful? Give feedback.
-
I want to draw a CNC Control board for RP2040 but i guess the software is still not usable. Are you going to use an additional component to duplicate the pin? When do you plan to prepare the map file for PCB drawing? Thank you |
Beta Was this translation helpful? Give feedback.
-
Hi guys. I am really excited about this project. Would it be possible to use it on the Arduino Nano RP2040 Connect? |
Beta Was this translation helpful? Give feedback.
-
Cool! I am currently using GRBL on a nano and just want the benefits of a faster chip. I wont use the BL or Network anyway 🙂 Is it possible to compile with Arduino software or do you recommend VS? |
Beta Was this translation helpful? Give feedback.
-
Hi! Sorry for the late reply. I believe the rp2040 pico is advertised as a
Arduino Nano swap, but I am way too noob to know it for sure. The board is
a Eleksmaker 3.2 and the only schematic is this picture. I dont know
anythimf about PIO, so this might be too hard for me. I cant den get it to
compile with Studio. The Arduino RP2040 with the pico chip is meant to be
compiled in Arduino IDE with libreries. Do you know of there is any board
working with GRBLhal is a Arduino Nano swap compatible? Otherwise I guess I
am a bit stuck.
man. 20. sep. 2021 18.37 skrev Terje Io ***@***.***>:
… Do you have a (link to) schematic of the Eleksmaker board? There could be
a problem with voltage levels. The Nano is a 5V device, the Pico is 3.3V.
If 3.3V compatible it should be fairly trivial to add PIO code support as
the PIO program used for direct to pin output is quite small and it is,
AFAICT, possible to start more than one instance of it with different pin
configurations.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#206 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVUP4NFS7KBCELMCSW2E2NTUC5PMRANCNFSM4WNMF62A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Raspberry Foundation microcontroller - Raspberry Pico. The board costs $4. Crazy stupid cheap. It is a bit like a fast SAMD21 with lots of memory.
Anyone want to take a whack at a port? I will be happy to design a breakout board for it but am not able to do a port.
For what it's worth, I think this is just the first in a line of microcontrollers from the PI Guys. I'd expect a wifi version soon and probably an M3 or M4 one. Maybe even a RISC V version.
Beta Was this translation helpful? Give feedback.
All reactions