Go Back   IceInSpace > Equipment > ATM and DIY Projects

Reply
 
Thread Tools Rate Thread
  #1  
Old 27-05-2020, 10:41 AM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Onstep STM32 blue pill and ESP32 SHC build

Hi All

I have 2 scopes (16" and 8" traveller), both DIY, and am currently building a 14" binoscope. None of my scopes are GoTo and I don't get as much use out of them as I would like as I'm a bit lazy to struggle to hunt for DSOs in my light polluted back yard. I was also spoiled for a few years with a Meade LX200 so miss the joy of just touring the sky effortlessly after just pushing a few buttons.

So as my winter project, I decided to build 2 Onstep STM32 blue pills with the smart hand controller (SHC).

After looking online at Jaycar to price parts, it was quickly apparent that using eBay / aliexpress was the only way forward for me as 1. not all parts are available at Jaycar and 2. just the ESP32 controller was $39.99 (vs around $10 inc postage) on Aliexpress. Price disparity varied on the little bits and with some parts up to 50x (yup!!) more expensive. However, it would require a bit of patience on the posting time. The locally source parts at $300-$400 (ex motors) was too much to justify so I bought off other online marketplaces.

By bulk buying off ebay and AliExpress (6 sets), it worked out at about $85 per set. WIN! However, there is the 6-12 week wait for parts.

To reduce the complexity of building I also ordered the PCB's for both the controller and SHC from easyEDA. This took less than a week to arrive as they only have DHL as a delivery option so I ordered 20 sets to spread postage and a number of people on the forum have expressed interest in my surplus.

I'll have a number of spares, and will sell these as a package kit to anyone interested (at cost plus postage only!) once I've done my first build and have a complete parts list. It is a time-consuming PITA drawing up the shopping list and then find/buy fiddly little parts but since I have to do it, hopefully it will save other duplicating effort. I've attached my list - it remains draft until I finish my build as it's likely missing some things. I will update it as I progress.

NOTE: There are 2 types of ESP32 controller (which I found out a bit late). It's well documented on the build instructions but I missed that (oops! ). In a panicked rush, I ordered a second batch of microcontrollers, but the first supplier was also kind enough to recall their original order and swap out the original controllers for the correct ones. They had a no-returns policy, so I have a few extras now .

Fast forward 2 months and the parts are now starting to dribble in so the build has commenced....Wish me luck!

Scott
Attached Thumbnails
Click for full-size image (PCBs.jpeg)
98.6 KB59 views
Click for full-size image (PCB (with bits).jpeg)
109.0 KB54 views
Click for full-size image (Detailed parts - main controller and SHC.JPG)
81.4 KB43 views
Click for full-size image (summarised parts.JPG)
49.3 KB38 views

Last edited by sfarndell; 05-06-2020 at 12:21 PM.
Reply With Quote
  #2  
Old 04-06-2020, 04:33 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
The postman arrived today with some packets of joy! Header pins and the joystick, so I added them to the pcbs. Was also able to plug in some of the other mini boards.
Attached Thumbnails
Click for full-size image (792F773B-82E7-4842-8749-4F091DD80115.jpg)
198.6 KB45 views
Click for full-size image (FE2D13D2-FF8F-40F0-91FF-A2AC9CEF1818.jpg)
194.3 KB46 views
Click for full-size image (E12A7C74-8487-45C5-AB1C-4981F9C7B4D8.jpg)
187.2 KB39 views
Reply With Quote
  #3  
Old 09-07-2020, 05:22 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
So...a few weeks on and not much has happened. Some more parts have dribbled in but it's a lesson in patience.

The ESP32 boards arrived though the wrong ones were posted! The board I received has the same pinout as the 'correct' version of the board though, but is about 2mm too wide and the wireless antenna sticks out a bit more than it should. Rather than send these back and wait a few months I'm going to crack on and see if this one works.

After 10 minutes of bending pins, the ESP32 board fits ok (see pics). I bent the side closer to the screen header pins - in retrospect, the side closest to the resistors is better as the female header pins for the screen interfere a bit. I only have the RJ connector and buttons to go before the SHC is 'complete' but I don't know if I can do much testing without them.

