Open mrandt opened 9 years ago
the way it works now is that the component rotation is specified independent of the tape orientation relative to the cad system. So if the can system thinks that the component pointing up is 0 deg then that would correspond to posX. I actually plan on changing it to degrees which makes more sense and is less confusing. So look at the can system and see what it considers zero degrees. Then look at the component in the tape and see how that compares relative to the zero degree position. enter the part location as the difference of those two.
I noticed you added 0°,90°,180° and 270° for tape and component orientation.
Forgive me but I still do not get it. Regardless of what I set, the components are still placed in the incorrect orientation.
My CAD assumes that 0° is to the right and degrees are incremented counter clockwise - this is the same that @jkuusama uses in his "hello world" sample. See example below:
if your cad program places a component like this
and that's considered 0 deg
and if it places it like this
and that's considered 90 deg
then when it's in the tape and looks like ==== then it's at 0deg (i.e. 0 deg difference between the cad program 0 and the current orientation) when it's in the tape like |
---|
then it's 90 deg (i.e. 90 deg difference between the cad program 0 and the current orientation)
the orientation of the tape is no longer used for anything -- just figuring out where the next part is and contributes to an angle offset of the part (based on modulus 90)
-reza
mrandt mailto:notifications@github.com Thursday, July 16, 2015 8:57 AM
I noticed you added 0°,90°,180° and 270° for tape and component orientation.
Forgive me but I still do not get it. Regardless of what I set, the components are still placed in the incorrect orientation.
- Where is your 0° - to the right (parallel to X axis) or to the top (parallel to Y axis)?
- Do you increment degrees clockwise or counter clockwise?
- Is the same system of reference used for job / CAD data and component tape locations? I assume that would make sense...
My CAD assumes that 0° is to the right and degrees are incremented counter clockwise - this is the same that @jkuusama https://github.com/jkuusama uses in his "hello world" sample. See example below:
cad_orientation https://cloud.githubusercontent.com/assets/10500490/8728189/0c8ce314-2be4-11e5-99d3-dd1a1ed771ef.png
— Reply to this email directly or view it on GitHub https://github.com/jkuusama/LitePlacer-ver2/issues/19#issuecomment-122001371.
OK, this is in line with what I figured myself - but I believe the implementation is broken.
It is hard to notice when using only right-angled part orientation (90°, 180°, 270° or 360°/0°) but I think the rotation is applied into wrong direction. Try 45° or 330° or see example below.
While orientation / rotation in CAD system (at least in those I know well) is defined as 360° counter clockwise, the A axis on my machine uses 360° clockwise - so increasing (A+) the angle will rotate it to the right (as seen from above), while electronic CAD system of reference is exactly the other way round.
As placement and rotation works fine with Juha's version, I think I have the motor wired as intended - so if we take Juha's kit as the reference, the bug is probably in software.
But pictures speak more than words:
Here is my tape layout for the test - tape orientation is 0° and components are 90° (upwards).
This is how I configured it - in line with @thethereza suggestions
This is the HelloWorld sample CSV from Juha. I highlighted R4 as an example here.
And this is the result of placing the components. Obviously R4 and R6 are rotated into the wrong direction. R5 looks OK but is actually upside down.
There are probably two ways to fix this:
a) Change LitePlacer machine system of reference to make A+ counter clockwise - but that would mean changing the wiring on all machines and deviating from Juha's original design.
b) Compensate in software.
you bring up something that I should have some time ago. When I setup the machine, increasing A would cause the needle to spin clockwise (given that it's pointing down). I added code to reverse the direction of A. Can you verify that your A spins clockwise or counterclockwise (looking down at the table) with increasing A values?
If it's backwards then I have no idea why mine would spin the other way. Solution would be to provide a user configurable setting to reverse direction.
I just double-checked:
On my machine, increasing A-values (F9) spins the nozzle clockwise - if seen from above.
This is in contrast to the reference system most electronic CAD programs use - but I believe this is in line with Juha's instructions and original program.
If I use Juha's LitePlacer software (let's call it Ver-1), all parts get rotated correctly using the sample file and PCB from the hello world job (see above). Juha seems to correct / invert the values to achieve that.
If I run Reza-Mod LitePlacer (Ver-2), increasing A values still spins the needle in the same direction (clockwise) but automatic placement rotates in the wrong direction.
I could easily fix that by switching a pair of wires on the motor but I believe that all other users will run into the same issue, so a software switch seems more reasonable.
However, the A coordinate managed by TinyG and displayed to user might be misleading in that case, so maybe there would also be a good point in changing hardware wiring instead? Not sure.
By the way, in the forum @thethereza posted he added such switch to invert A direction. I tested SVN Release 24 but just could not find it... Where should I have looked?
I'll make sure it's checked in. Should be under the hardware a tab
So there should be no difference in placing components vs rotating it in terms of angles.
Just to make sure we are using the same terms --clockwise implies that if a part was picked up by the needle it would be rotated clockwise if you are looking down.
If the a value increases when manually controlling it, does it spin clockwise or counterclockwise? Should be counterclockwise.
For placement the needle is rotated to the angle corresponding to the part then rotated to the placement angle. If the placement angle is greater than the component angle then it should rotate counterclockwise on placement.
What are you seeing?
On Jul 19, 2015, at 7:40 AM, mrandt notifications@github.com wrote:
I just double-checked:
On my machine, increasing A-values (F9) spins the nozzle clockwise - if seen from above.
This is in contrast to the reference system most electronic CAD programs use - but I believe this is in line with Juha's instructions and original program.
If I use Juha's LitePlacer software (let's call it Ver-1), all parts get rotated correctly using the sample file and PCB from the hello world job (see above). Juha seems to correct / invert the values to achieve that.
If I run Reza-Mod LitePlacer (Ver-2), increasing A values still spins the needle in the same direction (clockwise) but automatic placement rotates in the wrong direction.
I could easily fix that by switching a pair of wires on the motor but I believe that all other users will run into the same issue, so a software switch seems more reasonable.
However, the A coordinate managed by TinyG and displayed to user might be misleading in that case, so maybe there would also be a good point in changing hardware wiring instead? Not sure.
By the way, in the forum @thethereza posted he added such switch to invert A direction. I tested SVN Release 24 but just could not find it... Where should I have looked?
— Reply to this email directly or view it on GitHub.
I made a picture to make sure everybody is on the same page... See below:
As pointed out above, this works fine with @jkuusama original software (Ver-1). As CAD software system of reference is the other way round, I am inclined to switch one of the wire pairs on A-axis motor so coordinates in TinyG matches those of my CAD.
What do you think?
If it's consistent between manual movement and placement then try the toggle button in svn. Just checked in changes. Untested but that should work. I made some sweeping changes to some confugurations stuff that might break it. Will test later.
On Jul 19, 2015, at 10:44 AM, mrandt notifications@github.com wrote:
I made a picture to make sure everybody is on the same page... See below:
As pointed out above, this works fine with @jkuusama original software (Ver-1). As CAD software system of reference is the other way round, I am inclined to switch one of the wire pairs on A-axis motor so coordinates in TinyG matches those of my CAD.
What do you think?
— Reply to this email directly or view it on GitHub.
In release 25 I see the checkbox to invert rotation direction for A axis.
However, I could not test as TinyG communication seems broken.
See issue #33 for details.
Release 26 fixed TinyG comm error, so I could test the "invert rotation" checkbox.
Here are my findings:
When I start LitePlacer and TinyG, the checkbox is checked.
F9 increases A coordinate, needle turns clockwise (seen from above) F10 decreases A coordinate, needle turns counter-clockwise
=> Placement is incorrect, same as before.
Then I set A to 0 again, and unchecked the reverse rotation checkbox.
F9 still increases A coordinate but now the needle turns counter clockwise (so the way I assume it should turn) F10 decreases A coordinate and needle turns clockwise.
=> Placement is good now - and coordinate makes sense as well :+1:
I noticed weird results when I checked or unchecked the box while A corrdinate was anything else than 0. Maybe TinyG gets confused in that case - so before sending the command to change direction, A should probably be set to 0 automatically.
Strange. What were the side effects?
On Jul 20, 2015, at 8:47 AM, mrandt notifications@github.com wrote:
Release 26 fixed TinyG comm error, so I could test the "invert rotation" checkbox.
Here are my findings:
When I start LitePlacer and TinyG, the checkbox is checked.
F9 increases A coordinate, needle turns clockwise (seen from above) F10 decreases A coordinate, needle turns counter-clockwise
=> Placement is incorrect, same as before.
Then I set A to 0 again, and unchecked the reverse rotation checkbox.
F9 still increases A coordinate but now the needle turns counter clockwise (so the way I assume it should turn) F10 decreases A coordinate and needle turns clockwise.
=> Placement is good now - and coordinate makes sense as well
I noticed weird results when I checked or unchecked the box while A corrdinate was anything else than 0. Maybe TinyG gets confused in that case - so before sending the command to change direction, A should probably be set to 0 automatically.
— Reply to this email directly or view it on GitHub.
With my CAD files, the part orientation is incorrect.
To make things reproducable, I also tested with Juha's "hello world" job files - also had parts rotated the wrong way. See pictures below:
It looks as if the part was rotated in the wrong direction??
The CSV file has value
330
for rotation. The fiducial measurement seemed to yield correct value, too:In "Tape positions" I configured the part to by "PosY" - i.e. orthogonal to tape direction (0805 resistor). I also tried other orientations but still did not get the desired result.
By the way, I think that having feature #13 would greatly help to test and debug orientation.