Re: Change PWM frequency on the runtime?

218 views
Skip to first unread message

Ytai Ben-Tsvi

unread,
May 15, 2013, 2:59:17 AM5/15/13
to ioio-...@googlegroups.com
Not in the currently official firmware. The pwm-improvements branch on the github repo has that capability.
What is this for?


On Tue, May 14, 2013 at 10:46 PM, Anusca Bogdan <anusca...@gmail.com> wrote:
Can the frequency of a PWM signal be changed on the runtime?

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Anusca Bogdan

unread,
May 17, 2013, 1:25:14 AM5/17/13
to ioio-...@googlegroups.com
I have a EasyDrive bord connected to ioio and in the loop I cannot make the motor spin(do as many steps per second) as fast as a pwm signal set to let's say 1400 frequency.

Ytai Ben-Tsvi

unread,
May 17, 2013, 11:51:03 AM5/17/13
to ioio-...@googlegroups.com
There's currently custom firmware + software that has been released for this purpose (see the pwm-improvements branch on github).
The upcoming motor control library for IOIO is going to support this feature and more.

Markus Kaczmarek

unread,
May 21, 2013, 7:43:09 AM5/21/13
to ioio-...@googlegroups.com
Have you trie closing the output and opening it again with a new frequency?

Ytai Ben-Tsvi

unread,
May 22, 2013, 1:57:28 AM5/22/13
to ioio-...@googlegroups.com
It's not a good idea. It will result in a signal that's not smooth.

Ytai Ben-Tsvi

unread,
May 26, 2013, 12:29:56 AM5/26/13
to ioio-...@googlegroups.com
You'll need to build the firmware from this branch, then install it on the IOIO using IOIODude.
Alternately, you can wait until I push this feature (a few weeks probably).


On Fri, May 24, 2013 at 3:03 PM, Santiago Alfaro <titoa...@gmail.com> wrote:
Hello

I'm a beginer with IOIO and have been playing with it for a while. I need to also change the FREQ. I see the "firmware + software" that you point too for this purpose but I'm not entirely sure what to do with that code. My guess is I need more practice before I can play with actual firmware.

any pointers? Is there a chance I can damage my IOIO or should I go ahead and play with it?

Vic Wintriss

unread,
May 30, 2013, 2:39:59 PM5/30/13
to ioio-...@googlegroups.com
Ytai:

