Hi again, some more questions.
19:1 Metal Gearmotor,
19x64= 1216 counts per revolution would be some 4-5 m in my case with 19:1
Returns the number of counts measured on M1 or M2. For the Pololu wheel encoders, the resolution is about 3mm/count, so this allows a maximum distance of 32767 × 3mm or about 100m. For longer distances, you will need to occasionally reset the counts using the functions below.
In a future release might it be possible to throw in a divider like 2, 4, 8, 16 when you do the encoder init to get some more distance out of it?
Or is all hardcoded stuff “in the bottom”?
Distance is of more value than resolution of 1216 on a single revolution.
I do not think it would work with some sort of external counter between motor encoder and the input on the SVP acting as a divider or to fix this?
When you do the encoders_init(16,17,18,19);
Could you do like encoders_init(16,17,0,0); to save two interrupts, just have need for one motor and more need of a free interrupt.
This section of the library makes uses of pin-change interrupts to quickly detect and record each transition on the encoder. Specifically, it uses the AVR’s PCINT0, PCINT1, and PCINT2 (and PCINT3 on the Orangutan SVP and X2) interrupts, and it will conflict with any other code that uses pin-change interrupts (e.g. OrangutanPulseIn).
What is a good policy switching direction on that motor, just go via 0 and then -255 or involve some time as well so I do not get a harmful current spike.
Would a mini glue on heatsink on the H bridge do any noticeable good?
Last,
Just unpacked and did setup 19:1 Metal Gearmotor 37Dx52L mm with 64 CPR Encoder to the SVP downloaded the wheelencooder test with a simple motor start added to it running for some seconds.
Well the encoder routine just tally up to 11110 with a constant Error 1.
It does not matter if anything is connected or not (hall sensor), same behavior.
#include <pololu/orangutan.h>
#include <avr/interrupt.h>
int main()
{
unsigned long time = 0;
encoders_init(16,17,18,19); // the Arduino numbers for ports PC2 - PC5
set_motors(200, 0);
while(1)
{
lcd_goto_xy(0,0);
print_long(encoders_get_counts_m1());
print(" ");
if(encoders_check_error_m1())
{
lcd_goto_xy(0,1);
print("Error 1");
}
time++;
if (time >100)
set_motors(0, 0);
delay_ms(50);
}
}
Please advice,
Regards,
ted
PS,
Federal Express is just outstanding as a shipping choice, phones up to check before driving out on the last leg if there is a number to do so and always extremely quick and on time.