Interfacing with a A4988 Stepper Motor Controller

Thread Starter

gatt427

Joined Jul 8, 2019
3
Hello,

As part of my first attempt at developing a PCB I am working with the A4988 stepper motor controller from Allegro Microsystems and there are a few things I don't understand about the chip (Datasheet Attached):
View attachment A4988-Datasheet.pdf

In the suggested usage diagram there are resistors connected to SENSE1 and SENSE2, but they are not assigned a value, how do I determine what to put there? I have the same question with the resistor on the ROSC pin.

What do these three pins do? The datasheet's description was not clear to me. My background is in mechanical engineering, so sorry if these are trivial questions.

Thanks,
Gatt427
 

AlbertHall

Joined Jun 4, 2014
12,346
Read the "internal pwm current control" and "fixed off time" sections of the datasheet.
In fact read all of the datasheet - probably several times.
 

Thread Starter

gatt427

Joined Jul 8, 2019
3
Read the "internal pwm current control" and "fixed off time" sections of the datasheet.
In fact read all of the datasheet - probably several times.
Thanks for the response.

To clarify, I understand that the SENSE1 and SENSE2 resistors are chosen from the equation ITripMAX = VREF /( 8×RS). I believe that VREF is supposed to be 0.5V as stated in the "Internal PWM Current Control" section, but that does not really make sense to me because in the "Absolute Maximums" section VREF is defined as 5.5V. I have no idea how to calculate ITripMAX as it seems to change per step, meaning for each of the five step settings there would be a different value (doesn't work out if step resolution changes during operation). This leaves me with one equation and two unknowns, so I am a bit lost here.

Similarly for ROSC, from what I understand, the ROSC pin turns off the power to the FET's and therefore the stepper motors at a set time. I do not understand when to use each of the three modes, which in turn means I do not know how to pick the resistor (if one is even needed).

I believe the issues I am having stems from my lack of electronics knowledge. After rereading the sections a few times I think I understand that the SENSE lines limit current into the motors, although I don't know why I need that. I also don't understand why the FET's need to turn off which explains why I don't know which mode to pick.
 

tsan

Joined Sep 6, 2014
138
To clarify, I understand that the SENSE1 and SENSE2 resistors are chosen from the equation ITripMAX = VREF /( 8×RS). I believe that VREF is supposed to be 0.5V as stated in the "Internal PWM Current Control" section, but that does not really make sense to me because in the "Absolute Maximums" section VREF is defined as 5.5V.
Note! I have never used A4988 so this is based on the datasheet information. On the electrical characteristics table, Vref is 0-4V. Let's select for example 2V, which can be made with voltage divider like shown in figure 8 (resistors R2 and R3).

I have no idea how to calculate ITripMAX as it seems to change per step, meaning for each of the five step settings there would be a different value (doesn't work out if step resolution changes during operation). This leaves me with one equation and two unknowns, so I am a bit lost here.
I read table 2 so, that only full step is ~70% of ITripMax and the others are 100%. Figures 9-13 shows the same, IMO. Example of Rsense for 1 A Itripmax with 2V Vref becomes 2V/1A/8 =0.25 ohm. Now we have to check, that voltage on Rsense pin will be below 0.5V. U=I*R=1A*0.25 ohm=0.25V->ok. Full step would have 0.7*1A=700mA current limit and other modes 1 A.

Similarly for ROSC, from what I understand, the ROSC pin turns off the power to the FET's and therefore the stepper motors at a set time. I do not understand when to use each of the three modes, which in turn means I do not know how to pick the resistor (if one is even needed).

I believe the issues I am having stems from my lack of electronics knowledge. After rereading the sections a few times I think I understand that the SENSE lines limit current into the motors, although I don't know why I need that. I also don't understand why the FET's need to turn off which explains why I don't know which mode to pick.
Recommended mode is automatic mixed decay mode, which is set when ROSC is tied to VDD. This is good to start with and gives lower current ripple. If there are missed steps, "Figure 2: Missed Steps in Low-Speed Microstepping", then ROSC can be tied to ground, but it results higher current ripple.

Current limit can be set according to motor current rating or lower, if mechanical system can't tolerate or require full motor power/torque. Sometimes, power supply is a limiting factor.
 
Top