Spikemark Spikes Nearest Multiple Spike Nearest Multiple Spikes will move the motor in either direction to the closest multiple of Factor plus Offset. Put in other words:
N e w T a r g e t P o s i t i o n = N e a r e s t M u l t i p l e ( F a c t o r + o f f S e t ) NewTargetPosition=NearestMultiple(Factor+offSet) N e wT a r g e tP os i t i o n = N e a res tM u lt i pl e ( F a c t or + o ff S e t ) The N e a r e s t M u l t i p l e ( F a c t o r + o f f S e t ) NearestMultiple(Factor+offSet) N e a res tM u lt i pl e ( F a c t or + o ff S e t ) is found by calculating the N e w F o r w a r d P o s i t i o n New Forward Position N e wF or w a r d P os i t i o n and the N e w R e v e r s e P o s i t i o n New Reverse Position N e wR e v erse P os i t i o n , then selecting which one is closest to the C u r r e n t M o t o r P o s i t i o n Current Motor Position C u rre n tM o t or P os i t i o n and setting that as the New Target Position.
For Math Nerds
P C = P_C= P C = Current Position
∣ P C − ( R ↑ [ P C / F ] ∗ F + S ) ∣ < ? ∣ P C − ( R ↓ [ P C / F ] ∗ F + S ) ∣ |P_C-(R↑[P_C/F]*F+S)| <^? |P_C-(R↓[P_C/F]*F+S)| ∣ P C − ( R ↑ [ P C / F ] ∗ F + S ) ∣ < ? ∣ P C − ( R ↓ [ P C / F ] ∗ F + S ) ∣ If Yes,
N e w T a r g e t P o s i t i o n = N e w F o r w a r d P o s i t i o n NewTargetPosition=NewForwardPosition N e wT a r g e tP os i t i o n = N e wF or w a r d P os i t i o n N e w F o r w a r d P o s i t i o n = R o u n d ↑ ( C u r r e n t M o t o r P o s i t i o n / F a c t o r ) ∗ F a c t o r + O f f s e t New Forward Position = Round↑(CurrentMotorPosition/Factor) * Factor + Offset N e wF or w a r d P os i t i o n = R o u n d ↑ ( C u rre n tM o t or P os i t i o n / F a c t or ) ∗ F a c t or + O ff se t If No,
N e w T a r g e t P o s i t i o n = N e w R e v e r s e P o s i t i o n NewTargetPosition=NewReversePosition N e wT a r g e tP os i t i o n = N e wR e v erse P os i t i o n N e w R e v e r s e P o s i t i o n = R o u n d ↓ ( C u r r e n t M o t o r P o s i t i o n / F a c t o r ) ∗ F a c t o r + O f f s e t New Reverse Position = Round↓(CurrentMotorPosition/Factor) * Factor + Offset N e wR e v erse P os i t i o n = R o u n d ↓ ( C u rre n tM o t or P os i t i o n / F a c t or ) ∗ F a c t or + O ff se t Changing the Type
Nearest multiple spikes are denoted with a ↔
(left right arrow) and use a Factor and an Offset.
To change the type double click in the Type column and select Nearest Multiple then press enter
or tab
to save it.
Changing the Factor
To change the factor double click in the Factor column give it a new factor and then press enter
or tab
to save it.
Changing the Offset
To change the offset double click in the Offset column give it a new offset and then press enter
or tab
to save it.
Last updated 4 months ago