Other Parts Discussed in Thread: HALCOGEN,
Hello all!
I've recently asked on how should I drive motors.
I've followed eCAP example in Halcogen and I do not really understand what I am doing or what I should be doing, so can you help me? I'll put it in images what I've done.
1) I've enabled ETPWM and eCAP drivers.
What I still do not understand... What are eCAP (enhanced capture) and ETPWM (enhanced timer PWM) used for? Why do they go together?
2) I enabled ETPWM1A/B, ETPWM2A/B and eCAP1 (missing on this image)
So, I understand that I need PWM to drive motors. If I understood correctly, A and B channel are positive and negative PWM?
What I do not understand, honestly, is how do I know where are 14, 16, 22 and 25 pins on my RM46L852 launch board? On it there are from J2 to J11.
J2 is enumerated from 1 to 10.
J5 from 11 to 20.
J3 from 21 to 30
J4 from 31 to 40
J6 from 41 to 50
J9 from 51 to 60
J7 from 61 to 70
J8 from 71 to 80
And I presume that pins 14 and 16 on Halcogen are pins 14 and 16 labeled on J5?
Implying that logic I should use pins 22 and 25 on J3 for ETPWM2?
I am really not sure about this logic since I also have J10 and J11 and ther are both labeled form 1 - 50. They do not continue from 80 onwards.
Can you help me with this a bit?
3) Turning on TBCLK
What is this TBCLK? And what are the rest of the options?
4) Enabling ETPWM1 and ETPWM2
Since I am using ETPWM1A and ETPWM1B, as well as ETPWM2A and ETPWM2B I should turn these two drivers on? Am I right?
5) Setting up ETPWM1
Okay, I honestly have no clue what I am doing here...
What is TB Clock? Is that the frequency my RM46x controller is working on? Since it is 220Mhz, I should type that in that field?
What is VCLK4? What should I do with it?
What is Actual TB Clock value? It's in Mhz so I guess it is not the frequency of my PWM. And how do I chose these HSPCLKDIV and CLKDIV?
6) No clue what I am setting up here...
If A and B are positive and negative PWM so that I could drive motor in both directions, why would anybody place different values on A and B channel?
How do I know what is my frequency? How does it relate to that Actual TB clock (Mhz) box from previous image?
If I set duty cycle for 50%, can I change it later in code so I can make a PID on my motor?
7) Enabling eCAP1
If I am driving two motors, is one eCAP periphery enough? What do I use it for? Can you please explain me this a bit?
8) Setting something up?
Can you help me? What do these set ups do? What is CONTINUOUS Capture mode? Why do I enable CEVT1 and set up CAPTURE_EVENT_1? What do I get with this?
Why don't I do anything to PWM Configuration on right hand side? What is it for?
9) What should I do more to drive two motors?
10) This settings are only for driving Brushed DC motors, right?
11) How do I connect pins from motor driver to the board? (I am using 5V motor and none TI Hercules shield)
Thanks for your patience with me!
Marc Hewitt