Author Topic: How to make PWM signals out of Axon?  (Read 2665 times)

0 Members and 1 Guest are viewing this topic.

Offline TomasTopic starter

  • Full Member
  • ***
  • Posts: 111
  • Helpful? 0
How to make PWM signals out of Axon?
« on: January 13, 2009, 04:15:21 AM »
Me and some pals are doing a project on hooking a RC car up to the axon.
We measured the following signals (check out the pictures) going from our AM reciever to our motor controller, and we want to replicate them with the Axon. Any idea what code to use? We have no experience with coding with the axon, we're still waiting for it (but we're on a tight schedule so we wan't to prepare as much as we can before we get it).

The picture shows the signal in to the motor controller when the DC-motor is idle.
In short: Get the Axon to produse a signal that is 4V with the period being 15 ms , F = 1/T = 66,67Hz.  And the pulse width is 1,5 ms

Thanks


« Last Edit: January 13, 2009, 05:32:02 AM by Tomas »

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: How to make PWM signals out of Axon?
« Reply #1 on: January 13, 2009, 07:38:04 AM »
Check how to generate servo control signals. Those are RC servo signals.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline TomasTopic starter

  • Full Member
  • ***
  • Posts: 111
  • Helpful? 0
Re: How to make PWM signals out of Axon?
« Reply #2 on: January 13, 2009, 07:56:36 AM »
Are you saying this isnt PWM?
We measured the signals to the servo to and these are exactly the same as the signals to motor controller.

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: How to make PWM signals out of Axon?
« Reply #3 on: January 13, 2009, 11:27:55 AM »
No, I'm saying that a toy RC car uses RC servos (extremely common). RC servos use servo signals (which are a kind of pwm, but only covers a small range of duty cycles).

If you want to know how to generate pwm signals out of the axon, that can be applied and used with your car, you need to generate a specific type of PWM signals: RC servo signals. You can then feed those signals to your car's actuators (motor, steering) from the axon, as if they were coming from the receiver.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: How to make PWM signals out of Axon?
« Reply #4 on: January 13, 2009, 11:45:08 AM »
No, I'm saying that a toy RC car uses RC servos (extremely common).
By RC car he means hobby grade RC cars and not those cheap 20 dollar ones you find in toy stores
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline TomasTopic starter

  • Full Member
  • ***
  • Posts: 111
  • Helpful? 0
Re: How to make PWM signals out of Axon?
« Reply #5 on: January 13, 2009, 12:35:43 PM »
Yes this is a hobby grade RC car :) I was just wondering if anyone could give us some clues where to start for programming this into the axon without using much resources? I don't understand the different PWM guides that is on this site.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: How to make PWM signals out of Axon?
« Reply #6 on: January 13, 2009, 12:50:01 PM »
there are 2 approaches to controlling servos on AVRs.

the first involves controlling the pulses in software.
this can be a pain because you need an exact pulse length every 50ms.
working the rest of your code in between the pulses without altering the timing can take a bit of patience but does have the advantage that you can control as many servos as you can write the code for.

the other (simpler) method is described in this article: http://members.shaw.ca/climber/avrtimers.html
read the whole article but pay particular attention to the " Servo control with timer1" section.
this method generates the pulses in one of the AVRs timer hardware modules so you can just set the position and don't need program anything else.
the disadvantage of this method is you are limited to the number of timer compare pins associated with 16bit timers.
some AVRs have 2 of these pins per timer, some have 3. some AVRs have multiple 16bit timers with several compare pins on each.
i don't know how many the AVR on the Axon has. you will need to check.


dunk.

Offline mbateman

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
    • Robotics 4 Fun
Re: How to make PWM signals out of Axon?
« Reply #7 on: January 13, 2009, 04:01:25 PM »
I have code for driving R/C servos using hardware PWM from the Axon.

You can find it here: http://www.laughingsky.com/hobbies/robotics/pages/axon_modules/pwm/index.html

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: How to make PWM signals out of Axon?
« Reply #8 on: January 13, 2009, 04:02:57 PM »
I have code for driving R/C servos using hardware PWM from the Axon.

You can find it here: http://www.laughingsky.com/hobbies/robotics/pages/axon_modules/pwm/index.html
I would suggest going with hardware PWM because it works in the background
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: How to make PWM signals out of Axon?
« Reply #9 on: January 14, 2009, 07:29:20 AM »
The suggestions above are fine.

Another method:
http://www.societyofrobots.com/axon/axon_function_list.shtml#hardware_defines

Vary the cycles number to change the signal.

 


Get Your Ad Here