motor shield encoder

hey all, im planning to redo the arduino motor control shield sort of how i redid the arduino protoshield. but i can't seem to find any reference or docs for the encoder section. is there any -real- documentation for what the LEDs/buttons are for? are they debugging or are they intended to be wired in -as- the encoder?

while im at it, is there any documentation for what C10-C13 are for? are the pins liable to ripple? seems odd..d.

Hej,

sorry for being late to this answer.

The motor-shield v1 and 2, that were created by me, were meant for a very specific purpose. I added the following components:

  • H-bridge
  • pushbuttons + indicating LEDs
  • encoder enabled inputs

The idea was that it should be possible to control up to 2 DC motors and up to 2 x 1-direction encoders (or 1 x 2-directions). The need for the gates is clear, since encoders are working a pretty high speed and need to use the hardware interrupt. This means that an OR gate is needed to detect when there is a hardware interrupt and two extra pins are needed to detect if it was encoder A or B first to produce the interrupt to be captured by the board. Thanks to this is possible to reuse motors with encoders from old printers into very funky controls.

The not gates are needed for the H-bridge. About the capacitors, the design is taken from the manufaturer's datasheet, maybe we should ask National Semiconductors directly ;-) ... kidding, I guess the internal circuitry in the H-bridge needs the capacitors to keep the output stable.

The pushbuttons are connected to the LEDs in a way that allows using those pins both as inputs and outputs. It is an old trick taken from an old keyboard I had on my table when I made the eagle file. I like to add things like that to the boards just in case they are needed ;-)

I hope I helped a bit.

/d

PS. there is a rev. 3 for that board coming next week, with support for stepper motors

About the capacitors, the design is taken from the manufaturer's datasheet, maybe we should ask National Semiconductors directly ;-) ... kidding, I guess the internal circuitry in the H-bridge needs the capacitors to keep the output stable.

hmm...national doesnt seem to make the l293d, although both TI and ST have versions. neither datasheet has any notes about these caps. do you know what datasheet you used? while its common to put caps on the motor, but ive never seen them on the pcboard. its not -bad- per se, just thinking they aren't necessary. :-?

PS. there is a rev. 3 for that board coming next week, with support for stepper motors

great to hear, im going to keep working with this revision but it will be interesting to see whats new!

if you have any time, can you put the mshield files maybe on the arduino.cc site? i can't get to where they are hosted half the time (& it seems to be down right now) :(

Believe it or not,

yesterday there was a blackout in Southern-Sweden and K3's server, which is hosting those files, happens to be down for another couple of hours.

I will post rev3 instead, since I have tested the board successfully with DC and Steppers already.

Regarding HC. Steiner's concerns about working with haptics, board's rev1 was used in 2005 in a design I made together with my brother (I have been waiting 3 years to post this ;-) ) for the Interaction Design Institute Ivrea. You can see the video here:

http://webzone.k3.mah.se/k3dacu/projects/ivrea/

(off the record, this is the same server as mentioned earlier and it is also down when I am typing these lines ... but will be up soon)

I will hook up my HD and look for that rev3 for you to look at it. --> get it from here:

https://sourceforge.net/project/showfiles.php?group_id=190419

Note that I want to release this as an "arduino" labeled board once it has been approved.

As for the H-bridge, you are right, it wasn't National, had a memory failure, I used ST L293N and L293D. I was powering my boards up to 24 volts without any problems.

Regarding the capacitors, we used them because we wanted very low frequency PWM to move our very powerful Maxon motor (see the video to get an idea of the size). The fact is that the motor started to scream like a child unless we were cleaning up the frequencies with those capacitors. That is the reason why we added them. They are useful for -believe it or not- noise reduction. But of course that was for our case ... I have found very few cases when they were needed again.

/d

Regarding the capacitors, we used them because we wanted very low frequency PWM to move our very powerful Maxon motor (see the video to get an idea of the size). The fact is that the motor started to scream like a child unless we were cleaning up the frequencies with those capacitors. That is the reason why we added them. They are useful for -believe it or not- noise reduction. But of course that was for our case ... I have found very few cases when they were needed again.

ok cool! that makes a lot more sense. they were necessary in -addition- to small caps on the motor terminal/bushing, then?

thanks for posting the newest rev., i see there are now jumpers for the stepper motors.