I flashed the ESP32 and it works!! Or at least, the screen comes on and it tries to connect to the Onstep main board. Guess I'll need to finish that off before testing the SHC further.
Attached Thumbnails
Click for full-size image (image0 (1).jpeg)
36.6 KB26 views
Click for full-size image (image1 (1).jpeg)
57.3 KB28 views
Click for full-size image (image2.jpeg)
25.7 KB19 views
Click for full-size image (image3.jpeg)
41.1 KB21 views

Last edited by sfarndell; 09-07-2020 at 07:06 PM.
Reply With Quote
  #4  
Old 20-07-2020, 07:47 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
It's alive!!!! More parts have come in and I was able to progress to the point that I could flash the STM32. What a mission!


In the end I used up all 5 STM boards I have just to get one to work. Arduino was not recognising the STM board through the CP2102 usb-serial connector. Boards were working with the blink sketch (factory loaded), but were not being switched to boot mode so I couldn't upload the firmware. Only 1 worked and I fried another board when I built a loose separate serial loader (in case it was my wiring on the PCB) and connected the 5V and GND to wrong terminals .

For other builders - note, you don't need the PCB to flash the STM32, just a CP2102 and a few cables! Do this early as it'll save you heaps of time if you have a dud board.

After hunting on the forums for hours, it seems that I just got a bad batch of controllers, so I've ordered a few more as the STM32's are relatively cheap.

If anyone here knows how to solve the issue below on a working board, let me know.
Failed to init device.
stm32flash 0.4
http://stm32flash.googlecode.com/
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1

I might try an ST-link to flash them, just in case.

Anyway, I also flashed the WeMos D1 and connected everything up on a board and viola: I could connect via wifi.

Next step is to build the cable to connect SHC and the Onstep controller and then add the motors. Just need to wait some more for the postman...
Reply With Quote
  #5  
Old 20-07-2020, 08:28 PM
DavidTrap's Avatar
DavidTrap (David)
Really just a beginner

DavidTrap is offline
 
Join Date: Jun 2009
Location: Brisbane
Posts: 2,957
Great to hear you're having success with this.

I have had difficult flashing the STM32 previously. Can't remember if it was a problem with the jumper/switch to change from Run to Flash mode or something else. I've only had to do it a couple of times when adjusting settings and those events have been weeks or months apart.

I was very happy with the operation of the controller. I used it to make an EQ3 mount into a goto mount as a trial run. I've got a big old mount that I want to convert to OnStep. I'll probably use one of the more advanced/powerful controllers for that mount - it will need bigger stepper motors and drivers.

I'm really enjoying the open source software and hardware options available for astronomy - I'm currently using:

- Onstep
- MyFocuserPro2
- Arduino based dew controllers
- NINA

I better start accumulating bits and pieces to make the next onstep controller - need a project for the summer astronomy hiatus.

DT
Reply With Quote
  #6  
Old 21-07-2020, 10:02 AM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Thanks David!

Nice setup! Have you got the SHC too?

I also considered the MaxESP build as it uses the same microcontroller as the SHC, but it's much more complicated and expensive to build. I started this build knowing nothing about electronics and when I was researching how to do things, found a lot more support for the STM32.

That being said, both these microprocessors are more than adequate to control a decent goto mount, plus both can handle an additional focuser too.

Does size of motor matter with the microcontroller? I've seen a few large dobs (25"+) which use Nema 17's. My main scope is a 16" dob and I've got also bought Nema 17's with a 51:1 planetary gear. Time will tell....
Reply With Quote
  #7  
Old 21-07-2020, 10:27 AM
DavidTrap's Avatar
DavidTrap (David)
Really just a beginner

DavidTrap is offline
 
Join Date: Jun 2009
Location: Brisbane
Posts: 2,957
Thanks Scott,

I have the SHC - bought a kit from Canada with all the circuit boards and parts to build a controller and the SHC.

You are probably right the the STM32 would be enough, but I thought I might try the more powerful microprocessor for interest sake.

