Electronics-Related.com
Forums

Stepping motor torque ripple

Started by Klaus Kragelund December 26, 2021
On 27/12/2021 00.44, jlarkin@highlandsniptechnology.com wrote:
> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund > <klauskvik@hotmail.com> wrote: > >> Hi >> >> >> I am working on a stepping motor driver >> >> >> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >> >> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >> >> >> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >> >> >> In fast decay mode the rising and falling didt is thus 1A/ms >> >> >> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >> >> >> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >> >> >> So the magnetic field will cause quite a bit of torque ripple. >> >> >> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >> >> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >> >> I don't see any mention of this, so it is probably insignificant... >> >> Regards >> >> >> Klaus > > I did a microstepper once, for tuning superconductive microwave > cavities in an accelerator. It used a uP and a pair of integrated > h-bridge drivers. > > It was basically a DDS synthesizer, a phase accumulator (representing > angular position) mapping into a sin-cos lookup table, which fetched > the duty cycle values to go into the pair of full h-bridges which > drove the motor coils. If the switching frequency is reasonably high, > there won't be noticable ripple torque. > > My basically constant-voltage drive caused torque to drop off at high > step rates, which wasn't a problem in that application. > > Most motors are imperfect in that you won't get smooth angular > position as a function of sin-cos coil currents; they basically have > distortion. That can be fudged in the trig lookup table if you really > need to. >
So, now I am getting closer to having first prototype ready I was doing the chopping control, peak current setting of the current in the coils, a loop in the microcontroller that would control this peak current with a DAC Thinking about it, seems like it is all to no good. Just using the PWM sine/cosine lookup table, with no feedback seems to work fine, provided the speed of the motor is significantly below the max specified speed. In that case BEMF has little effect, and really the winding resistance sets the current according to applied voltage Doing the open loop control would remove need for precise current sensing and DACs (all though they could just be PWM outputs). Also reduces the CPU resources needed for the control of the motor I will keep the comparator to check for shorted halfbridge, at least for now Cheers Klaus
On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund
<klauskvik@hotmail.com> wrote:

