From 86b41954a5faeaf79eeb92dc17e4db737d4609c6 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Sat, 13 Jan 2024 01:33:07 -0500 Subject: [PATCH] Found ratio, seemingly 11PRR x 62:1 motor gearbox. --- ino/motor_encoder_poc/motor_encoder_poc.ino | 12 +++++++++++- scad/sprocketed_roller | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ino/motor_encoder_poc/motor_encoder_poc.ino b/ino/motor_encoder_poc/motor_encoder_poc.ino index d3bb2ae..26c6455 100644 --- a/ino/motor_encoder_poc/motor_encoder_poc.ino +++ b/ino/motor_encoder_poc/motor_encoder_poc.ino @@ -27,7 +27,9 @@ volatile int posi = 0; // specify posi as volatile const long maxTime = 10000; -const int maxPulses = 660; +const int ppr = 11; +const float ratio = 62.0; +const int maxPulses = (int) round((float) ppr * ratio); const int speed = 40; volatile long start = 0; volatile bool done = false; @@ -45,6 +47,14 @@ void setup() { attachInterrupt(digitalPinToInterrupt(ENCA), readEncoder,RISING); + Serial.println("Connected"); + Serial.print("PPR: "); + Serial.println(ppr); + Serial.print("Ratio: "); + Serial.println(ratio); + Serial.print("Pulses: "); + Serial.println(maxPulses); + } void loop() { diff --git a/scad/sprocketed_roller b/scad/sprocketed_roller index b4ea887..4482a47 160000 --- a/scad/sprocketed_roller +++ b/scad/sprocketed_roller @@ -1 +1 @@ -Subproject commit b4ea887d588a3728dfcb0fc64dc9195f278b7b1f +Subproject commit 4482a471bb357e93e9cabe9efaecba0370a3a0bd