The NEMA17 is probably enough for my purposes. I just need some time to go through specs and see what is available, then ask for some advice on the forums.

DT
Reply With Quote
  #8  
Old 07-08-2020, 01:29 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Almost done!

The momentary switches arrived today so I installed them and my handset is working despite the ESP32 development board being the wrong size (itís still the right chip and pin out). Iíve looked on eBay and AliExpress for the right width NodeMCU 32s ESP32 and they are rarer than hens teeth. Most of those listed as being the correct ones are incorrectly labelled and are also the incorrect pinouts so beware!!! Bending a few pins if one gets the more readily available development boards I have is easy enough. Theyíre also about half the price.

Assembly of the hand controller is straight forward. One thing I did have a little trouble making was the cable between controller and SHC. They are cross-over cables, not straight through. Itís easy enough to check by inspecting the location of the 5v power supply on controller and handset. I nearly got that wrong and there isnít much documentation I could find on making the cable. Iíve added a photo in case itís useful to anyone.

The Onstep controller is working as far as I can tell at this stage. I need to still connect the motors: the only pieces Iím waiting on are the RJ45 connector and molex connectors. Donít really need the latter as can wire directly from the steppers to the RJ45s so might hack something together over the weekend.

Only one controller board is functional. Iíve ordered more stm32s from a more reputable seller. Figured out the issues with the other boards were just that I got a bad batch of dodgy knockoffs which were not 128kb but 64kb. Reported the seller and got my money back, but itíll be a few more weeks before they arrive.
Attached Thumbnails
Click for full-size image (97C58061-4168-4A02-9682-E7BB736B707D.jpeg)
64.2 KB36 views
Click for full-size image (C34CEB49-71D6-4C41-AE75-03724A0F8FA9.jpeg)
62.9 KB26 views
Click for full-size image (0C2D874B-973A-450E-AD2F-D48BD4BE326A.jpeg)
85.7 KB32 views
Click for full-size image (A7E3B4CC-820E-46ED-B7AE-8C851F2972F0.jpeg)
42.3 KB24 views
Reply With Quote
  #9  
Old 09-08-2020, 11:26 AM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
I 3d printed some SHC handsets I found on thingiverse, as well as some buttons for the 5-way switches. Tried 2 different infills, which I think came out looking nice, although I do prefer the geometric infill (wavy lines) a bit more. Filament used is orange eSun glass PETG.

I tried connecting the motors, using estimated steps,etc but couldn’t get them to work. There is an error message popping up on the handset (Err!) which I can’t find any more documentation on so I’ll need to do a bit more investigating to resolve. This happens both with and without the motors connected so I’ll need to do some debugging. I have tested the handset fully using the SHC debugging program and with 2 different cables so the issue is most likely to be with the configuration or stepper wiring.
Attached Thumbnails
Click for full-size image (FCAAFC35-3B93-4B6D-AA9A-0E9F7630A1B1.jpeg)
59.3 KB19 views
Click for full-size image (F865CECE-D188-4EA3-9691-AA22C406BFCE.jpeg)
52.7 KB14 views
Click for full-size image (020A59CA-04D3-4447-BF5B-B0EE836EA21D.jpeg)
70.8 KB15 views
Click for full-size image (B31EE21D-E06A-496E-A243-E17355E5AD7D.jpeg)
69.5 KB11 views

Last edited by sfarndell; 09-08-2020 at 11:48 AM.
Reply With Quote
  #10  
Old 12-08-2020, 05:30 PM
miketheobscure's Avatar
miketheobscure (Mike Kreuzer)
...

miketheobscure is offline
 
Join Date: Aug 2005
Location: Canberra
Posts: 64
Have been following along for a while now - amazing stuff, congrats on all this so far.

I have some new nema 17 motors winging there way to me from China to replace the ancient motors on my eq6, & I'm vacillating between prebuilt Mega 2560s (instein), prebuilt MiniPCBv2s (stmbluepillkits), and doing the whole onstep thing myself to drive it. Don't know which way I'll fall on that.