>On 27/12/2021 00.44, jlarkin@highlandsniptechnology.com wrote: >> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund >> <klauskvik@hotmail.com> wrote: >> >>> Hi >>> >>> >>> I am working on a stepping motor driver >>> >>> >>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >>> >>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >>> >>> >>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >>> >>> >>> In fast decay mode the rising and falling didt is thus 1A/ms >>> >>> >>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >>> >>> >>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >>> >>> >>> So the magnetic field will cause quite a bit of torque ripple. >>> >>> >>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >>> >>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >>> >>> I don't see any mention of this, so it is probably insignificant... >>> >>> Regards >>> >>> >>> Klaus >> >> I did a microstepper once, for tuning superconductive microwave >> cavities in an accelerator. It used a uP and a pair of integrated >> h-bridge drivers. >> >> It was basically a DDS synthesizer, a phase accumulator (representing >> angular position) mapping into a sin-cos lookup table, which fetched >> the duty cycle values to go into the pair of full h-bridges which >> drove the motor coils. If the switching frequency is reasonably high, >> there won't be noticable ripple torque. >> >> My basically constant-voltage drive caused torque to drop off at high >> step rates, which wasn't a problem in that application. >> >> Most motors are imperfect in that you won't get smooth angular >> position as a function of sin-cos coil currents; they basically have >> distortion. That can be fudged in the trig lookup table if you really >> need to. >> >So, now I am getting closer to having first prototype ready > >I was doing the chopping control, peak current setting of the current in >the coils, a loop in the microcontroller that would control this peak >current with a DAC > >Thinking about it, seems like it is all to no good. Just using the PWM >sine/cosine lookup table, with no feedback seems to work fine, provided >the speed of the motor is significantly below the max specified speed. >In that case BEMF has little effect, and really the winding resistance >sets the current according to applied voltage > >Doing the open loop control would remove need for precise current >sensing and DACs (all though they could just be PWM outputs). Also >reduces the CPU resources needed for the control of the motor > >I will keep the comparator to check for shorted halfbridge, at least for now > >Cheers > >Klaus > >
Constant-voltage PWM will result in torque rolloff at high step rates, and eventually stalling. More voltage with current feedback helps stuff current into the winding inductance. Some sort of pre-emphasis without feedback should work too. -- I yam what I yam - Popeye
mandag den 31. januar 2022 kl. 02.33.22 UTC+1 skrev jla...@highlandsniptechnology.com:
> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund > <klau...@hotmail.com> wrote: > > >On 27/12/2021 00.44, jla...@highlandsniptechnology.com wrote: > >> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund > >> <klau...@hotmail.com> wrote: > >> > >>> Hi > >>> > >>> > >>> I am working on a stepping motor driver > >>> > >>> > >>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 > >>> > >>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 > >>> > >>> > >>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA > >>> > >>> > >>> In fast decay mode the rising and falling didt is thus 1A/ms > >>> > >>> > >>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point > >>> > >>> > >>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% > >>> > >>> > >>> So the magnetic field will cause quite a bit of torque ripple. > >>> > >>> > >>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? > >>> > >>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple > >>> > >>> I don't see any mention of this, so it is probably insignificant... > >>> > >>> Regards > >>> > >>> > >>> Klaus > >> > >> I did a microstepper once, for tuning superconductive microwave > >> cavities in an accelerator. It used a uP and a pair of integrated > >> h-bridge drivers. > >> > >> It was basically a DDS synthesizer, a phase accumulator (representing > >> angular position) mapping into a sin-cos lookup table, which fetched > >> the duty cycle values to go into the pair of full h-bridges which > >> drove the motor coils. If the switching frequency is reasonably high, > >> there won't be noticable ripple torque. > >> > >> My basically constant-voltage drive caused torque to drop off at high > >> step rates, which wasn't a problem in that application. > >> > >> Most motors are imperfect in that you won't get smooth angular > >> position as a function of sin-cos coil currents; they basically have > >> distortion. That can be fudged in the trig lookup table if you really > >> need to. > >> > >So, now I am getting closer to having first prototype ready > > > >I was doing the chopping control, peak current setting of the current in > >the coils, a loop in the microcontroller that would control this peak > >current with a DAC > > > >Thinking about it, seems like it is all to no good. Just using the PWM > >sine/cosine lookup table, with no feedback seems to work fine, provided > >the speed of the motor is significantly below the max specified speed. > >In that case BEMF has little effect, and really the winding resistance > >sets the current according to applied voltage > > > >Doing the open loop control would remove need for precise current > >sensing and DACs (all though they could just be PWM outputs). Also > >reduces the CPU resources needed for the control of the motor > > > >I will keep the comparator to check for shorted halfbridge, at least for now > > > >Cheers > > > >Klaus > > > > > Constant-voltage PWM will result in torque rolloff at high step rates, > and eventually stalling. More voltage with current feedback helps > stuff current into the winding inductance. > > Some sort of pre-emphasis without feedback should work too.
page 38, https://www.st.com/resource/en/datasheet/powerstep01.pdf
On 31/01/2022 02.33, jlarkin@highlandsniptechnology.com wrote:
> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund > <klauskvik@hotmail.com> wrote: > >> On 27/12/2021 00.44, jlarkin@highlandsniptechnology.com wrote: >>> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund >>> <klauskvik@hotmail.com> wrote: >>> >>>> Hi >>>> >>>> >>>> I am working on a stepping motor driver >>>> >>>> >>>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >>>> >>>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >>>> >>>> >>>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >>>> >>>> >>>> In fast decay mode the rising and falling didt is thus 1A/ms >>>> >>>> >>>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >>>> >>>> >>>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >>>> >>>> >>>> So the magnetic field will cause quite a bit of torque ripple. >>>> >>>> >>>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >>>> >>>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >>>> >>>> I don't see any mention of this, so it is probably insignificant... >>>> >>>> Regards >>>> >>>> >>>> Klaus >>> >>> I did a microstepper once, for tuning superconductive microwave >>> cavities in an accelerator. It used a uP and a pair of integrated >>> h-bridge drivers. >>> >>> It was basically a DDS synthesizer, a phase accumulator (representing >>> angular position) mapping into a sin-cos lookup table, which fetched >>> the duty cycle values to go into the pair of full h-bridges which >>> drove the motor coils. If the switching frequency is reasonably high, >>> there won't be noticable ripple torque. >>> >>> My basically constant-voltage drive caused torque to drop off at high >>> step rates, which wasn't a problem in that application. >>> >>> Most motors are imperfect in that you won't get smooth angular >>> position as a function of sin-cos coil currents; they basically have >>> distortion. That can be fudged in the trig lookup table if you really >>> need to. >>> >> So, now I am getting closer to having first prototype ready >> >> I was doing the chopping control, peak current setting of the current in >> the coils, a loop in the microcontroller that would control this peak >> current with a DAC >> >> Thinking about it, seems like it is all to no good. Just using the PWM >> sine/cosine lookup table, with no feedback seems to work fine, provided >> the speed of the motor is significantly below the max specified speed. >> In that case BEMF has little effect, and really the winding resistance >> sets the current according to applied voltage >> >> Doing the open loop control would remove need for precise current >> sensing and DACs (all though they could just be PWM outputs). Also >> reduces the CPU resources needed for the control of the motor >> >> I will keep the comparator to check for shorted halfbridge, at least for now >> >> Cheers >> >> Klaus >> >> > > Constant-voltage PWM will result in torque rolloff at high step rates, > and eventually stalling. More voltage with current feedback helps > stuff current into the winding inductance. >
Yes, that's why I wrote that my application has: "the speed of the motor is significantly below the max specified speed"
> Some sort of pre-emphasis without feedback should work too. >
In some cases the voltage PWM is better than current mode controlled. For example, around the zero crossing where current feedback has distortion
On 31/01/2022 02.46, Lasse Langwadt Christensen wrote:
> mandag den 31. januar 2022 kl. 02.33.22 UTC+1 skrev jla...@highlandsniptechnology.com: >> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund >> <klau...@hotmail.com> wrote: >> >>> On 27/12/2021 00.44, jla...@highlandsniptechnology.com wrote: >>>> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund >>>> <klau...@hotmail.com> wrote: >>>> >>>>> Hi >>>>> >>>>> >>>>> I am working on a stepping motor driver >>>>> >>>>> >>>>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >>>>> >>>>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >>>>> >>>>> >>>>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >>>>> >>>>> >>>>> In fast decay mode the rising and falling didt is thus 1A/ms >>>>> >>>>> >>>>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >>>>> >>>>> >>>>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >>>>> >>>>> >>>>> So the magnetic field will cause quite a bit of torque ripple. >>>>> >>>>> >>>>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >>>>> >>>>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >>>>> >>>>> I don't see any mention of this, so it is probably insignificant... >>>>> >>>>> Regards >>>>> >>>>> >>>>> Klaus >>>> >>>> I did a microstepper once, for tuning superconductive microwave >>>> cavities in an accelerator. It used a uP and a pair of integrated >>>> h-bridge drivers. >>>> >>>> It was basically a DDS synthesizer, a phase accumulator (representing >>>> angular position) mapping into a sin-cos lookup table, which fetched >>>> the duty cycle values to go into the pair of full h-bridges which >>>> drove the motor coils. If the switching frequency is reasonably high, >>>> there won't be noticable ripple torque. >>>> >>>> My basically constant-voltage drive caused torque to drop off at high >>>> step rates, which wasn't a problem in that application. >>>> >>>> Most motors are imperfect in that you won't get smooth angular >>>> position as a function of sin-cos coil currents; they basically have >>>> distortion. That can be fudged in the trig lookup table if you really >>>> need to. >>>> >>> So, now I am getting closer to having first prototype ready >>> >>> I was doing the chopping control, peak current setting of the current in >>> the coils, a loop in the microcontroller that would control this peak >>> current with a DAC >>> >>> Thinking about it, seems like it is all to no good. Just using the PWM >>> sine/cosine lookup table, with no feedback seems to work fine, provided >>> the speed of the motor is significantly below the max specified speed. >>> In that case BEMF has little effect, and really the winding resistance >>> sets the current according to applied voltage >>> >>> Doing the open loop control would remove need for precise current >>> sensing and DACs (all though they could just be PWM outputs). Also >>> reduces the CPU resources needed for the control of the motor >>> >>> I will keep the comparator to check for shorted halfbridge, at least for now >>> >>> Cheers >>> >>> Klaus >>> >>> >> Constant-voltage PWM will result in torque rolloff at high step rates, >> and eventually stalling. More voltage with current feedback helps >> stuff current into the winding inductance. >> >> Some sort of pre-emphasis without feedback should work too. > > page 38, https://www.st.com/resource/en/datasheet/powerstep01.pdf >
Nice detailed datasheet, to learn from :-)
On Mon, 31 Jan 2022 11:53:59 +0100, Klaus Vestergaard Kragelund
<klauskvik@hotmail.com> wrote:

