Parametric pcb traces

Hi,

I am trying to lay out the ips2550 encoder in kicad. It is basically a resolver replacement that allows through shaft position sensing, quite useful…

https://www.renesas.com/en/document/dst/ips2550-datasheet?r=1469886

My issue is that it involves sinusoidally drawn traces, basically it’s loops of the form

R=A +Bsin(ntheta+D)

The traces could be any thickness, 0.2 or 0.25mm probably ideal.

Ideally i think it would be a footprint but I’ll take anything that gets the job done…

Any idea how to achieve this? Maybe I’m missing something obvious but I’m feeling a bit lost honestly.

In KiCad we call them tracks. But…do they need to be tracks or can they just be copper shapes?

I am thinking to use an Excel Chart to create a sinewave. Then that chart becomes an image in a format such as .png.

Can you put that .png onto a copper layer?

As long as I can attach a net to them and therefore wire them into the chip they can be tracks or polygons or whatever…

I can probably generate the shapes in Solidworks. Export as dxf or pdf or png or something like that. Was hoping there was a native kicad thing to do it because relying on Solidworks is a pain, as is generating png from an excel (with the added complication that it’s a fundamentally polar coordinate problem).

Its easy enough to get the image.

There was a python script flying around to generate the needed patterns for these sensors

But… If you can generate a plot and generate an SVG, you can import the SVG into Kicad and use it as copper

Matplotlib can export as svg

In my opinion, Solidworks is much more convenient in this regard

Sage Math might be able to do this according to a quick search. A ‘tad’ cheaper too. :wink:

For footprints take a look at GitHub - in3otd/spiki: A spiral inductor footprint generator for Kicad

There’s a function plotter in Inkscape (Extensions → Render → Function Plotter) with a polar mode that can be used for quick work (it’s not as accurate as a proper mathematical solvers, because the derivative is numerical for polar plots and there’s no adaptive sampling). But with enough sample points the error will be negligible:

Gnu Octave can plot functions like this for free

There are plenty of Posts on using DXF and Graphics so, I’ll stop at getting a Sine Curve, using FreeCAD (yes, there are many other ways to get the Curve).

Since you know SolidWorks, then you know 90% of FreeCAD’s ‘Part-Design’ Workbench. That said, video shows using the ‘Draft’ workbench and the Python Console in FreeCAD.

I simply dropped in the Code below and hit Enter-Key…

(FYI - I came to FreeCAD years ago after using SolidWorks, Pro-E and all the other’s… I use only FreeCAD now).

Oh, and there’s a nice Parametric Workbench with built-in functions that are editable… I use it to make Traces/Tracks in Kicad

import FreeCAD
import Draft
import math
pts = []
radius = 10
for ii in range(0,360):
pts.append(FreeCAD.Base.Vector(iimath.pi/180,math.sin(iimath.pi/180),0))

Draft.makeBSpline(pts)