What sort of a 3d printer do you need to make those sort of cases? Something nicely printed as a case/cover would be a lot nicer than whatever I can drill & scrape out of metal or plastic parts.
Reply With Quote
  #11  
Old 13-08-2020, 02:56 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Thanks Mike

I have an MKS gen L board which I'm using to make my 3d-printed CNC so can offer some comparison. The GEN L board is super easy. Basically you only need to wire power and the motors. There's a bit of extra work to connect the SHC, but it's not much. Downside is that it is only 8-bit so can't handle high microsteps on fast slewing. It's possibly you can replace this with the SKR board which is 32 bit (in 3d printing you can, but not sure it's supported for onstep yet).

The bluepill is a very easy build. Only challenge is in getting reliable chips. My first batch was bad, so I ordered more after a refund, but the 6-week wait from China is an irritation. My one board is working, but I need another stm32 board for the other. The motors are hardwired to the board for testing rather than being connected via the RJ45 connectors, which are still in transit. I'll wait to finish the board before posting. If you're interested in making a blue pill build, I have enough surplus for one or two kits.

Regarding the 3d printer - I have an anycubic i3 mega. It has a large base (210x210) but any 3d printer will do. The hand controller is not a big part.

Link on thingiverse to the handcontroller I have: https://www.thingiverse.com/thing:3534640
There is another nice version of the handcontroller which is still being developed - https://www.thingiverse.com/thing:4552376

Last edited by sfarndell; 14-08-2020 at 05:29 AM. Reason: wandered off-topic
Reply With Quote
  #12  
Old 13-08-2020, 03:21 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
I was a bit bored today and as I am still waiting for some parts to arrive, I soldered up one of the extra sets for the SHCís. Bending the wires for the ESP32 took the longest at about 10 minutes and the rest of the build was done in under an hour. On this point, looking at the onstep forum, its a common problem to get the version of ESP32 microcontroller I have, even if the correct versions are ordered. However they do work, it just requires a little extra effort.

A few tips on my process
1. Bend the pins first and do them one at a time, testing after each bend. The temptation is to do a few at a time. Donít. I rushed my second build and it took forever to get right. This time it was way faster overall!
2. Bend the pins on the side CLOSEST to the resistor pack. If you donít, the ESP32 gets in the way of the board mounting holes. As a side note, I soldered in the ESP32 first and that was ok and didnít impact the rest of the build.
3. Attach the resistors from the rear and lay them flat. Super easy to solder and this gives the processor the room it needs.
4. Solder the micro joystick BEFORE the other switches. The little points are fiddly,so you need a good join. Also, donít linger with the iron. On build 1 I did and it melted something inside so the joystick only works in 4 directions. Good thing I had 10 . If your resistors, capacitors and RJ 12 connector are in you can test the SHC with the onstep controller at this point.

Iíve attached a few pics of how it looks.

Happy building!
Attached Thumbnails
Click for full-size image (A6D9CFA9-93A7-4FCC-8604-30ED08022D13.jpeg)
85.0 KB23 views
Click for full-size image (7DD7E117-D479-43D6-98ED-E541D72405AA.jpeg)
64.1 KB19 views
Reply With Quote
  #13  
Old 13-08-2020, 06:19 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Reading my earlier post, I didnít respond with why my system wasnít working. I found the reason after some trawling of the OnStep help section:

My motors are Nema 17 with a 51:1 planetary reduction. They are 1.6A motors. The drivers are LV8729, which donít like the high current draw required by these motors. I slapped some A4988s in, updated the firmware and presto!

To work with these drivers, you need the 0.9A motors. Perhaps someone who knows more about these things can comment.
Reply With Quote
  #14  
Old 31-08-2020, 03:21 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
The new STM32 chips arrived today and I tried flashing them, but I still got a Ďfailed to unit errorí. After searching the onstep forums again, the issue has become a lot more pervasive but a solution was found earlier this month: the R3 resistor needs to be removed and bridged.

I tested on one of my older boards and it worked! I have now fixed all my Ďdudí boards.