>On 31/01/2022 02.33, jlarkin@highlandsniptechnology.com wrote: >> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund >> <klauskvik@hotmail.com> wrote: >> >>> On 27/12/2021 00.44, jlarkin@highlandsniptechnology.com wrote: >>>> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund >>>> <klauskvik@hotmail.com> wrote: >>>> >>>>> Hi >>>>> >>>>> >>>>> I am working on a stepping motor driver >>>>> >>>>> >>>>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >>>>> >>>>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >>>>> >>>>> >>>>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >>>>> >>>>> >>>>> In fast decay mode the rising and falling didt is thus 1A/ms >>>>> >>>>> >>>>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >>>>> >>>>> >>>>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >>>>> >>>>> >>>>> So the magnetic field will cause quite a bit of torque ripple. >>>>> >>>>> >>>>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >>>>> >>>>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >>>>> >>>>> I don't see any mention of this, so it is probably insignificant... >>>>> >>>>> Regards >>>>> >>>>> >>>>> Klaus >>>> >>>> I did a microstepper once, for tuning superconductive microwave >>>> cavities in an accelerator. It used a uP and a pair of integrated >>>> h-bridge drivers. >>>> >>>> It was basically a DDS synthesizer, a phase accumulator (representing >>>> angular position) mapping into a sin-cos lookup table, which fetched >>>> the duty cycle values to go into the pair of full h-bridges which >>>> drove the motor coils. If the switching frequency is reasonably high, >>>> there won't be noticable ripple torque. >>>> >>>> My basically constant-voltage drive caused torque to drop off at high >>>> step rates, which wasn't a problem in that application. >>>> >>>> Most motors are imperfect in that you won't get smooth angular >>>> position as a function of sin-cos coil currents; they basically have >>>> distortion. That can be fudged in the trig lookup table if you really >>>> need to. >>>> >>> So, now I am getting closer to having first prototype ready >>> >>> I was doing the chopping control, peak current setting of the current in >>> the coils, a loop in the microcontroller that would control this peak >>> current with a DAC >>> >>> Thinking about it, seems like it is all to no good. Just using the PWM >>> sine/cosine lookup table, with no feedback seems to work fine, provided >>> the speed of the motor is significantly below the max specified speed. >>> In that case BEMF has little effect, and really the winding resistance >>> sets the current according to applied voltage >>> >>> Doing the open loop control would remove need for precise current >>> sensing and DACs (all though they could just be PWM outputs). Also >>> reduces the CPU resources needed for the control of the motor >>> >>> I will keep the comparator to check for shorted halfbridge, at least for now >>> >>> Cheers >>> >>> Klaus >>> >>> >> >> Constant-voltage PWM will result in torque rolloff at high step rates, >> and eventually stalling. More voltage with current feedback helps >> stuff current into the winding inductance. >> > >Yes, that's why I wrote that my application has: "the speed of the motor >is significantly below the max specified speed" > > >> Some sort of pre-emphasis without feedback should work too. >> > >In some cases the voltage PWM is better than current mode controlled. >For example, around the zero crossing where current feedback has distortion
Not to change the subject (never!) I've been experimenting with the jitter implications of PWM, namely how precise in time can a PWM system be? Better than the PWM period? How much better? It's an interesting perversion of the Shannon/Nyquist sampling theorem. Maybe I'll post some sims. -- I yam what I yam - Popeye
On Monday, January 31, 2022 at 7:18:38 AM UTC-8, jla...@highlandsniptechnology.com wrote:

