Author Topic: Axon and digital counters (or encoders...)  (Read 1352 times)

0 Members and 1 Guest are viewing this topic.

Offline mstachoTopic starter

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Axon and digital counters (or encoders...)
« on: February 22, 2011, 02:41:38 PM »
so I'm trying to read an encoder from the axon.  It is a digital encoder, but I have no way of storing how many encoder pulses have happened since I last polled the encoder.  I can think of three ways to do this, and if anyone knows which would work that'd be awesome :-)

I know that the maximum number of encoder pulses per second is 152, so an 8-bit counter will work, as I'll be polling way more than once per second.

1) IF the axon has internal hardware counters that I can rig to one of the digital IO pins, then I'd just set the counter to read the encoder data and count, then poll the counter in my main program.  This would be an ideal option, but I have 7 encoders, so maybe not.

2) I can always just get a whole bunch of 8-bit counter chips, one for each encoder.  The axon would then just have to read the counter chip and reset it through the control loop.

3) In theory, I can have a PIC handle all my sensor IO (I'll also have a LOT of touch sensors eventually, so this might be the option of choice anyway).  The PIC handles all the counting, and then just sends the axon a UART message when it is polled that includes all sensor info.

I'm really hoping, at least at first, that the axon has counters?  If not I'll go with option #2 for proof of concept stuff...

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: Axon and digital counters (or encoders...)
« Reply #1 on: February 22, 2011, 03:04:14 PM »
The processor used in the Axon should have inputs that can be setup to cause an interrupt. Then in the ISR increment a counter.
152 pulses per second is about 6.5msec per pulse so the Axon processor should easily handle counting the encoder pulses in an ISR.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Axon and digital counters (or encoders...)
« Reply #2 on: February 22, 2011, 03:15:27 PM »
Hi,

Just wanna add... Sure the Axon has got counters - download the data sheet for the microcontroller, you'll need it now and then.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline mstachoTopic starter

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: Axon and digital counters (or encoders...)
« Reply #3 on: February 22, 2011, 06:13:25 PM »
Awesome.  I'll look into it, thanks everyone.

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Axon and digital counters (or encoders...)
« Reply #4 on: February 23, 2011, 12:15:37 PM »
WebbotLib Project Designer has an encoder module that makes it really really easy to do for the Axon. I highly recommend it.

 


data_list