Welcome, Guest. Please login or register.

Username: Password:
Pages: [1] 2

Author Topic: Pin mapping  (Read 9540 times)

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Pin mapping
« on: May 06, 2016, 19:09:25 »

Hi all,

I did an interim test on my Mega2560 and proto-shield. The result was not as I expected. Without drivers and motor power not connected the boards were drawing 500mA from the USB. I cannot see any wiring problems so I wondered if perhaps I hadn't changed the pin mapping correctly.

Can I confirm that I change the pinmapping.h version found at AstroEq-master/downloads/AstroEQ-Firmware/AstroEQ? Once changed, use the Configutility .

Thanks

Phill
Logged
Phill

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Pin mapping
« Reply #1 on: May 06, 2016, 23:12:23 »

Hi Phill,

Should be the correct one. If you go to http://astroeq.co.uk/buildown there is a full schematic pdf for the Arduino Mega version which shows all the pin mappings as well (under Building AstroEQ Option 1).

If it is drawing that much current with the motor drivers not connected there is probably a short in the 5V/GND pins somewhere.

Tom.
Logged
Tom Carpenter (AstroEQ)

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #2 on: May 07, 2016, 16:44:44 »

Thanks for the reply Tom.

I'm beginning to think I should have etched a board for this! I cannot find a short 5v to ground anywhere. With the proto-board 5v disconnected the mega and proto-board are fine together. As I cannot find a short from the disconnected 5v wire and the only components connected are the two capacitors C1 and C3. I'll look at them next.

As I've just hand mixed around 1400 kgs of concrete I think I'll give it a miss tonight.  ;)



Phill
« Last Edit: May 07, 2016, 16:54:52 by Phill »
Logged
Phill

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #3 on: May 08, 2016, 13:56:06 »

I snipped the capacitors off the board and the fault went with them!

Just as a precaution I'll supply the proto-board with it's own fused 5v supply.
Logged
Phill

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Pin mapping
« Reply #4 on: May 08, 2016, 17:46:51 »

Was it the ceramic ones you cut off? It's sometimes possible if you use too much heat when soldering to cause ceramic caps to crack internally and short through.
Logged
Tom Carpenter (AstroEQ)

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #5 on: May 08, 2016, 20:05:14 »

It was. I'm usually pretty good with the iron, but you might be right. Since the board is finished apart from them, at least they will go on to the underside of the board last, which should help.

I have a radio circuit that doesn't work, that I put to one side. It was made from the same batch of capacitors, so I'll revisit it when I have time and swap them out as well. The new capacitors should be here this week.

Thanks again for the advice.

Regards
Logged
Phill

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #6 on: May 25, 2016, 19:17:06 »



I thought I was nearly there.

The motor seems to want to run. Initially it was just nodding so I checked the windings, which are fine. I increased the current limit to max on the A4988 but still not right.

When asking for sidereal rate tracking the motor spins about 5 times too quickly, but this is deceptive as it's not stepping, just vibrating round. There is no holding torque so the shaft can be turned by hand in either direction. A slew causes the motor to notch back and forth and then stop, but then the motor produces the sound I would expect as it ramps up. The sound remains until it slows at the end of the slew and then notches, and stops.

I'm not sure where to go from here.

Motor was removed from a working PICgoto system, and the A4988 was known to be working on a smaller stepper. The motor is a Longs Motor NEMA23 8 volt 1 amp unipolar, connected as a bipolar with the centre taps unconnected. The A4988 should be easily capable of driving this.

I've reloaded the firmware and configuration.

Any advice or suggestions greatly appreciated.

Phill
Logged
Phill

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Pin mapping
« Reply #7 on: May 26, 2016, 00:29:33 »

If it's vibrating, it means that you've got your motor wires crossed - if you end up with half of each coil swapped (so that each coil is not on a separate h-bridge), you end up not being able to step the motor properly resulting in exactly the behaviour you describe.

The solution is simply swap a wire from one coil with a wire from the other. It doesn't matter which, wire from each coil.
Logged
Tom Carpenter (AstroEQ)

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #8 on: May 26, 2016, 10:18:45 »

Thanks for the response Tom.

I rechecked all the connections and joints. Definitely not crossed wires, though I did swap them just to prove to myself I wasn't going senile.

Looks like another faulty drive board. I'll set up a minimum wiring board sometime while I'm waiting for the new drive boards to arrive. Then I can run the motor board combo and eliminate my work on the mega and breakout board.

I'll have to look in to a  new source for the A4988/DRV8825 boards as these Chinese ones just don't seem to cut the mustard.

Kind regards
Logged
Phill

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Pin mapping
« Reply #9 on: May 26, 2016, 13:58:07 »

I used to use http://www.proto-pic.co.uk before I started buying them in bulk directly from Pololu.
Logged
Tom Carpenter (AstroEQ)

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #10 on: May 26, 2016, 16:42:30 »