>... I've been experimenting with the > jitter implications of PWM, namely how precise in time can a PWM > system be? Better than the PWM period? How much better?
PWM is waveform generation; you can synchronize a feature of that waveform with good precision, and the PWM period only determines the (at steady-state) repetition interval, not the features within that interval. Useful examples of PWM usually alter the features according to some criterion other than timing, i.e. output voltage under load. What specific time precision is under consideration? Old IBM game controllers got pinged at a crystal-clock-synchronized interval, and gave 8-bit resolution.
On 31/01/2022 16.18, jlarkin@highlandsniptechnology.com wrote:
> On Mon, 31 Jan 2022 11:53:59 +0100, Klaus Vestergaard Kragelund > <klauskvik@hotmail.com> wrote: > >> On 31/01/2022 02.33, jlarkin@highlandsniptechnology.com wrote: >>> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund >>> <klauskvik@hotmail.com> wrote: >>> >>>> On 27/12/2021 00.44, jlarkin@highlandsniptechnology.com wrote: >>>>> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund >>>>> <klauskvik@hotmail.com> wrote: >>>>> >>>>>> Hi >>>>>> >>>>>> >>>>>> I am working on a stepping motor driver >>>>>> >>>>>> >>>>>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >>>>>> >>>>>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >>>>>> >>>>>> >>>>>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >>>>>> >>>>>> >>>>>> In fast decay mode the rising and falling didt is thus 1A/ms >>>>>> >>>>>> >>>>>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >>>>>> >>>>>> >>>>>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >>>>>> >>>>>> >>>>>> So the magnetic field will cause quite a bit of torque ripple. >>>>>> >>>>>> >>>>>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >>>>>> >>>>>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >>>>>> >>>>>> I don't see any mention of this, so it is probably insignificant... >>>>>> >>>>>> Regards >>>>>> >>>>>> >>>>>> Klaus >>>>> >>>>> I did a microstepper once, for tuning superconductive microwave >>>>> cavities in an accelerator. It used a uP and a pair of integrated >>>>> h-bridge drivers. >>>>> >>>>> It was basically a DDS synthesizer, a phase accumulator (representing >>>>> angular position) mapping into a sin-cos lookup table, which fetched >>>>> the duty cycle values to go into the pair of full h-bridges which >>>>> drove the motor coils. If the switching frequency is reasonably high, >>>>> there won't be noticable ripple torque. >>>>> >>>>> My basically constant-voltage drive caused torque to drop off at high >>>>> step rates, which wasn't a problem in that application. >>>>> >>>>> Most motors are imperfect in that you won't get smooth angular >>>>> position as a function of sin-cos coil currents; they basically have >>>>> distortion. That can be fudged in the trig lookup table if you really >>>>> need to. >>>>> >>>> So, now I am getting closer to having first prototype ready >>>> >>>> I was doing the chopping control, peak current setting of the current in >>>> the coils, a loop in the microcontroller that would control this peak >>>> current with a DAC >>>> >>>> Thinking about it, seems like it is all to no good. Just using the PWM >>>> sine/cosine lookup table, with no feedback seems to work fine, provided >>>> the speed of the motor is significantly below the max specified speed. >>>> In that case BEMF has little effect, and really the winding resistance >>>> sets the current according to applied voltage >>>> >>>> Doing the open loop control would remove need for precise current >>>> sensing and DACs (all though they could just be PWM outputs). Also >>>> reduces the CPU resources needed for the control of the motor >>>> >>>> I will keep the comparator to check for shorted halfbridge, at least for now >>>> >>>> Cheers >>>> >>>> Klaus >>>> >>>> >>> >>> Constant-voltage PWM will result in torque rolloff at high step rates, >>> and eventually stalling. More voltage with current feedback helps >>> stuff current into the winding inductance. >>> >> >> Yes, that's why I wrote that my application has: "the speed of the motor >> is significantly below the max specified speed" >> >> >>> Some sort of pre-emphasis without feedback should work too. >>> >> >> In some cases the voltage PWM is better than current mode controlled. >> For example, around the zero crossing where current feedback has distortion > > Not to change the subject (never!) I've been experimenting with the > jitter implications of PWM, namely how precise in time can a PWM > system be? Better than the PWM period? How much better? >
Can you elaborate on that? The PWM of a microcontroller is a combination of the clock jitter and the jitter of the PWM counter/compare capture unit, plus noise on the supply I guess
On Tue, 1 Feb 2022 01:09:16 +0100, Klaus Vestergaard Kragelund
<klauskvik@hotmail.com> wrote:

