Hi!
I will have some spare time to work on this project, so I'm trying to understand low level motor driving, and in particular want to move from "open loop" mode (in actual design, if I correctly understood, when a step command is given, the coils are driven to perform a step (by step I means a microstep if configured to perform microstep, not motor physical step) then if DISABLE_CORRECTION_TIMER is not set, a position correction is performed....
I didn't had a look into PID code yet....
so I need information about A4950 driver, because when I look into the datasheet, I don't understand how the PWM is used... there are diagram about the ripple introduced by the PWM, but it looks like the intensity isn't modulated... they says that the Iout is 3.4A at 100% duty cycle, but I don't get why 2 PWM entries?
at page 4 there is some logic information about how the inputs relates
seems that
- when the non PWM modulated input is low, the ouput has fast decay mode
- when the non PWM modulated input is high, the output is slow decay mode
- if I1 is modulated the motor is driven reverse
- if i2 is modulated the motor is driven forward
- only one input should be modulated at a time the other must be fixed
right?
is Iout = Iout(100%) * DuttyCycle ?
not related but to share my thoughts after some code review....
I think that current driving design is bad because the closed loop is in fact not used... when for example we issue a G6 D${Negative} R${rate} S${nbOfSteps} command, the TIM4(stepScheduleTimer) is activated at ${rate} and at each interrupt perform a step command, so it's open loop, the coils will have some intensity going through, and the magnet will try to allign, but it can go too fast and go further than the wanted position, so creating oscillation... I think this is why you created the PID feature, but I don't see how it could work with actual design...
I think that when a G6 D${Negative} R${rate} S${nbOfSteps} is issued, or when a step request is performed by STEP/DIR/EN interface, a final angle position should be computed, this final angle position should be issued to the position sensor driver, as well as duration, the position sensor driver should then drive the motor...
sensor driver can then filter the request (PID? linear?) and issue microstep move request, check the result, and perform feedback correction (not sure if we can keep the fast sine pre-computation, or at least pre-compute it for more than 1/32 microsteps)
Hi!
I will have some spare time to work on this project, so I'm trying to understand low level motor driving, and in particular want to move from "open loop" mode (in actual design, if I correctly understood, when a step command is given, the coils are driven to perform a step (by step I means a microstep if configured to perform microstep, not motor physical step) then if DISABLE_CORRECTION_TIMER is not set, a position correction is performed....
I didn't had a look into PID code yet....
so I need information about A4950 driver, because when I look into the datasheet, I don't understand how the PWM is used... there are diagram about the ripple introduced by the PWM, but it looks like the intensity isn't modulated... they says that the Iout is 3.4A at 100% duty cycle, but I don't get why 2 PWM entries?
at page 4 there is some logic information about how the inputs relates
seems that
right?
is Iout = Iout(100%) * DuttyCycle ?
not related but to share my thoughts after some code review....
I think that current driving design is bad because the closed loop is in fact not used... when for example we issue a
G6 D${Negative} R${rate} S${nbOfSteps}command, the TIM4(stepScheduleTimer) is activated at ${rate} and at each interrupt perform a step command, so it's open loop, the coils will have some intensity going through, and the magnet will try to allign, but it can go too fast and go further than the wanted position, so creating oscillation... I think this is why you created the PID feature, but I don't see how it could work with actual design...I think that when a
G6 D${Negative} R${rate} S${nbOfSteps}is issued, or when a step request is performed by STEP/DIR/EN interface, a final angle position should be computed, this final angle position should be issued to the position sensor driver, as well as duration, the position sensor driver should then drive the motor...sensor driver can then filter the request (PID? linear?) and issue microstep move request, check the result, and perform feedback correction (not sure if we can keep the fast sine pre-computation, or at least pre-compute it for more than 1/32 microsteps)