Thanks for the link Tom. I was tempted by Pololu as I know they have a great reputation, but $10 each and $18 postage is a little bit steep for me. There is only so much fun in building and testing 8) 8) 8) 8) I'll see what the test bed shows. If it is my Mega or breakout then I'll go search for my acid copper etch-ant in the shed. Sadly my laser printer went u/s a while ago but the local office supply shop will copy the circuit on to laser paper or film so that's one way to go.

If I'm not sorted by the time it starts to get dark early again I'll be adding my name to the list.

Regards
« Last Edit: May 26, 2016, 16:48:01 by Phill »
Logged
Phill

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #11 on: May 26, 2016, 19:36:17 »

Phhtttt!

Minimal circuit A4988 controlled from an UNO R3 did not work. For some reason I removed the plug cover and it works! Re did the joints and shrink wrap and re-installed the cover and still works!!

BUT, isn't there always a but, it's running at ~ sidereal rate x8, ie one motor rev per 6 seconds instead of 48. I've rechecked the config and all seems correct. I suspect it's full stepping instead of 8us so perhaps there is a problem with M1 M2 M3 connections or mapping? Should be high high low?



Regards

« Last Edit: May 26, 2016, 19:41:53 by Phill »
Logged
Phill

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Pin mapping
« Reply #12 on: May 26, 2016, 21:58:34 »

Check that the mode pins are wired up correctly (easiest to see if they are correct with a multimeter).
Logged
Tom Carpenter (AstroEQ)

Phill

  • Full Member
  • ***
  • Posts: 48
    • View Profile
Re: Pin mapping
« Reply #13 on: May 27, 2016, 15:15:55 »

Hi Tom, thanks for the help.

I've checked voltages with a multi meter and a small scope. The results are consistent on both, and between the drive board and arduino pins.

Status:

Cartes du Ciel sync'd and tracking M39.

RA motor running in full step mode.

Pin voltages
Code: [Select]
M0   RA                                    M1   DEC

Pin 5   0-5v square wave ~ 15ms wide.      Pin 12   0v
    4   0v                                     17   0v
    3   0v                                     16   5v
    2   0v                                     15   5v
    7   0v                                     18   0v
    8   0v                                     14   0v

Pinmapping

Code: [Select]

#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)

//---- User Configurable Pin Definitions for ATMegaXXX0 Variants -----
//Warning: D30 to D37 inclusive are NOT allowed
#define statusPin_Define 13

#define resetPin_0_Define 55 //Analog 1
#define resetPin_1_Define 54 //Analog 0

#define dirPin_0_Define 8
#define dirPin_1_Define 14

#define enablePin_0_Define 7
#define enablePin_1_Define 18

#define stepPin_0_Define 5
#define stepPin_1_Define 12

//#define ALTERNATE_ST4 //Uncomment this line to use the alternate mapping for the ST4 port, using A8 to A11 instead of 50 to 53

//You only have a choice between two locations for the ST4 pins as controlled by the above #define.
//It is possible to rearrange the pin within the set groups, e.g. you could switch 50 and 51, but
//all the ST4 pins must remain within either group of four as shown below.
#ifdef ALTERNATE_ST4
#define ST4AddPin_0_Define 62 //Analog 8
#define ST4AddPin_1_Define 63 //Analog 9
#define ST4SubPin_0_Define 64 //Analog 10
#define ST4SubPin_1_Define 65 //Analog 11
#else
#define ST4AddPin_0_Define 50
#define ST4AddPin_1_Define 51
#define ST4SubPin_0_Define 53
#define ST4SubPin_1_Define 52
#endif

#define modePins0_0_Define 4
#define modePins1_0_Define 3
#define modePins2_0_Define 2
#define modePins0_1_Define 17
#define modePins1_1_Define 16
#define modePins2_1_Define 15

#endif

// Do not modify anything below this line!
Kind regards
« Last Edit: May 27, 2016, 15:28:42 by TCWORLD »
Logged
Phill

TCWORLD

  • Administrator
  • *****
  • Posts: 809
    • View Profile
    • AstroEQ
Re: Pin mapping
« Reply #14 on: May 27, 2016, 15:33:02 »

Did you change the pin mappings? These are the official ones:

Code: [Select]
68 #define modePins0_0_Define 15
69 #define modePins1_0_Define 16
70 #define modePins2_0_Define 17
71 #define modePins0_1_Define 20
72 #define modePins1_1_Define 19
73 #define modePins2_1_Define 18

Your results are not consistent between the drivers - notice how the mode pins on the RA axis are '0 0 0' whereas on the DEC they are '0 5 5'. That would account for it moving 8 times faster.

What to the mode pins on both axes do when you do a manual slew (with the NESW buttons) at under 100x speed, and again at over 200x speed?
Logged
Tom Carpenter (AstroEQ)
Pages: [1] 2