Raspberry Pico based motor stage

Hi everyone, I designed motor stage hat for Raspberry based on Raspberry Pico instead of an arduino. I also ported sngaboard firmware so it works on pico.
It uses serial on GPIO header instead of an USB cable which makes everything smaller.
It needs a litle configuration, but works fine.

https://oshwlab.com/alte/openflexure-board_copy
I hope it will be usefull.

Thera are two things which needs to be done to say it’s compleated:

  • I dont have LED grid so it’s not tested.
  • LED is powered via PIN capable of PWM. It would be nice to have possibility to control brightness directly from app. To do this an extension is needed for the Openflexure app but unfortunatelly this beyond my programming skills so it will take some time. The other thing which needs to be done is to add a new function to the Pico firmware but that will be easy.
1 Like

That is great work @Pepa. I was not able to see the ported firmware in your link above, only the hardware design. Looking at the board design around the camera cable slot there is only ground plane on top and bottom layers. That means that it is possible to extend the slot to the edge of the board, which makes it a bit easier to fit and remove the board and cable.

Open slot is a great idea, I have updated the PCB according to your suggestion. I will add u2f file for Pico today.
I’am working on some changes in code:

  • PWM for motor control to lower motor current when motors don’t move. This will keep motors cooler without fear of losing position
  • LED PWM

Because of that source code is a little bit messy at this point. I will upload it when i’am done

1 Like

I have updated firmware for Pico so now LED PWM works. Somehow I figured out (with the help of existing extensions and documentation) how to make my own extension. So now I can control the LED directly from the Openflexure app. The only problem is that I don’t know why extension icon doesnt appear.
The last thing to do is to reduce the current of the motors at idle.

1 Like

Everything done, all files updated. Motors idle current can be reduced, value can be set by serial port and saved in EEPROM. Initial value is about 50% of working current. In my case motors are much cooler.

1 Like

Amazing work @Pepa! I recently made a new Sangaboard based on the RP2040 microcontroller with integrated illumination control. The new Sangaboard firmware supports the pico and has partial support implemented for LED control (on/off only, the plan is to PWM it at high frequency to avoid flickering), the source is at Files · sangaboard-v5 · Filip Ayazi / sangaboard-firmware · GitLab (the master branch also works on the pico), just adjust boards.h with your wiring.

PWM motor current control sounds awesome! Is the source for your firmware available somewhere?

1 Like

I have uploaded arduino sketch. Be aware that my sketch works only with arduino core from earlephilhower. I didn’t uploaded it before because I still need to clean it and do some changes. For this moment I just wanted to chceck if everything works fine.
In my case PWMs are set to 50kHz so there is no flickering.

1 Like

I’ve tried to download files from the web site, but it isn’t possible! One gets into a circular loop with being told you have to login to download, logging in, then being told again that you have to log in. Are the files really available for download?

Yes files are available for download. I tried downloading them and everything worked fine.

Well, I tried again, using both Firefox and Chrome, with the same result. Oh well.

The site does seem to require login for downloading the files. If you were able to post the files somewhere without a login it would be of wider availability to the community, or is there a setting you can make in OSHWlab to not need login for the files? You should be able to post the files here, unless it hits a file size limit or put them into an issue or merge request in the OpenFlexure / openflexure-microscope-extra section of the project on Gitlab.