Home>

I have a GIF of the cam mechanism:

This illustration shows that when the shaft rotates evenly with the cam attached to it, the follower receives an uneven reciprocating motion of the follower, which slides over the surface of the cam.

I have reproduced the basic outlines of this mechanism.

Here is my static engine code:

<
svg xmlns= "http://www.w3.org/2000/svg" xmlns: xlink= "http://www.w3.org/1999/xlink" version= "1.1" preserveAspectRatio= "xMinYMin meet" id= "svg4" width= "390" height= "700" viewBox= "0 0 390 700" >
           <
! -Upper bracket ->
 <
g stroke= "# 717171" stroke-width= "2" fill= "none" >
  <
path d= "M149 124h87v31h-87z" />
  <
path d= "M175 124v31" />
  <
path d= "M210 124v31" />
  <
path d= "M161 134c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
   <
path d= "M221 134c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
  <
/g >
             <
! -Bottom bracket ->
 <
g stroke= "# 717171" stroke-width= "2" fill= "none" >
  <
path id= "circ910" d= "M221 278c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
  <
path id= "circ912" d= "M161 278c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
    <
path d= "M149 267h87v31h-87z" />
    <
path d= "M175 267v31" id= "path916" />
    <
path d= "M210 267v31" id= "path918" />
   <
/g >
                 <
! -Cam ->
        <
g ig= "gr1" stroke-width= "2" >
   <
path id= "cam" fill= "# 8080B1" stroke= "black" fill-opacity= "0.5" d= "M83 493c1-7 19-23 32-30 10-6 34-10 34-10 6-5 35 -42 59 -48 21-5 60-15 65-10 11 15 21 57 10 93-4 12-10 27-18 39-5 8-14 14-20 22l-5 9s-4 12-4 19c0 20-9 36-20 49-10 12-32 26-39 24-6-1-21-18-28-30-13-21-22-38-24-69 0-4-19-14-26-23-7 -10-17-27-16-35z "/gt;
   <
circle id= "path866" cx= "192" cy= "514.6" r= "36" fill= "# 5F5F5F" stroke= "black" stroke-width= "2" />
    <
circle id= "spindle" cx= "192" cy= "514.6" r= "20" fill= "# 4A4A4A" stroke= "black" stroke-width= "2" />
                   <
! -Key ->
      <
path id= "key" fill= "# 151515" stroke= "black" d= "M189 491h6v10h-6v-10h6" />
      <
/g >
                      <
! -Pusher ->
  <
path id= "kernel" d= "M184 60v340l8 14 7-14V59z" fill= "none" stroke= "red" stroke-width= "2" >
  <
/path >
  <
circle id= "path868" cx= "192" cy= "514.4" r= "144.7" opacity= ". 5" fill= "none" fill-opacity= "1" stroke= "# 1515B1" stroke-width= " 2 "/>
<
/svg >

I tried to animate the cam mechanism:

<
svg xmlns= "http://www.w3.org/2000/svg" xmlns: xlink= "http://www.w3.org/1999/xlink" version= "1.1" preserveAspectRatio= "xMinYMin meet" id= "svg4" width= "390" height= "700" viewBox= "0 0 390 700" >
           <
! -Upper bracket ->
 <
g stroke= "# 717171" stroke-width= "2" fill= "none" >
  <
path d= "M149 124h87v31h-87z" />
  <
path d= "M175 124v31" />
  <
path d= "M210 124v31" />
  <
path d= "M161 134c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
   <
path d= "M221 134c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
  <
/g >
             <
! -Bottom bracket ->
 <
g stroke= "# 717171" stroke-width= "2" fill= "none" >
  <
path id= "circ910" d= "M221 278c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
  <
path id= "circ912" d= "M161 278c3 0 6 3 6 6s-3 6-6 6c-2 0-5-4-5-6 0-3 3-6 5-6z" />
    <
path d= "M149 267h87v31h-87z" />
    <
path d= "M175 267v31" id= "path916" />
    <path d= "M210 267v31" id= "path918" /> <
/g >
          <
g ig= "gr1" stroke-width= "2" >
                    <
! -Cam ->
   <
path id= "cam" fill= "# 8080B1" stroke= "black" fill-opacity= "0.5" d= "M83 493c1-7 19-23 32-30 10-6 34-10 34-10 6-5 35 -42 59 -48 21-5 60-15 65-10 11 15 21 57 10 93-4 12-10 27-18 39-5 8-14 14-20 22l-5 9s-4 12-4 19c0 20-9 36-20 49-10 12-32 26-39 24-6-1-21-18-28-30-13-21-22-38-24-69 0-4-19-14-26-23-7 -10-17-27-16-35z "/gt;
                         <
! -Shaft ->
   <
circle id= "path866" cx= "192" cy= "514.6" r= "36" fill= "# 5F5F5F" stroke= "black" stroke-width= "2" />
    <
circle id= "spindle" cx= "192" cy= "514.6" r= "20" fill= "# 4A4A4A" stroke= "black" stroke-width= "2" />
      <
path id= "key" fill= "# 151515" stroke= "black" d= "M189 491h6v10h-6v-10h6" />
                             <
! -Animation of rotation of a shaft with a cam ->
       <
animateTransform attributeName= "transform" type= "rotate" begin= "0s" dur= "2s" values ​​= "0 192 514.6; 360 192 514.6" repeatCount= "indefinite" />
     <
/g >
                            <
! -Pusher ->
  <
path id= "kernel" d= "M184 60v340l8 14 7-14V59z" fill= "none" stroke= "red" stroke-width= "2" >
                          <
! -Animation of moving the pusher ->
      <
animateTransform attributeName= "transform" type= "translate" begin= "0s" dur= "2s" calcMode= "linear"
         values ​​= "0 0; 0 30; 0 0" repeatCount= "indefinite" />
  <
/path >
  <
circle id= "path868" cx= "192" cy= "514.4" r= "144.7" fill= "none" fill-opacity= "1" stroke= "# 1515B1" stroke-width= "2" />
<
/svg >

From the work of the program it can be seen that although the start time of the animations and their duration are the same, it is not possible to achieve a coordinated operation of the cam rotation and the reciprocating movement of the pusher.

How to match the animation of the cam rotation and the uneven movement of the follower, which depends on the profile of the cam surface.

It is quite simple to do this in Canvas: at each iteration along the pusher axis (x -also coincides with the cam rotation axis), check all y values ​​(from 0 or the calculated minimum possible value) -ctx.isPointInStroke (cam_path, x, y). The first point found will be the bottom point of the follower. In theory, on the first circle, you can write down the values ​​for each angle of rotation and then take the values ​​from there, without calculations.

Leonid2021-11-11 21:15:11