![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#61
| |||
| |||
| What do you mean by "software controlled reference is the realistic option." ? BTW, this is exactly what I thought that would happen using the PIC for current control. I'm glad to know I'm in the right track this way. once again, thanks for the answers nic |
|
#62
| |||
| |||
| Hurro.. I mean that you create the reference voltage from the PIC using PWM or D-A conversion, and use hardware to set the current in the motor via pwm/chopper from that reference voltage. So the current control from the PIC point of view is open-loop. This also means you already have the basis for hardware sort circuit protection, which the PIC would not be fast enough for! kreutz's post also suggests that higher step rates using the PWM modules in the AVR wasn't up to more than 75khz, which is not all that high if you're looking at 8,10 or 16x mircostepping. Based on that the I guess the best option would be to use an R/2R ladder D-A off the pic to get your reference voltage. The R/2R ladder will have better responce time than the PWM, and be faster to impliment in code. Or at least that's what I intend to try out as my next venture into making magic smoke. :-). My experimentation with in-chip current monitoring was just doing wave, full and half stepping, trying to get the chopper working in the PIC, and I ran out of processor resources. Although I thought it was actually rail fluctuation due to B-EMF locking up the PIC, so I did waste two evenings finding that out that it wasn't that... Cheers, Me. Last edited by kiwichris; 04-12-2007 at 06:15 PM. Reason: typo |
|
#63
| |||
| |||
|
I did not continue optimizing the code after I reached reliable step rates a little over 75 KHz (micro-step as well as all the way to Full Step), my code was written in BASCOM (compiled basic) so there is enough margin to optimize and get over 90 KHz. Since Mach3 is limited to 45 KHz I lost interest into coding the step ISR in assembly. Hardware PWM in the AVR is easy to update (set and forget), I used 39.2 Khz pwm frequency. |
|
#64
| |||
| |||
I'll be giving this a go as an academic exercise at some stage in the next few months, so it'll be interesting to see what I can get out of a PIC using the PWM modules, although none of the cheaper PIC's have two PWM modules, which is a pain. Thinking about this, the update time of the reference voltage based on PWM probably becomes less of an issue at higher step rates anyway, as the voltage in the stepper winding wont reach set point anyway, and the effect of some of the extra microsteps will be 'missed' by the chopper.. ie: the phase inputs will be set, and the voltage across the winding will rise slower than the microstep waveform. Hence transistioning to full step above a few revs per second. Oooo, I just learnt something. My brain hurts. ![]() Cheers, Chris H. |
|
#65
| |||
| |||
| Now I'm getting more and more lost !!! Why would I have an analog reference voltage to control current ?? If I set the pot of the hardware chopper to a fixed level, the hardware chopper will regulate it. As I drive FET drivers direcly by the PIC ouputs, why would I need the analog output ?? thanks Nic |
| Sponsored Links |
|
#66
| |||
| |||
|
|
#67
| |||
| |||
. |
|
#68
| |||
| |||
| ok, I'll suppose I have the attached document as my driver. But replace the L297 by a PIC. The output will be a PWM in a sine-cosine pattern for microstepping. The PWM will drive the power stage and and the chopper will regulate the current. There is a fixed voltage reference at the op-amp to set the max current. If I use the same circuit but in a half or full step mode, the PIC will still be used to produce a 1 or 0 at its output pin to drive the power stage. The chopper will still regulate the current. So why should I need a reference voltage coming of the PIC to regulate the current ? As the current regulation is a complete closed loop by itself, why should I need a reference voltage coming of the PIC to regulate it? I really apologyse for my squirrel brain !! Thanks for your patience Nic |
|
#69
| |||
| |||
I was talking a few posts back on the failure of one PID approximation I have seen, and their circuit was a lot like this one. Here PWM changes voltage on the coil and does not control the current. There is no feedback. In order to get microstepping we need sinusoidal (like) currents. |
|
#70
| |||
| |||
| I don't remember if I already posted this reference on this thread, this is a must read for all stepper design: http://www.cs.uiowa.edu/~jones/step/ |
| Sponsored Links |
|
#71
| |||
| |||
You keep the digital (on/off) phase drive to the mosfets from the 297/pic and the pwm sets the current via your chopper and shdn inputs on your bridge drivers. Cheers, Me. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |