Hi Mihai,
later I read that you use Eclipse and gcc. Dont be afraid about my question. Now I install Eclipse, but its very difficult.
Thanks
Hans
Hi Mihai,
later I read that you use Eclipse and gcc. Dont be afraid about my question. Now I install Eclipse, but its very difficult.
Thanks
Hans
New firmware 1.2 (Zip contains source and hex file, bootloader binary file, and dfu firmware update file for those who want to upgrade via Servo Drive Tuner program)
Thanks to Pekkas suggestion, PID calculation is moved on a timer (10kHz). As he said, the I and D part from the PID should be more stable like this as PID calculation happens at predefined intervals.
Mihai
Hello,
yesterday I get the isolated current sensors. I will see what happend when the IC gets 30Ampere.
Attachment 298534
Hans
Mihai,
just a thought, I was wondering if the brushless motors like the kind used on the R/C planes (equipped with a proper encoder mounted in the motor shaft), can be driven by your DIY BLDC / DC Motor Servo Drive ?
Max
Yes, RC brushless motors can be used... However I've seen they are basically build for high rpm speeds...
Mihai
Hi Mihai, I'm still waiting for delivery of the ST32 module and currently sorting the pcb design, I see that your schematic shows current sensing off of R25, What's the max current threshold capability? I am confused as Hans is using a current sensing module and wondered whether I'd need one also.
While i'm asking, Does the firmware also send a fault signal if the encoder count gets too far behind the required position?
Teoretically 33A. Vmax that can be measured is 3.3V multiplied by 0.1 ohms. You do not need any additional current convertor.
The max error parameter does what you asked for. When encoder counter minus desired position counter is bigger than max error parameter the servo stops and the error led is set to on.
Mihai
Hi Mihai,
I have a problem with motor commutation, my motor have six magnets on the rotor and 500 lines encoder so in servo tuner I set "motor poles = 6 and Encoder PPR = 2000" I checked power and logic side and everything is ok but still dont works. Should I change commutation table in your firmware ?
Thank you
Kamil
hi mihai i have uploaded bootloader and hex file via this :
great video on how to do connection
https://www.youtube.com/watch?v=Ze6q6NidS5w
Flashing programs to STM32. Embedded Bootloader | Do It Easy With ScienceProg
step 7 from below page how to connct
and used this things
Ftdi FT232RL FT232 USB TO TTL 5V 3 3V Serial Adaptor FOR Arduino BE0027 | eBay
STSW-MCU005 STM32 and STM8 Flash loader demonstrator (UM0462) - STMicroelectronics
this is my reasult
Attachment 299186
if some have still problem with how to do it exactly i can make blog for it so everybody can understand exacty how to do it comment below if need blog on it by the way thanks mi hai currenty i have no h bridge but i am going to buid one ..what should be the value of cboot capacitor in bridge as iam using irz44 /irf540 ..should i use electrolytic or ceramic disk type capacitor ? and i have image of my tunning software after connected stm board so by this image do i have successfully installed every thing in my stm32?
i will tell you my result after completting my h bridge work ..please correct me if ihave done something wrong .
and it is very useful if you explain how to count encoder pulses and direction with timer instead of external inturrpts....i have some experience with external inruppts based encoder with arduino but never try timer for this task so what is logic behind how to count with timer ? isnt we miss some count with it ?
Hello Tandel
If you got the board to communicate via USB with the Servo Tuner Program it's all ok. Of course it seems there are several methods to flash the stm32. But you did just fine!
In the software provided by me, the Encoder pulsed are counted by hardware using timer and the step / dir pulses are counted using ext interupts. It would be great if we could count step / dir pulses using another hardware timer (and the pins are in fact linked to another timer) but I did not managed to do that in code... so... For now step / dir is counted using exti. But my guess is that the MCU is fast enough to count all exti pulses up to a few hundred kHz. So I guess we wont miss any...
Mihai
Hello
Checking the right PPR is easy. Reset mcu, connect to servo tuner software, rotate the motor shaft about 1 complete rotation and you will see the PPR (or a pretty close value there)
The motor poles you will need to find from the motor specification sheet. 6 sounds to me like a strange number anyway, my wild guess is to try 12...
You may need to change 2 motor phases between them (do not matter what phases) in order to get the right commutation sequence. You do not need to change the commutation table in code.
Mihai
hi thanks now i know that its working so ican go for next step so i have these qutions in my mind :
>should i join all ground ? specially both side of optocoupler
>am i getting 3.3v from onboard regulator of stm32board ?
>which value and which type of "c boot " capcitor do i use for ir2101 ?is it ceramic disc type or electrolytic?
>which four pins used for brushed dc motor?
>you suggest me to write duty and -duty for l6203
but i am little confused with that
Zero_Duty_P + duty;
Zero_Duty_P - duty;
and should i also made some change in
PWM_Init_Motor_DC function ?
i have pc817 optocoupler so is it suitable for this task?
Mihai,
I checked PPR 2000imp, I changed motor to Elcom 5172N002 it has four magnets so I set 4 motor poles. I don't found a documentation for this motor. I try to find correct configuration but still don't work, I change a phases, set motor poles to 3,6,8,12 and switched encoder cable. I connected oscilloscope to PWM outputs and I observed PWM signal in 3 low outputs and only 2 PWM signal in high outputs, this is a normal commutation procedure ? I don't have ideas what should I check yet.
One more question,
Do you have plan to add some option which will be give a possibility to use hall sensor ?
Thank you
hey kamilkamil1 ,
i think you should consider your motor coil pole not magnet pole . About hall sensor , i think that is waste of hallsensor for this servo because we have already encoder for driving and controlling position ..if we only use hall sensor instead of encoder we can not controll position as by my knowledge ...are you trying to use both ?encoder and hall sensor ? corrct me if i am wrong or misundersood something
this is michrochip app note on drive bldc with hallsensor
http://ww1.microchip.com/downloads/e...tes/00857a.pdf
this my mtor photo i think it six pole :
Attachment 299612
hey kamil if you some experience with coding this stuff and eclipce with arm stm32 plese tell me thanks
tandel
Hi, Tandel
I will count motor coils and I try once again.
I would like to use both, hall sensors and encoders such as in project VB's Projects Home
I dont have experience with coding stm32 but Mihai wrote a few opost before it will be easy to modify code. But on this time I can't do this.
Thank you
to Mihai, what is pin for USB conect?
thanks you
you cant get precise positioning from hall sensors alone, thats what the encoder is for. By adding hall sensors you just simplify determining the commutation of the motor. The benefit to adding hall sensors is that you can start the motor from a dead stop and automatically be in the right commutation phase.About hall sensor , i think that is waste of hallsensor for this servo because we have already encoder for driving and controlling position ..if we only use hall sensor instead of encoder we can not controll position as by my knowledge ...are you trying to use both ?encoder and hall sensor ?
While this is one of the more complete projects I've come across, it's a shame the schematic and board files are not in eagle format making it easy for others to make layout changes as it is the most commonly used PCB software.
When the project is completed and the bugs worked out I'd be interested in details regarding the reliability of a production board and the specific motor this driver targets.
-- Dale
Rather that discrete hall effect sensors, the use of commutation tracks on the encoder itself is more accurate and virtually no extra cost in the encoder.
Al.
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.