![]() |
![]() |
![]() |
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Experienced Member
Join Date: Sep 2007
Location: Vancouver, B.C.
Posts: 900
![]() ![]() ![]() ![]() ![]() ![]() |
I've been grinding through the 18F4525 datasheet PWM sections and, unless I'm mistaken (I probably am
), it looks to me like you have to have both PWMs running off the same timer. Therefore they have to have the same duty cycle. This just won't do it for me. I need two independant duty cycles.Do I have to build my own PWM with a different timer for the second motor output? I'll be working on this more tonight. Must go to work now.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|
|
|
|
|
#6 (permalink) | |
|
Experienced Member
Join Date: Sep 2007
Location: Vancouver, B.C.
Posts: 900
![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
Both wheels PWMing independantly now. Should have this thing at least attempting to balance by tonight. Tomorrow or Sunday at the latest. ![]() I didn't need independant PWM to get it balancing, but for steering later I do. I think what was throwing me on the datasheet was part of the Enhanced PWM chapter. I should have never looked at it. It just confused me.
__________________
========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 9th May 2008 at 07:56 PM. |
|
|
|
|
|
|
#7 (permalink) |
|
Experienced Member
Join Date: Sep 2007
Location: Vancouver, B.C.
Posts: 900
![]() ![]() ![]() ![]() ![]() ![]() |
I got the balancer attempting to balance itself. I think it might even work with accelerometer only. But it's going to need faster motors and/or bigger wheels. It can't begin to catch itself. It's doing all the right things. The accelerometer is sensing the slightest tilt and turning on the motors correctly, but the motors just aren't fast enough to catch and correct the tilt.
In a lot of balancing robot web-sites I see the guy mention switching to bigger wheels or faster motors. Now I know why. ![]() Now I'm going to dig through all my motors and wheels and see what I can come up with for tomorrow.
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| PWM Sort of question | AtomSoft | Micro Controllers | 10 | 30th April 2008 02:32 PM |
| PWM feature doubt | raviram87 | Micro Controllers | 3 | 6th April 2008 03:57 AM |
| PWM signal problem | iznalgnaij | Robotics Chat | 4 | 25th March 2008 12:40 PM |
| PIC PWM outputs? | Andy1845c | Micro Controllers | 33 | 30th November 2007 03:06 AM |
| PWM using software AtoD | jeremygaughan | Micro Controllers | 11 | 27th November 2007 11:11 PM |