Skip to content

235 integrate velocity and acceleration analyses#307

Merged
mwalsh001 merged 27 commits into
mainfrom
235-integrate-velocity-and-acceleration-analyses
Apr 14, 2026
Merged

235 integrate velocity and acceleration analyses#307
mwalsh001 merged 27 commits into
mainfrom
235-integrate-velocity-and-acceleration-analyses

Conversation

@mwalsh001
Copy link
Copy Markdown
Contributor

Angular velocity and acceleration calculations for 4-bar, 6-bar, and crank-sliders. Future work: fix side panel issues with displaying graphs and current timestep data.

tlnguyen2009 and others added 22 commits October 22, 2025 16:57
Fixed the logic error in calculating the slope of the linear function of the slider. Before the fix, the code was incorrectly using the slider's initial Y coordinate stored in the Joint object, instead of its Y coordinate from the previous frame.  The fix was to consistently use both prevJointPosition.x and prevJointPosition.y when calculating n.
Adding more logic to allow users to enter value in degrees/radians. The function will also check and display correct values when the users switch between degree and radians in Settings.
…s (vertical)

Before the fix, when the slider became vertical (angle = 90 degrees), the slider didn't move, and the coupler link was strangely animated by stretching out and in. After the fix, everything became normal as it should be. The issue was in the old code, which mistakenly used the old point coordinates instead of the current ones. In other words, when the crank moves an angle theta to a new position, we should use this new position to draw a circle analysis instead of the last position.
…tton at some position on the grid

When solving for the slider's position, a quadratic equation provides two possible solutions (x1, x2). The correct solution is the one physically closest to the slider's previous position.

The old code always picked x1, which caused errors when x2 was the correct solution for some position on the grid. This commit updates the logic to choose the solution (x1 or x2) nearest to the previous position.
The slider's blue path is generated from a series of connected points. A previous optimization attempted to draw this path by only using two endpoints.

However, the logic to find these points was incorrectly reused from a function designed for linkages. This bug caused the slider path to render incorrectly, appearing as a "double closed loop" like the outline of a linkage instead of a single, continuous line.

This commit removes the faulty optimization. The path is now drawn by connecting all of its points in sequence, which resolves the rendering bug.
…isplays in analysis graph. Only displays one link velocity at a time that is hard-coded, needs to include the velocities of the selected link.
…a selected link. Graph only has X data and function previously checked for X and Y data being present. Error found in Velocity calculations - sign of velocities are not consistent so that needs to be fixed."
…lection is implemented to decide the direction of theta values i.e. CD or DC.
…t correct lengths for all link shapes. To account for compound links, find the joint pair within a link with the farthest distance to calculate the angle of each link over time. Then, use the matrix solver to find the omega values. Values are slightly off due to some sign and loop order inconsistencies.
… into 235-integrate-velocity-and-acceleration-analyses
@mwalsh001 mwalsh001 linked an issue Apr 2, 2026 that may be closed by this pull request
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 2, 2026

Deploy Preview for pmks ready!

Name Link
🔨 Latest commit 517f2ee
🔍 Latest deploy log https://app.netlify.com/projects/pmks/deploys/69de945a3daad400085fe7fe
😎 Deploy Preview https://deploy-preview-307--pmks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 2, 2026

Deploy Preview for steady-macaron-f82663 ready!

Name Link
🔨 Latest commit 517f2ee
🔍 Latest deploy log https://app.netlify.com/projects/steady-macaron-f82663/deploys/69de945ab7636d00089f3a25
😎 Deploy Preview https://deploy-preview-307--steady-macaron-f82663.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…globally parsing all strings. This fixes input speeds, IDs, and angles being decoded as strings, which caused

  omega/acceleration calculations to become NaN as they attempted to calculate using strings not numbers.
@mwalsh001 mwalsh001 merged commit 9b79aa3 into main Apr 14, 2026
9 of 10 checks passed
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

Successfully merging this pull request may close these issues.

Integrate Velocity and Acceleration Analyses into Refactor

3 participants