>On 31/01/2022 16.18, jlarkin@highlandsniptechnology.com wrote: >> On Mon, 31 Jan 2022 11:53:59 +0100, Klaus Vestergaard Kragelund >> <klauskvik@hotmail.com> wrote: >> >>> On 31/01/2022 02.33, jlarkin@highlandsniptechnology.com wrote: >>>> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund >>>> <klauskvik@hotmail.com> wrote: >>>> >>>>> On 27/12/2021 00.44, jlarkin@highlandsniptechnology.com wrote: >>>>>> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund >>>>>> <klauskvik@hotmail.com> wrote: >>>>>> >>>>>>> Hi >>>>>>> >>>>>>> >>>>>>> I am working on a stepping motor driver >>>>>>> >>>>>>> >>>>>>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 >>>>>>> >>>>>>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 >>>>>>> >>>>>>> >>>>>>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA >>>>>>> >>>>>>> >>>>>>> In fast decay mode the rising and falling didt is thus 1A/ms >>>>>>> >>>>>>> >>>>>>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point >>>>>>> >>>>>>> >>>>>>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% >>>>>>> >>>>>>> >>>>>>> So the magnetic field will cause quite a bit of torque ripple. >>>>>>> >>>>>>> >>>>>>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? >>>>>>> >>>>>>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple >>>>>>> >>>>>>> I don't see any mention of this, so it is probably insignificant... >>>>>>> >>>>>>> Regards >>>>>>> >>>>>>> >>>>>>> Klaus >>>>>> >>>>>> I did a microstepper once, for tuning superconductive microwave >>>>>> cavities in an accelerator. It used a uP and a pair of integrated >>>>>> h-bridge drivers. >>>>>> >>>>>> It was basically a DDS synthesizer, a phase accumulator (representing >>>>>> angular position) mapping into a sin-cos lookup table, which fetched >>>>>> the duty cycle values to go into the pair of full h-bridges which >>>>>> drove the motor coils. If the switching frequency is reasonably high, >>>>>> there won't be noticable ripple torque. >>>>>> >>>>>> My basically constant-voltage drive caused torque to drop off at high >>>>>> step rates, which wasn't a problem in that application. >>>>>> >>>>>> Most motors are imperfect in that you won't get smooth angular >>>>>> position as a function of sin-cos coil currents; they basically have >>>>>> distortion. That can be fudged in the trig lookup table if you really >>>>>> need to. >>>>>> >>>>> So, now I am getting closer to having first prototype ready >>>>> >>>>> I was doing the chopping control, peak current setting of the current in >>>>> the coils, a loop in the microcontroller that would control this peak >>>>> current with a DAC >>>>> >>>>> Thinking about it, seems like it is all to no good. Just using the PWM >>>>> sine/cosine lookup table, with no feedback seems to work fine, provided >>>>> the speed of the motor is significantly below the max specified speed. >>>>> In that case BEMF has little effect, and really the winding resistance >>>>> sets the current according to applied voltage >>>>> >>>>> Doing the open loop control would remove need for precise current >>>>> sensing and DACs (all though they could just be PWM outputs). Also >>>>> reduces the CPU resources needed for the control of the motor >>>>> >>>>> I will keep the comparator to check for shorted halfbridge, at least for now >>>>> >>>>> Cheers >>>>> >>>>> Klaus >>>>> >>>>> >>>> >>>> Constant-voltage PWM will result in torque rolloff at high step rates, >>>> and eventually stalling. More voltage with current feedback helps >>>> stuff current into the winding inductance. >>>> >>> >>> Yes, that's why I wrote that my application has: "the speed of the motor >>> is significantly below the max specified speed" >>> >>> >>>> Some sort of pre-emphasis without feedback should work too. >>>> >>> >>> In some cases the voltage PWM is better than current mode controlled. >>> For example, around the zero crossing where current feedback has distortion >> >> Not to change the subject (never!) I've been experimenting with the >> jitter implications of PWM, namely how precise in time can a PWM >> system be? Better than the PWM period? How much better? >> > >Can you elaborate on that? > >The PWM of a microcontroller is a combination of the clock jitter and >the jitter of the PWM counter/compare capture unit, plus noise on the >supply I guess
The abstract problem is to send a DC-coupled logic level over an AC-coupled telecom-type link. Imagine the link has AGC or logic repeaters so we can't send different amplitudes to code things. One could lowpass filter the logic input, sample and digitize, send the sample values in serial packets, deserialize and DAC and filter and compare at the receiver. Pure Shannon Sampling Theorem with some ADC quantization. Slow and painful. FSK would work but would be very slow and maybe jitterey. OOK would be really ugly over a telecom type link. PWM might work. I'm thinking about PWM at a "carrier" pulse clock rate of, say, 1 GHz. 30% duty cycle is a 0, 70% is a 1. The logic level to be sent is not synchronized to the PWM clock. It will certainly work, but what's the jitter like? Can it be less than the 1 ns PWM pulse period? I'm thinking it can. It's just a thought experiment, with a bit of Spicing, right now. -- If a man will begin with certainties, he shall end with doubts, but if he will be content to begin with doubts he shall end in certainties. Francis Bacon
tirsdag den 1. februar 2022 kl. 01.40.26 UTC+1 skrev John Larkin:
> On Tue, 1 Feb 2022 01:09:16 +0100, Klaus Vestergaard Kragelund > <klau...@hotmail.com> wrote: > > >On 31/01/2022 16.18, jla...@highlandsniptechnology.com wrote: > >> On Mon, 31 Jan 2022 11:53:59 +0100, Klaus Vestergaard Kragelund > >> <klau...@hotmail.com> wrote: > >> > >>> On 31/01/2022 02.33, jla...@highlandsniptechnology.com wrote: > >>>> On Mon, 31 Jan 2022 01:52:20 +0100, Klaus Vestergaard Kragelund > >>>> <klau...@hotmail.com> wrote: > >>>> > >>>>> On 27/12/2021 00.44, jla...@highlandsniptechnology.com wrote: > >>>>>> On Sun, 26 Dec 2021 23:38:44 +0100, Klaus Kragelund > >>>>>> <klau...@hotmail.com> wrote: > >>>>>> > >>>>>>> Hi > >>>>>>> > >>>>>>> > >>>>>>> I am working on a stepping motor driver > >>>>>>> > >>>>>>> > >>>>>>> To reduce cost I will be making a discrete driver stage driven from a microcontroller that has all the control features that would normally be included in a micrstepping driver like the A4988 > >>>>>>> > >>>>>>> https://www.allegromicro.com/en/products/motor-drivers/brush-dc-motor-drivers/a4988 > >>>>>>> > >>>>>>> > >>>>>>> For easy calculation let's say the power stage is driven from 10V and the stepping motor has an inductance of 10mH and the peak current is 100mA > >>>>>>> > >>>>>>> > >>>>>>> In fast decay mode the rising and falling didt is thus 1A/ms > >>>>>>> > >>>>>>> > >>>>>>> For micro stepping the current in the 2 phases are set to place the armature in between a full step. So for a position 50% between two steps the currents in the windings are the same to have a resulting vector at that point > >>>>>>> > >>>>>>> > >>>>>>> If the on time is 5us, the ripple current is 5mApp. So, the current ripple is 5% of the nominal peak current. For lower excitation, at 10mA peak drive, the ripple is 50% > >>>>>>> > >>>>>>> > >>>>>>> So the magnetic field will cause quite a bit of torque ripple. > >>>>>>> > >>>>>>> > >>>>>>> Will this have any impact on the drive of the motor, or is the inertia so big that it is insignificant? > >>>>>>> > >>>>>>> Also, at other positions than 50%, the ripple with not cancel out between the phases and generate even more torque ripple > >>>>>>> > >>>>>>> I don't see any mention of this, so it is probably insignificant... > >>>>>>> > >>>>>>> Regards > >>>>>>> > >>>>>>> > >>>>>>> Klaus > >>>>>> > >>>>>> I did a microstepper once, for tuning superconductive microwave > >>>>>> cavities in an accelerator. It used a uP and a pair of integrated > >>>>>> h-bridge drivers. > >>>>>> > >>>>>> It was basically a DDS synthesizer, a phase accumulator (representing > >>>>>> angular position) mapping into a sin-cos lookup table, which fetched > >>>>>> the duty cycle values to go into the pair of full h-bridges which > >>>>>> drove the motor coils. If the switching frequency is reasonably high, > >>>>>> there won't be noticable ripple torque. > >>>>>> > >>>>>> My basically constant-voltage drive caused torque to drop off at high > >>>>>> step rates, which wasn't a problem in that application. > >>>>>> > >>>>>> Most motors are imperfect in that you won't get smooth angular > >>>>>> position as a function of sin-cos coil currents; they basically have > >>>>>> distortion. That can be fudged in the trig lookup table if you really > >>>>>> need to. > >>>>>> > >>>>> So, now I am getting closer to having first prototype ready > >>>>> > >>>>> I was doing the chopping control, peak current setting of the current in > >>>>> the coils, a loop in the microcontroller that would control this peak > >>>>> current with a DAC > >>>>> > >>>>> Thinking about it, seems like it is all to no good. Just using the PWM > >>>>> sine/cosine lookup table, with no feedback seems to work fine, provided > >>>>> the speed of the motor is significantly below the max specified speed. > >>>>> In that case BEMF has little effect, and really the winding resistance > >>>>> sets the current according to applied voltage > >>>>> > >>>>> Doing the open loop control would remove need for precise current > >>>>> sensing and DACs (all though they could just be PWM outputs). Also > >>>>> reduces the CPU resources needed for the control of the motor > >>>>> > >>>>> I will keep the comparator to check for shorted halfbridge, at least for now > >>>>> > >>>>> Cheers > >>>>> > >>>>> Klaus > >>>>> > >>>>> > >>>> > >>>> Constant-voltage PWM will result in torque rolloff at high step rates, > >>>> and eventually stalling. More voltage with current feedback helps > >>>> stuff current into the winding inductance. > >>>> > >>> > >>> Yes, that's why I wrote that my application has: "the speed of the motor > >>> is significantly below the max specified speed" > >>> > >>> > >>>> Some sort of pre-emphasis without feedback should work too. > >>>> > >>> > >>> In some cases the voltage PWM is better than current mode controlled. > >>> For example, around the zero crossing where current feedback has distortion > >> > >> Not to change the subject (never!) I've been experimenting with the > >> jitter implications of PWM, namely how precise in time can a PWM > >> system be? Better than the PWM period? How much better? > >> > > > >Can you elaborate on that? > > > >The PWM of a microcontroller is a combination of the clock jitter and > >the jitter of the PWM counter/compare capture unit, plus noise on the > >supply I guess > The abstract problem is to send a DC-coupled logic level over an > AC-coupled telecom-type link. Imagine the link has AGC or logic > repeaters so we can't send different amplitudes to code things. > > One could lowpass filter the logic input, sample and digitize, send > the sample values in serial packets, deserialize and DAC and filter > and compare at the receiver. Pure Shannon Sampling Theorem with some > ADC quantization. Slow and painful. > > FSK would work but would be very slow and maybe jitterey. OOK would be > really ugly over a telecom type link. PWM might work. > > I'm thinking about PWM at a "carrier" pulse clock rate of, say, 1 GHz. > 30% duty cycle is a 0, 70% is a 1. The logic level to be sent is not > synchronized to the PWM clock. > > It will certainly work, but what's the jitter like? Can it be less > than the 1 ns PWM pulse period? I'm thinking it can. > > It's just a thought experiment, with a bit of Spicing, right now.
will your duty cycle survive the AC coupling on the link? isn't such things normally DC balanced with bit stuffing or similar?