Iíve now received all the parts and try finish the electronics this week.
Attached Thumbnails
Click for full-size image (A96DDA84-0E87-447B-82F0-F1AFEE283862.jpeg)
76.6 KB13 views
Reply With Quote
  #15  
Old 31-08-2020, 03:42 PM
bojan's Avatar
bojan
amateur

bojan is offline
 
Join Date: Jul 2006
Location: Mt Waverley, VIC
Posts: 6,305
Interesting... R3, 100kohm.
I programmed two of them in the past (last year) without problems.
Attached Files
File Type: pdf schematics.PDF (179.5 KB, 13 views)
Reply With Quote
  #16  
Old 31-08-2020, 03:54 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Yeah. That's the one. Some people have reported that replacing with a 10k ohm resistor also works. Current conjecture is that it's to do with the use of internal pull-up resistors and the 100k ohm resistor dropping power too much.

I'm not versed enough in this to really understand how it all works....thread is here https://onstep.groups.io/g/main/topic/75518845#24142

I still have to test if my modified boards works properly, but I'll post when I have tested.
Reply With Quote
  #17  
Old 31-08-2020, 05:28 PM
DavidTrap's Avatar
DavidTrap (David)
Really just a beginner

DavidTrap is offline
 
Join Date: Jun 2009
Location: Brisbane
Posts: 2,957
I moved my motors and controller from my EQ3 test bed to a Paramount GT1100s I came by a few years ago. The old controller was working, but the software is not playing nicely with newer programs.

The slew speed with the STM32 based controller is very slow - it can only prod the stepper drivers so fast. Nonetheless, the pointing was accurate and the guiding graph not too bad. I’ve ordered a MiniPCB V2 kit with a 400MHZ Teensy processor, some fancier stepper drivers, more powerful motors and some more hardware that put everything together. Total cost should be under $250.

DT
Reply With Quote
  #18  
Old 31-08-2020, 05:49 PM
bojan's Avatar
bojan
amateur

bojan is offline
 
Join Date: Jul 2006
Location: Mt Waverley, VIC
Posts: 6,305
Quote:
Originally Posted by DavidTrap View Post
The slew speed with the STM32 based controller is very slow ...
That is odd... In my experience it is VERY fast (5~10 deg /sec), especially with variable step mode.
Reply With Quote
  #19  
Old 31-08-2020, 07:22 PM
sfarndell (Scott)
Registered User

sfarndell is offline
 
Join Date: Nov 2007
Location: Melbourne, Australia
Posts: 34
Bojan’s speeds align with my understanding too. I’m expecting a minimum of 2-4 degrees per second slewing (without the variable step mode) based on my research on the Onstep forums. My Onstep Calculator results indicate it’s well within its capabilities too.

It might depend on how much gearing or the stepper drivers you have Dave. Can you share your steps per degree?

Last edited by sfarndell; 31-08-2020 at 11:18 PM.
Reply With Quote
  #20  
Old 31-08-2020, 08:05 PM
DavidTrap's Avatar
DavidTrap (David)
Really just a beginner

DavidTrap is offline
 
Join Date: Jun 2009
Location: Brisbane
Posts: 2,957
You got it - there is a 10:1 reduction before a 360 tooth worm wheel - gives 64000 steps per degree with 1/16 microstepping. If I run lower micro steps, it's not too bad, but with 1/16 micro stepping, it's 0.75 deg/sec with a max rate of just over 20 (the best an STM32 can manage).

I just looked at the spreadsheet again - whoops - I thought you had to aim for >61200 steps per degree.

I though I had setup the variable step mode for slewing, but I'm not 100% sure that's working correctly.

Anyway, I've ordered the faster controller - I'm not adverse to having a spare controller as it's a long way to my usual dark sky site if something fails...

DT
Reply With Quote
Reply

Bookmarks

Tags
goto, onstep, shc

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time is now 07:31 PM.

Powered by vBulletin Version 3.8.7 | Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Advertisement
Limpet Controller
Advertisement
Testar
Advertisement
NexDome Observatories
Advertisement
Bintel
Advertisement
Astronomy and Electronics Centre
Advertisement