G30 Design Project Continued

If I want to test my stepper motor (Nema 17) before connecting it to my controller (to verify it didn’t receive to much current when the blue smoke monster attacked me), how would I connect it to my power supply? If red and blue are phase A, would I just connect the terminals to just that phase to make it go one direction? Or would A1 go to B1?

Connecting the wires of a stepper motor direct to a supply will do nothing other than give you what current it requires to hold it at that position. It won’t do any rotation. You need to pulse each in turn to get stepping.

@hwalker_MIWV, You can test the stepper motor with your multi meter. Measure the resistance of the wires against each other. For a bi polar stepper wire there should be 4 wires, typically red, blue, black and green. Two wires should so low resistance (i.e less than 100 Ohms) which the rest should be practically infinite.

If the motor moves then stops then you may be getting an over current problem (like I do).

The motor just vibrates. Only 1.8 V are making it to the phase leads.

Hm one thing i just realized I may have been connecting the motor wrong. Does Phase A1 go to A2 or B1? Also what could cause SPI to suddenly stop working?

If the motor is not wired correctly it won’t step in sequence and will appear to vibrate. Check your motor wiring.

What is the color of the motor wiring? From what I found in a search, most us the same colour code for the wires and ideal if you don’t know the actual wiring for your motor. This image might get you working as this is with the L6470

Touching blue and red together makes the motor lock up so that means they are on the same phase right?

I dont have the luxury of using the eval board unfortunately. Here is my wiring. I connected Phase A (red) to the Out A1 on the L6470 and Blue to the Out A2

I am almost positive my wiring is correct since it started moving when I disconnected the Cfly connecton in the boot strap circuit. It was very gittery motion but I don’t think that would have been possible if wired wrong. Seems like a timing issue. No matter how I set the K values it doesn’t move - it only get’s more or less stiff.

Any idea how to use intterupts with the L6470? I want to use the Go_Until command until an interrupt on my uC is triggered.

You want to use the Go_Until and interrupt on the µC is triggered? You could just send a HardStop command. Alternatively, you could wire the Switch input to the µC and use Go_Until SW command. That was the L6470 will stop when you send the SW pin high.

That would be a weird method of controlling the device though. Are you sure you can’t just send HardStop?

I need to hardstop when the position of the motor is next to my hall effect sensor to set a home position.

Could the hall effect be wired to the switch of the L6470? It seems like I would have more control / ability to record home position better if I send it to the uC

Yes the hall effect can be connected to the SW pin of the L6470.

I am in need of some help with interrupts. I have the hall effect sensor working for the most part - I can move the motor towards it, interrupt when raised high, and record home, but when moving away from home it seems like the interrupt is getting re-triggered so it stops after a few steps of moving away. Am I supposed to disable the interrupt after home is found the first time?

Yes, that would do.

it’s probably the hall effect sensor equivalent of switch bouncing. You can use many techniques to resolve it (like disable or ignore when you know your direction is going away from the switch, or checking the interval between interrupts)

1 Like

what kind of interrupt? Raising or falling edge or both? Sounds like both?

1 Like

Your code isn’t working it converts every number to 1.

I am trying to convert the register value of ABS_POS to its respective step value using:

int reg = 4161401
reg = ~reg;
reg =+ 1;

The register value is 4161401. What am I doing wrong?

I have the glitch filter set on the interruptPort settings.
I also do disable the interrupt after it triggers the first time.

I have the Interrupt Mode set to InterruptEdgeLevelLow. My hall effect is pulled low when actviated.