2014-04-16 05:08 AM
2014-04-16 06:47 AM
Hi
''I am really a new guy in this and i have never drive a motor '' Just how new are you to this? Do you know about electronics? Do you know about motors, coils etc and back emf? Before you even run your code - make sure the circuit is OK. The STM32 IO ports (processor itself) is not very tolerant of over voltage! ''I am using is H bridge'' What have you done to make sure the code/circuit cannot short out the power supply? (open A0 and A1 together or B0 and B1 together) If you have never driven a stepper motor before - forget the half step. Start with full steps. Get full steps working first. '' How to achieve for microstepping too '' Depends on the stepper motor. I have not heard of stepper motors that can do better than half step (but what do I know). Half steps are acheived by powering 2 coils on together - there by forcing the rotor to go in between 2 coils. To achieve better than half step will depend on the topology of the stepper motor. ''Delay or you can say acceleration for that I have used DMA'' Controlling rotational speed is about controlling the rate at which the field coils are stepped through. Yes, DMA is one possible answer (but there are other simpler ways) ''I think I have to use pwm too for (got to know from internet source ) to control the heat of the motor'' Most stepper motors should be capable of having a coil on continuously without over heating. If it is getting too hot (check the specifications) - then it is being over driven ''V supply is 5 volt and the motor is 2 volt'' Check what voltage you are putting across the coil.2014-04-16 07:03 AM
I think you need to remove a lot of the clutter. Learn to use the ''Format Code Block'' when pasting source.
The RMW against ODR seems to be incredibly wasteful, learn to use BSRR to atomically set/reset bits in a single write.2014-04-17 12:50 AM
You need to start from the other side - learning how the motor is controlled.
Every stepper could be controlled by microsteps. If you intend to do it by yourself you will need to regulate the current trough motor windings by some sine/cosine table. So, you will need to have two current sensors (amplifiers) for current feedback, two PWM's and two PID loops to control the current in a real time. If you don't want to go so deep you could use of-the-shelf driver, which could do microstepping - there are a lot of such chips from Allegro Microsystems, for example: http://www.allegromicro.com/en/Products/Motor-Driver-And-Interface-ICs/Bipolar-Stepper-Motor-Drivers.aspx2014-04-17 01:27 AM
'' How to achieve formicrostepping too ''
Depends on the stepper motor. I have not heard of stepper motors that can do better than half step (but what do I know).
Microstepping is good to reduce noise produced by a motor, without microstepping they are quite noisy.
2014-04-17 02:09 AM
Hi
Do you mean electrical noise or mechanical noise/vibration? Anyway - we are digressing. Should Sanjib attempt half step and microstepping OR should he get the basic stepping working before attempting half and micro stepping?2014-04-17 02:19 AM
Should Sanjib attempt half step and microstepping OR
should he get the basic stepping working before attempting half and micro stepping? My suggestion - he should look for a mentor, and learn more about electronics and embedded SW development. Judging by this and former posts, such a project is way over his head.
2014-04-17 09:07 AM
Do you mean electrical noise or mechanical noise/vibration?
Mechanical/acoustic noise. I don't like such sound, microstepping makes it better.
2014-04-18 10:06 PM
Thanks a lot for all your replies. I am overwhelmed. But the H bridge circuit (which block diagram I have posted) is correct because it has been designed by a experienced electronics engineer but he don't know the software. I have to write the code for it. He have said me to use PWM to avoid the excess heat ........The one which is done in my code ( by using DMA ) is for ramping . moreover the half step table is also provided by him. So here the doubt is how to use the pwm to avoid excessive heat in my present code.
2014-04-21 03:59 AM
Hi All
I am able to run the motor ....but the transistor is getting heat .....so i cannot run for maximum time. I think we can achieve this by doing PWM in my present code ....can any body help me please. Can anybody help how to use pwm in my present code so that it doesn't got heat too much