# Code improvement/documentation request

**URL:** <https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914>\
**Category:** Uncategorized\
**Created:** [August 20, 2019, 3:18am UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914 "2019-08-20T03:18:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlang](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/dlang/32/859_2.png) [@dlang](https://forums.maslowcnc.com/u/dlang)\
**Post date:** [August 20, 2019, 3:18am UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/1 "2019-08-20T03:18:40Z")

</div>

right now kinematics.cpp is unreadable in terms of what it actually does. There are a lot of greek variable names, but no diagram or explination of what is what.

We have done a LOT of work to figure out the various sources of possible error and add calculations to the kinematics to allow us to account for them (even though we are still struggling to get a calibration routine that gets the right values). All the other v-plotter/bipod/calwhatever drawing robots just do the simple triangular calculations and either live with the errors, or don’t realize they are there.

a cleaned up and documented kinematics.cpp would be valuable to a lot of projects

---

<div class="post-metadata">

**Author:** ![madgrizzle](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/madgrizzle/32/1372_2.png) [@madgrizzle](https://forums.maslowcnc.com/u/madgrizzle)\
**Post date:** [August 20, 2019, 12:15pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/2 "2019-08-20T12:15:55Z")

</div>

Are you referring to both the triangular and quadrilateral kinematics? I find the triangular kinematics to be somewhat readable…(yes, doesn’t have diagrams and it’s not really spelled out, but it’s also fairly simple). The quadrilateral is definitely an issue.

---

<div class="post-metadata">

**Author:** ![dlang](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/dlang/32/859_2.png) [@dlang](https://forums.maslowcnc.com/u/dlang)\
**Post date:** [August 20, 2019, 4:07pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/3 "2019-08-20T16:07:57Z")

</div>

I’m referring to the triangular (as far as I’m concerned, the quadrilateral is  
legacy that would go away if we ever did incompatible hardware)

the general idea of the triangular is easy to understand, it’s the subtle things  
like the compensation for the sprocket diameter and where the chain leaves the  
sprocket to become straight, chain sag, chain stretch that are not clear.

David Lang

---

<div class="post-metadata">

**Author:** ![madgrizzle](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/madgrizzle/32/1372_2.png) [@madgrizzle](https://forums.maslowcnc.com/u/madgrizzle)\
**Post date:** [August 20, 2019, 4:15pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/4 "2019-08-20T16:15:12Z")

</div>

Maybe adding a link to the wiki page?

> [@Chain Length Calculations](https://forums.maslowcnc.com/t/chain-length-calculations/6029):
>
> Components of Chain Length Calculation At any time, the position of the sled on the MaslowCNC workspace is set by the amount of chain that extends beyond the 12 o’Clock sprocket top position, the geometry (or shape) of the frame, and the weigth of the suspended machine components. Sledposition accuracy is controlled by two things: The fitness of the calculation model built into the firmware The accuracy of values for the machine parameters used by the model. Note: This article discusses o…

Easier than trying to type all that in to the code and using ascii graphics 🙂

---

<div class="post-metadata">

**Author:** ![jwolter](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/jwolter/32/30787_2.png) [@jwolter](https://forums.maslowcnc.com/u/jwolter)\
**Post date:** [August 20, 2019, 5:21pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/5 "2019-08-20T17:21:03Z")

</div>

> [@dlang](#):
>
> as far as I’m concerned, the quadrilateral is  
> legacy that would go away if we ever did incompatible hardware

I’m still working the hardware end of a Maslow Mark II, but since that one doesn’t have the sled rotation to deal with, I would think the quadrilateral might be the right way to go. Haven’t thought about it very carefully, though.

---

<div class="post-metadata">

**Author:** ![madgrizzle](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/madgrizzle/32/1372_2.png) [@madgrizzle](https://forums.maslowcnc.com/u/madgrizzle)\
**Post date:** [August 20, 2019, 5:29pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/6 "2019-08-20T17:29:04Z")

</div>

The original quadrilateral kinematics attempted to figure out how much the sled would rotate when the sled endpoints were fixed (didn’t swivel like in triangular kinematics). If your sled design doesn’t rotate, then its real simple trigonometry to figure out where the sled is.

---

<div class="post-metadata">

**Author:** ![dlang](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/dlang/32/859_2.png) [@dlang](https://forums.maslowcnc.com/u/dlang)\
**Post date:** [August 20, 2019, 6:19pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/7 "2019-08-20T18:19:41Z")

</div>

with additional math needed to deal with the offsets of the chain endpoints from  
the center of the bit.

note that the math will also change for the motors on the sled because the chain  
wrap calculations will be different.

---

<div class="post-metadata">

**Author:** ![madgrizzle](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/madgrizzle/32/1372_2.png) [@madgrizzle](https://forums.maslowcnc.com/u/madgrizzle)\
**Post date:** [August 20, 2019, 7:01pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/8 "2019-08-20T19:01:15Z")

</div>

> [@dlang](#):
>
> note that the math will also change for the motors on the sled because the chain  
> wrap calculations will be different.

Zone-based calibration! 😉

---

<div class="post-metadata">

**Author:** ![dragontattoo](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@dragontattoo](https://forums.maslowcnc.com/u/dragontattoo)\
**Post date:** [October 4, 2019, 5:49pm UTC](https://forums.maslowcnc.com/t/code-improvement-documentation-request/10914/9 "2019-10-04T17:49:09Z")

</div>

Thanks all for your responses. i was having similar questions and your answers were helpful to me.
