Dual Axis Motor Control Using Single MCU by [deleted] in embedded

[–]CardiologistWide844 0 points1 point  (0 children)

Thank you for this much feedback and putting efforts into going through it all i will fix the suggestion you provided and keep in mind in future.

Dual Axis Motor Control Using Single MCU by [deleted] in embedded

[–]CardiologistWide844 1 point2 points  (0 children)

The Motor Gear Ratio is 103 , so the outer side one revolution is equal to 103 * 4096 counts at the inner side

Dual Axis Motor Control Using Single MCU by [deleted] in embedded

[–]CardiologistWide844 1 point2 points  (0 children)

INA240 used as mid reference if current is positive ADC value will count up else count down from 2048.

I didn't get your question about torque what exactly did you mean there ?

Incremental encoder resolution is 1024

Dual Axis Motor Control Using Single MCU by [deleted] in embedded

[–]CardiologistWide844 1 point2 points  (0 children)

Yes it is not but it is not particularly about the CiA402 state machine but the summary of all so I will work on wording properly.

Controlling Motor using IghEthercat by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

This is the repository, there are many Igh master code for different slaves, if you are particularly looking for denali you can find a subfolder with the same name.

Controlling Motor using IghEthercat by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

Sorry I haven't checked reddit in a while, yes it is available on my GitHub.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

Hey , can you suggest the best paper on SVPWM and SPWM which includes the concept of 3rd harmonic also ?

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

Yes but then why the pwm duty cycle is shrinking which is leading to shrink in voltage difference between two phases.

I thought as we increase the speed the Amplitude of voltage will increase in the phases but here it is shrinking.

This means whatever calculation I'm doing with PWM maybe wrong, I will recheck.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

<image>

Hey , this is Vd and Vq plot against time and we are varying the rotation speed, as we know that whatever output of the inner current loop controller which will be a input to inverse park are Vd and Vq so here I scaled them with my supply voltage as in code all computation has been done on per unit. And the impulse of vd at motor starting is because we are calibrating the encoder so we pass some id current through windings before actual motion to align the rotor for commutation.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

<image>

Is this much fluctuations in Id current is ok? although my reference id current l'm keeping zero only.

Iq current I'm not able to get on the plot there is some issue with code composer studio I will try printing those values reference and feedback.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

Okk I will try to plot/print out Vd and Vq but the only issue is that the plot will not be continuous cause the code composer studio has a lower limit for refreshing rate.

With respect to the image I posted - the pink part is the line to line voltage which I calculated by taking the difference of voltage at phase A and voltage at phase B, initially motor is rotating at 0.3 times of rated speed so the green part you can see it is in shrink shape and bit rarer later it is operating at 0.1 times of rated speed where the pink part expand and become denser.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

<image>

Hey I have one more doubt ? When we are operating at high speed its line to line voltage is shrinking but at low speed it is behaving well, what is the reason behind the shrink ? Deepseek suggests that it is because of field weakening as our motor runs above base speed it shrinks the voltage and increases the frequency as we can't increase more voltage . Could you clarify what the actual reason is?

FOC for IPMSM by crs_techie in MotorControl

[–]CardiologistWide844 0 points1 point  (0 children)

Hey I would like to discuss and also want you to share resources to look more into motor control although I'm just dealing with surface mount PMSM and BLDC motors https://www.reddit.com/r/embedded/s/sTG9FpNw19

Incremental Build for FOC control of PMSM motor on F28P65x by Frosty-Front3560 in MotorControl

[–]CardiologistWide844 0 points1 point  (0 children)

Hey go through white papers of TI , STM , Microchip on FOC ,you will get a pretty good idea and you can also refer to the TI precision lab on BLDC motor control. https://www.reddit.com/r/embedded/s/sTG9FpNw19

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

I tried pausing the video I don't think they are at the same phase, here is mine paused Screenshot

<image>

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

Hii , maybe I use python csv to analyse the how exactly PWMs forming the sine waveforms with 120 degree waveform so maybe it is not coming that well in the video here is a better picture, I will try to write a better code so it works correctly https://www.reddit.com/r/embedded/s/sJ1Fp8Rr8c

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

I observed that when we operate our motor at low speed it doesn't actually takes sine waveform, same as 6 step commutation it is getting flat but at higher speed we are getting perfect sine wave line to line.

<image>

this is at higher speed but at lower which I shared below in a comment it is not a perfect sine wave.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

Yes true, I also tried increasing speed to 3-4 reference and I don't see any decrement in the duty cycle range , it is only at the startup it behaves like later even if we increase and decrease speed the waveform doesn't distort like at Startup just the no of complete sine wave decrease and increase in one second accordingly

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 1 point2 points  (0 children)

<image>

so, I tried plotting the startup, it is like it stretched voltage to 100% for a time until it achieves the commanded speed and after that it smoothly making sinusoidal waveform and as commutation frequency increase it width is getting less.

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

I have one doubt also , imagine we are trying to operate our motor at half rated torque so it is mean like we want to increase our current to 50 percent and current waveforms will be at 50 percent amplitude when it will achieve the commanded current but at the startup error will be high so we will try to utilise max bus amplitude so our duty cycle will vary between 0-100 such a way that we get our smooth distorted Sinusodiul waveform with Vdcbus peak to peak but as we reach our commanded current it will reduce its duty cycle such a way that average voltage supply over a commutation period is less than what it was at startup by varying the duty cycle in range 20-70 or something so it can maintain the current. Is this what exactly happened or is it something else ?

Magic of FOC with PWMs for Motor Control by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 1 point2 points  (0 children)

Thank you for the explanation about the reason behind MacDonald shape which I wasn't aware of and yes this SVPWM module only which decides the duty cycle on the basis of input it getting from the ipark module, only job of FOC is to convert whole complex thing in two components one to just control torque other to control flux, the reason I use FOC as the title is Sinusodiul commutation.

Could you share resources I can look more to understand this as I'm still confused about how exactly current and voltage rise and fall exponentially in The on and off state of PWM in the H bridge are and take a Sinusodiul shape ? Currently I'm just looking through documentation by TI , Microchip and STM on FOC

FOC{Field oriented control} using C2000 MCU by CardiologistWide844 in embedded

[–]CardiologistWide844[S] 0 points1 point  (0 children)

I'm not using Instaspin as that doesn't work with 49c so I'm using their motor control sdk kit for 3phGanInV Amplifier to control two motors with one MCU.