I have built a robot to use in our upcoming International Autonomous Robot Competition (iARoC) here in San Diego at the end of June (http://www.iaroc.org).  The robot uses stepper motors, and I have to ramp up the speed in order to get them going fast enough...so I really need to change PWM frequency on the fly.  As you have said, it is pretty rough closing and opening the PWM.  What does a few weeks mean...when you will push the IOIO motor control library?

Ytai Ben-Tsvi

unread,
May 31, 2013, 2:28:52 AM5/31/13
to ioio-...@googlegroups.com
As mentioned earlier on this thread, if it's just stepper speed control you're after, you can achieve this with the already published custom firmware (that you'll need to build from source).
This feature is likely to find its way to the official release eventually, as well as the full-blown motor control library.
I hate putting hard dates on these things, especially if people have a deadline to meet and rely on me - I'm doing this on a not-so-spare time basis. Rough estimate: 1-2 months to first beta.

Vic Wintriss

unread,
May 31, 2013, 12:30:03 PM5/31/13
to ioio-...@googlegroups.com, Erik Colban, June Clarke
Ytai:

Thanks so much for the personal response.  I am a great admirer of the work you have done for the ioio project.  All your work is nicely done and well documented...and you are continually responsive to ioio users.  I am an electrical engineer, and now run a non-profit teaching kids (starting in the 5th grade) Java.

I understand about commitments!  It is amazing that you can keep things going as well as you do.  Is this a side project for you?  Where do you work?

I'll try the custom firmware.  What programmer would you recommend?  I know that I can use another ioio for programming, but our Androids are refurbished...and old, So it might be simpler to just buy a programmer from SparkFun.

I've attached a picture of my robot, for your info.  I made a run of four boards, if you know anyone who wants one.

Thanks again for all the good work.

Regards,

Vic Wintriss
Executive Director
Wintriss Technical Schools




You received this message because you are subscribed to a topic in the Google Groups "ioio-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ioio-users/lVVkcida3zg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ioio-users+...@googlegroups.com.

To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ytai Ben-Tsvi

unread,
Jun 1, 2013, 2:12:19 AM6/1/13
to ioio-...@googlegroups.com, Erik Colban, June Clarke
Hey, see inline:


On Fri, May 31, 2013 at 9:30 AM, Vic Wintriss <vic.wi...@gmail.com> wrote:
Ytai:

Thanks so much for the personal response.  I am a great admirer of the work you have done for the ioio project.  All your work is nicely done and well documented...and you are continually responsive to ioio users.  I am an electrical engineer, and now run a non-profit teaching kids (starting in the 5th grade) Java.

I understand about commitments!  It is amazing that you can keep things going as well as you do.  Is this a side project for you?  Where do you work?

Thanks for the kind words! This is indeed a hobby-project for me. My day-job is in Google.


I'll try the custom firmware.  What programmer would you recommend?  I know that I can use another ioio for programming, but our Androids are refurbished...and old, So it might be simpler to just buy a programmer from SparkFun.

You shouldn't need a programmer. If you have a IOIO v1, read about IOIOManager in the Wiki; if you have a IOIO-OTG read about IOIODude. What you want here is to install a custom app firmware, you don't need to replace the bootloader, hence no need for a programmer or a second IOIO. Note that if you're using IOIOManager, you have to use Android < 4.1, since Android 4.1 broke support for IOIOManager beyond repair :(

Many novice users run into some trouble trying to build the IOIO firmware. Join the ioio-dev group for more info, and if you're running into time pressure, let me know and I'll sent you a built version.


I've attached a picture of my robot, for your info.  I made a run of four boards, if you know anyone who wants one.

Very nice! Thanks for the offer, I'll let you know if I think of someone that can make good use of them.
PastedGraphic-1.tiff
photo.jpeg

Vic Wintriss

unread,
Jun 1, 2013, 10:34:53 AM6/1/13
to ioio-...@googlegroups.com, Erik Colban, June Clarke
Ytai:

I think a built version of the custom firmware would help...if you have time.

Thanks,

Vic

Hey, see inline:


<photo.jpeg><PastedGraphic-1.tiff>

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ytai Ben-Tsvi

unread,
Jun 1, 2013, 9:06:26 PM6/1/13
to ioio-...@googlegroups.com, Erik Colban, June Clarke
Vic, is this a IOIO v1 or a IOIO-OTG that you're using?
If the latter, the process will be a little more painful, as the said branch predates the IOIO-OTG, thus does not have the right configurations.
It is of course fixable, but somewhat more work than just building.

Kiran Chinnam

unread,
Jun 3, 2013, 12:45:49 PM6/3/13
to ioio-...@googlegroups.com, Erik Colban, June Clarke
If the code is efficient, how quickly can you switch PWM Frequency by closing and re-opening the output? I'm using PWM to produce sounds similar to this : http://www.youtube.com/watch?feature=player_detailpage&v=npl7O1Wsit4#t=254s

If I use this method, will it be noticeable?

Ytai Ben-Tsvi

unread,
Jun 3, 2013, 4:25:07 PM6/3/13
to ioio-...@googlegroups.com, Erik Colban, June Clarke
It's not about efficiency. When closing you may be in the middle of a pulse, causing this pulse to immediately end having the wrong width.
Moreover, the pin will shortly go floating between the closing and re-opening.
The next pulse can come at an arbitrary period after your previous pulse, which is also not good.
Connection latency jitter even worsens the situation by introducing a non-deterministic delay between the close and open.

Having said all that, there is actually firmware for doing it proper, it is just a matter of using it.
Reply all
Reply to author
Forward
0 new messages