did you find that you had to use a 16bit pwm channel rather than a 8 bit to get the performance you needed?

ladyada:

we used 8bit PWM and everything went fine. We had to write special functions to control the thing considering issues like torque needed to "battle" the initial friction and so on, but everything was 8bit. I don't think I can rescue that code, though ... it was in my brother's harddrive and that computer had a dramatic death short after finishing the project.

/d

PS. I may have a security copy somewhere, but I don't really have the time to look through my old disks, the project goes back to 2005

ladyada:

we used 8bit PWM and everything went fine. We had to write special functions to control the thing considering issues like torque needed to "battle" the initial friction and so on, but everything was 8bit. I don't think I can rescue that code, though ... it was in my brother's harddrive and that computer had a dramatic death short after finishing the project.

/d

PS. I may have a security copy somewhere, but I don't really have the time to look through my old disks, the project goes back to 2005

ok cool. just checking cause i wanted to use the 16 bit pwm lines for the servo connections (they really dont work well with anything else) no need for code examples :)

Hi from a newbie on this site. I'm getting involved more and more in the Arduino community, built a few boards (including LadyAda's version), and put together a few simple apps, for the fun of it (and to kick start my son who seems to show some appetence for this activity). This said, I'm probably a bit thick headed, or did not look at the right place, but does any of you have anywhere some sample code showing how to use the motor shield (V2) and drive it from the Arduino? I know how stepper and DC motors work, but honestly I do not have too much time reverse engineering the board... This would allow me to concentrate on a simple 2D plotter, then maybe a reprap (dream on...)!

Thanks much

Maybe the solution to a problem i have is in this thread.

I have been trying to control the speed of the small DC motors in cheap cassette recorders with Arduino PWM.

When i slow the motor down i start to herar the PWM frequency in the audio signal, this kind of ruins my whole plan of making an alternative musical instrument out of tape players with Arduino speed control (+ a few other capabilities). The closer i come to the point where the motors stall the more i hear the PWM frequency.

Do you think that my problem can be solved by adding some capacitors to the design ?

If so, how big should the caps be ? and where in the circuit should i put them ?

I use the "standard" way of controlling the motors from a PWM pin through a TIP120 transistor and of course the snubber diode.

MikMo / copenhagen

http://www.mikmo.dk

Is the v3 fab approved and being shipped? If so does anyone know who is selling them?

Thanks in Advance...

Hej

sorry for the delay to this post, I became father since my last post and it takes a lot of time.

Going back to work

1) about using capacitors to eliminate noise: they are your friends, however, if you PWM is noisy, you should push its frequency to a level where it cannot be heard, otherwise the capacitors will not just eliminate the motor's noise, but also your taped sounds.

2) code examples to use the v2 and v3 are non existent, because the boards are pretty easy to use, if you are interested, we could code some :-) ... we should have done this before, but we started using the PCB directly and ... so far no one ever asked for the code, so it is our fault anyway :-[

3) regarding the sales of v3, that is something I don't know yet, I want to test it further, however, Ladyada's version seems pretty good as well, packing 2 H-bridges in one single board :-) ... I guess it will also be a little more expensive, since the most expensive part on the board is that chip. V2 and V3 were thought for applications that require monitoring the motor's rotation, while Ladyada's seems to be pure motor driving, what is the most needed in small robotic applications ... so if I was you I would first decide which is the context of use and then select the best tool for it (both Ladyada's and v3 are not in the market, yet ... but will be)

/d

Hej

1) about using capacitors to eliminate noise: they are your friends, however, if you PWM is noisy, you should push its frequency to a level where it cannot be heard, otherwise the capacitors will not just eliminate the motor's noise, but also your taped sounds

the datasheet for the 293d seems to mention 5khz as the limit for PWM, im wonding if thats for the EN pin or just the transistors...

the datasheet for the 293d seems to mention 5khz as the limit for PWM, im wonding if thats for the EN pin or just the transistors...

Hi,

If you look at the T_THL and T_TLH times (several hundred nanoseconds) you see that 5Khz is just the value they use for these measurements.

A higher frequency is possible, however the higher the switching frequency the more power will be dissipated by the chip.

EN inputs enable or disable the H-bridge output. You can use that for PWM current control.

If you use a DC motor, EN can be use to leave the motor free running. Problem is that there is only one EN input for each output pair.

Cheers,

Miguel Sánchez

rad