Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tips on building from mac #3

Open
a7u7a opened this issue Jun 28, 2018 · 16 comments
Open

Tips on building from mac #3

a7u7a opened this issue Jun 28, 2018 · 16 comments

Comments

@a7u7a
Copy link

a7u7a commented Jun 28, 2018

On mac, both $ swift build and building from xcode fail.
On xcode I am using swift 4.1.2 toolchain

Error from $ swift build:

pcb2photon/Package.swift:13:5: error: argument 'targets' must precede argument 'dependencies'
    targets: [
    ^
Can't parse Package.swift manifest file because it contains invalid format. Fix Package.swift file format and try again.
error: invalid manifest format

and error from xcode:

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    cd /Users/user/Documents/pcb2photon
    export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
    export TOOLCHAINS=org.swift.41220180531a
    /Library/Developer/Toolchains/swift-4.1.2-RELEASE.xctoolchain/usr/bin/swiftc -incremental -module-name SGLImage -Onone -DSWIFT_PACKAGE -DXcode -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -target x86_64-apple-macosx10.10 -g -module-cache-path /Users/user/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -enable-testing -I /Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Products/Debug -F /Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Products/Debug -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -c -j8 /Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/Image.swift /Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImageBMP.swift /Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImageGIF.swift /Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImageLoader.swift /Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImagePNG.swift /Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/Inflate.swift -output-file-map /Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Intermediates/pcb2photon.build/Debug/SGLImage.build/Objects-normal/x86_64/SGLImage-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Intermediates/pcb2photon.build/Debug/SGLImage.build/Objects-normal/x86_64/SGLImage.swiftmodule -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Intermediates/pcb2photon.build/Debug/SGLImage.build/swift-overrides.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Products/Debug/include -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Intermediates/pcb2photon.build/Debug/SGLImage.build/DerivedSources/x86_64 -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Intermediates/pcb2photon.build/Debug/SGLImage.build/DerivedSources -emit-objc-header -emit-objc-header-path /Users/user/Library/Developer/Xcode/DerivedData/pcb2photon-hcfysdbhqryaiofxfesvanakfsej/Build/Intermediates/pcb2photon.build/Debug/SGLImage.build/Objects-normal/x86_64/SGLImage-Swift.h -Xcc -working-directory/Users/user/Documents/pcb2photon

<unknown>:0: error: no such file or directory: '/Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/Image.swift'
<unknown>:0: error: no such file or directory: '/Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImageBMP.swift'
<unknown>:0: error: no such file or directory: '/Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImageGIF.swift'
<unknown>:0: error: no such file or directory: '/Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImageLoader.swift'
<unknown>:0: error: no such file or directory: '/Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/ImagePNG.swift'
<unknown>:0: error: no such file or directory: '/Users/user/Documents/pcb2photon/.build/checkouts/Image.git--6271664722653506445/Sources/SGLImage/Inflate.swift'
Command /Library/Developer/Toolchains/swift-4.1.2-RELEASE.xctoolchain/usr/bin/swiftc failed with exit code 1
@a7u7a
Copy link
Author

a7u7a commented Jun 28, 2018

I realized I was using the wrong version of swift when attempting swift build, now using with Swift 4.1.2 I get:

/Users/user/Documents/pcb2photon: error: manifest parse error(s):
<unknown>:0: error: Swift does not support the SDK 'MacOSX10.12.sdk'

This is probably a very newbie question, this is my first time using swift and really want to try your code for building PCBs. Thanks!

@Reonarudo
Copy link
Owner

Hello,
If you are running from macOS try to run like this first:

swift build
swift package generate-xcodeproj

then you should be able to run it from XCode if that is what you are looking for.
If you just want to create the executable and run it then you have to run the executable created after building it with swift build.

Give it a go and tell me if you still have issues.

@a7u7a
Copy link
Author

a7u7a commented Jun 28, 2018

Thanks for your comment.
I dont mind building from xcode or directly from Swift.
However, when I do swift build I get:

/Users/User/Documents/pcb2photon: error: manifest parse error(s):
<unknown>:0: error: Swift does not support the SDK 'MacOSX10.12.sdk'

can't get past that :(

@Reonarudo
Copy link
Owner

That is very strange indeed.
Can you tell me what version of macOS and XCode you are using?

@a7u7a
Copy link
Author

a7u7a commented Jun 29, 2018

I'm using osx 10.11.6 (El Capitan) and xcode 8.2.1
hope this helps!

@Reonarudo
Copy link
Owner

Just curious, did you manually install/compile swift?

@a7u7a
Copy link
Author

a7u7a commented Jun 29, 2018

I downloaded the latest release from https://swift.org/download/#releases.
So maybe I can't build it because I am using Xcode 8.2.1 and swift 4 requires Xcode 9.4.1?
That would require me to upgrade to OSX 10.13.2 or later..
Am I right?

@Reonarudo
Copy link
Owner

Unfortunately, it might be so. I will look into how much effort it would be to make it swift 3 compatible but I make no promises.

@a7u7a
Copy link
Author

a7u7a commented Jul 9, 2018

I was able to upgrade to latest OSX and Xcode and could build. Even made my first DIY 2 layer PCB. Took some trial and error because I had to figure a suitable reference point and orientation to make the layers match. Still have some alignment issues but nothing too bad.
Just for the record I tried making a PCB with the machine before running into your code. For this I had to go through a bunch of programs(EAGLE, Illustrator, Rhino3D and finally Anycubic's software) in order to turn the 2D vector PCB data into a 3D solid. Came out fine but the whole process took me a like 4 hours just to put the files in the machine. This is so much better. Thank you.

@Reonarudo
Copy link
Owner

Those are great news! It is very rewarding to get this feedback.
I think you will be pleased with the future functionality to use gerber files.
Maybe you have a suggestion to mitigate the alignment issues.

@a7u7a
Copy link
Author

a7u7a commented Jul 9, 2018

Yes! gerber files would be great because I still have to use Illustrator to export the file aligned correctly.
I will quickly summarize my experience so far:

  • In order to find absolute dimensions with respect to a reference point I had to put a blank PCB on top of the screen, fixed with tape to the sides and square against the two allen bolts that are used as a fence for the vat and just light up the whole screen with a grid. Developed it and measured the relative distance to the edges using some digital calipers.
  • I found that (at least on) my machine the edges of the screen are masked 2.3mm to the sides and 1mm to front and back. So anything you put too close to the edges will be masked out.
  • I have tried two different brands of blank, presensitized PCBs and both work fine with 240s of exposure.(MG chemicals 689 single sided and some other offbrand)

screenshot 2018-07-09 12 01 25

  • In the future I would like to have a custom framing square cut from acrylic sheet for easier alignment.
  • Resolution is great and text comes out good at 2.2 mm height, could probably be made smaller but have not tried yet.
  • Personally I cant find a use for moving the platform up and down all the time. It would be a lot faster if the image just appeared on the screen. I thing this probably not doable without altering the Photon's firmware, though.

This is all work in progress so dont take my measurements too seriously!

@Reonarudo
Copy link
Owner

Those measurements would be very useful since I don't own a photon to test myself. Especially the border between the actual area of exposure and the effective area of exposure. Currently, the 1440x2560px are defined for an area of 68.04x120.96mm.
I actually have no idea what movements the printer is doing all the time, I might be able to stop them.

@a7u7a
Copy link
Author

a7u7a commented Jul 9, 2018

Yes, I started with 68.04x120.96mm at first but my 5mm grid was not matching. My current measurements say it is actually 116.56x66 mm but that might vary from machine to machine.
We will be using the machine for PCB stuff for the next couple of weeks so I can hopefully provide better measurements that you can use.

@Reonarudo
Copy link
Owner

That difference is severe! Especially for 3D prints that suffer from shrinkage... If you have the opportunity to re-check it would be great.

@X3msnake
Copy link
Collaborator

X3msnake commented Jul 18, 2018

@Hallulla

Masking is a known "issue" on the photon, if you look closely at the anouced specs here and here it's smaller than the LCD image size.

The way we are doing it in Photon File Validator is warn the user if the file has details in the known safe margins.

The pixel resolution of the machine is 47u and that means that that is the modular unit of the machine 0.047mm so it would be great to have pixel alignment and dimension fitting to that unit.

My idea for the registration is to make a template from the alan screws that ppl can cut out and make notches in the PCB so that you can use the screws to align front and back. if you do make the acrylic please share it here or in the Photonsters organization on github ;)

As for not moving the platform you can use the config.gcode file to stop the peeling action like I do for the resin exposure range project. Basically have 2 Gcodes, one that put it into PCB mode and the other that returns the machine to it's original settings.

You can check the project here

@X3msnake
Copy link
Collaborator

@Hallulla can you post some of your results for me to share on the fb photon owner group?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants