Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Omni-Wheel Line Follower

  • 22-05-2016 4:53pm
    #1
    Registered Users, Registered Users 2 Posts: 284 ✭✭


    Hi, posted this in the Robotics forum but it doesn't seem to be very busy these days..

    I recently built a differential wheeled line follower using 2 dc geared motors and some basic code to program the microcontroller(Arduino Uno) and L293 motor driver shield.

    I'd now like to build an Arduino-based line following robot using 4 omnidirectional wheels (e.g. http://store.kornylak.com/ProductDet...uctCode=FXA309), something along these lines https://www.youtube.com/watch?v=5vJCucpVdX0. I'd also like to implement a PID algorithm for smoother navigation of the line.

    Are there any general tips or advice you can give for my project/research?

    More specifically, I'm not sure whether to use servo motors (modified for continous rotation) or dc geared motors. I've never used servos before.

    Thanks for any help.


Comments

  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    I'm assuming you mean cut the plastic tab inside the servo to modify it?
    Be careful with this, you can make it go all wobbly and not very precise afterwards if you wreck the gearing *speaking from experience).

    Why are you thinking of using a servo? What are the benefits?
    Using standard DC motors with gearing and decent control software worked fine for me on a similar project.

    How are you with control theory? A PID shouldn't be too much trouble after a bit of reading.


  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    KeithTS wrote: »
    I'm assuming you mean cut the plastic tab inside the servo to modify it?
    Be careful with this, you can make it go all wobbly and not very precise afterwards if you wreck the gearing *speaking from experience).

    Thanks KeithTS, I've no experience with them at all but yes I've heard that's how you do it manually. I found out they can also be purchased for continuous rotation which might be handier/safer.
    KeithTS wrote: »
    Why are you thinking of using a servo? What are the benefits?

    Mostly because they're used in this tutorial: http://www.societyofrobots.com/robot_omni_wheel.shtml

    From what I've read so far, servos are slow but precise for rotational speed. And I think they usuallly require less power to run.

    But at this point I really couldn't tell you exactly why I would choose a servo over a DC geared motor. A lot more reading to do and practical experience required.. :|
    KeithTS wrote: »
    Using standard DC motors with gearing and decent control software worked fine for me on a similar project.

    That's great to hear :] I plan to make the robot work both autonomously and via R/C. Would that change things as regards choosing a servo or DC motor?
    KeithTS wrote: »
    How are you with control theory? A PID shouldn't be too much trouble after a bit of reading.

    The attached file should answer your question :D


  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    Well one disadvantage of using a DC motor is that you don't have explicit control of it or it's position. In your case, I don't think this will be an issue for a couple of reasons.

    1 - As you're building a line follower, the robot will adjust itself so you shouldn't over shoot the mark too much. Starting and stopping the motors at the appropriate time is more important than the exact position of the wheel. This depends on how you are detecting the line and other factors though.

    2 - The nature of the wheels you're using means that you will lose a lot of efficiency, this will translate into lower speed as the wheels won't be moving in a straight line, they're essentially pulled or dragged. Again, this should mean less chance of over shooting the mark as you'll have slower movement...unless you hammer it of course.

    That guide seems to cover the basics of PID control after a brief glance, I'm sure you'll need to do more reading than just that but it's a decent start.

    What paltform do you intend to use? what did you use for your last build?
    Don you have the notion of multiple threads/tasks or how have/are you planning on controlling, direction/speed/sensing at once?


  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    KeithTS wrote: »
    What paltform do you intend to use? what did you use for your last build?

    Atm I intend to use an Arduino Mega 2560 for more I/O and PWM outputs, and a Mux Shield ll for any extra analog/digital needed. As regards driving motors I'm not sure.. If I go for bare DC motors a motor driver shield would do it, but if I use servos I won't need one as they include drive electronics.

    For the last build I used an Arduino Uno R3 and L293 motor driver shield. Used five QRD1114 sensors and two Smart car TT motors.
    KeithTS wrote: »
    Don you have the notion of multiple threads/tasks or how have/are you planning on controlling, direction/speed/sensing at once?

    I'm not entirely sure what you mean by multiple threads and controlling everything at once, sorry. Do you mean do i know what sensor configuration I'm going to use, programming, PWM, PID?

    I would like the robot to be a line follower as well as be able to detect and avoid obstacles, perhaps using something like an IR rangefinder sensors. And I would like to be able to operate it via remote control also.


  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    street wrote: »
    Atm I intend to use an Arduino Mega 2560 for more I/O and PWM outputs, and a Mux Shield ll for any extra analog/digital needed. As regards driving motors I'm not sure.. If I go for bare DC motors a motor driver shield would do it, but if I use servos I won't need one as they include drive electronics.

    For the last build I used an Arduino Uno R3 and L293 motor driver shield. Used five QRD1114 sensors and two Smart car TT motors.


    I'm not entirely sure what you mean by multiple threads and controlling everything at once, sorry. Do you mean do i know what sensor configuration I'm going to use, programming, PWM, PID?

    I would like the robot to be a line follower as well as be able to detect and avoid obstacles, perhaps using something like laser rangefinder sensors. And I would like to be able to operate it via remote control also.

    By threads I mean being able to run multiple bits of code simultaneously (or the appearance of doing so). Typically your code will run sequentially, what is very useful is to have different tasks that run at the same time (this isn't how it actually works but it gives you that impression. This way you can have one piece of code responsible for detecting the line, another for driving motors, another for calculating a destination or detecting obstacles.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    KeithTS wrote: »
    By threads I mean being able to run multiple bits of code simultaneously (or the appearance of doing so). Typically your code will run sequentially, what is very useful is to have different tasks that run at the same time (this isn't how it actually works but it gives you that impression. This way you can have one piece of code responsible for detecting the line, another for driving motors, another for calculating a destination or detecting obstacles.

    Ahh ok like the way a computer OS and CPU works with processes/threads.. so it would produce more efficient code (and bot). I'll definitely look into that KeithTS thank you, is it difficult to implement?

    Can I just ask, given the fact that I'd like the additional option of controlling the robot via R/C (like an RC car), can you think of any factors/problems I'd need to consider?

    Like say I have the robot built/programmed to work autonomously. Besides building the RC device itself, would there be many changes needed in the robot's hardware (a receiver?) and to the code? Would you need two sets of code, one for autonomous operation, another for RC and maybe some sort of switching mechanism? The idea being that the bot would do whatever functions/tasks are set autonomously, but I could switch over to RC and control/drive it around myself. I guess in a sense overriding the autononomous functionality. Thanks for any light you can shed :]


    ps. Here's a short vid of my last/first build, much improvement needed but I learnt a lot and enjoyed it :] https://youtu.be/FnV5C7CRri0


  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    I'm not sure about using different tasks on Arduino as I haven't used one in the last couple of years. I'm guessing you'll have to set up a software timer or two which will switch between tasks and so on, I'd imagine it's a little fiddly but there's undoubtedly a library and some documentation out there to use.

    Without putting much thought into it, the way I would handle autonomous/RC behavior is to put a switch on the robot, hooked up either to an interrupt or IO.
    When "ON" the sensors are enabled and the code can jump into a task that reads them and drives the motors accordingly.
    When "OFF" the code can jump to another task that will read commands from the RC.

    How you want to handle this will differ depending on your implementation etc but in the line follower I built I had a calibration routine that I ran to set up the sensors etc. this was run when a button was pressed. I'm assuming you have something similar. All you really need to do is send the code to a different place after this routine. You could get fancy and have it so you can jump in and out of controlling it remotely in real time but I would start off with just having it so on start up you choose one method or the other.


  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    KeithTS wrote: »
    I'm guessing you'll have to set up a software timer or two which will switch between tasks and so on, I'd imagine it's a little fiddly but there's undoubtedly a library and some documentation out there to use.

    Cool, I look into it.
    Without putting much thought into it, the way I would handle autonomous/RC behavior is to put a switch on the robot, hooked up either to an interrupt or IO.
    When "ON" the sensors are enabled and the code can jump into a task that reads them and drives the motors accordingly.
    When "OFF" the code can jump to another task that will read commands from the RC.
    So this switch would be completely separate from the on/off (power) switch and would be hooked up to a hardware interrupt? Not sure about the IO, are you referring to "polling" at all?
    How you want to handle this will differ depending on your implementation etc but in the line follower I built I had a calibration routine that I ran to set up the sensors etc. this was run when a button was pressed. I'm assuming you have something similar.
    I don't :| Is it essential to do so? Any chance you could discuss a little about what it involved? All I did the last time was test that each sensor was working correctly (i.e. collector was outputting the correct voltage for a given surface) and then when the sensor array was built, printed off analog input readings to the serial monitor of the Arduino IDE to check the values and decide on a range for black/white surface detection.
    All you really need to do is send the code to a different place after this routine. You could get fancy and have it so you can jump in and out of controlling it remotely in real time but I would start off with just having it so on start up you choose one method or the other.
    Ideally I'd like to get "fancy" lol but I hear what you're saying :] Would I be correct in thinking that if I were to control it remotely in real time then I'd need to somehow turn an interrupt on/off wirelessly via the RC device?


  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    By IO I mean input/output so polling a pin to on start up to check it's state would do. There are more clever ways of doing this but this one is simple.
    street wrote: »
    I don't :| Is it essential to do so? Any chance you could discuss a little about what it involved? All I did the last time was test that each sensor was working correctly (i.e. collector was outputting the correct voltage for a given surface) and then when the sensor array was built, printed off analog input readings to the serial monitor of the Arduino IDE to check the values and decide on a range for black/white surface detection.

    That sounds more or less like a cal routine. All you really want to do is have the controller determine what a line looks like and no line looks like to the sensors to account for different light levels and so on.

    street wrote: »
    Ideally I'd like to get "fancy" lol but I hear what you're saying :] Would I be correct in thinking that if I were to control it remotely in real time then I'd need to somehow turn an interrupt on/off wirelessly via the RC device?

    This very much depends on how your controller is working. the main requirement would be to stop the Arduino from trying to control the bot whilst you are sending it different commands. Are you planning on having the RC commands interpretted by the Arduino or is this all hooked up without touching the Arduino?
    If the Arduino is reading the RC commands and taking approporate action then it is simple to put in a clause so that the once it received RC commands that it stops the other stuff. If the Arduino has nothing to do with the RC commands then you'll need some way of disabling the automomous behaviour.


  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    KeithTS wrote: »
    By IO I mean input/output so polling a pin to on start up to check it's state would do. There are more clever ways of doing this but this one is simple.

    Great thanks, again I'll look into it. I found an easy to read pdf document on interrupts and polling to start with..
    That sounds more or less like a cal routine. All you really want to do is have the controller determine what a line looks like and no line looks like to the sensors to account for different light levels and so on.
    That's good to hear! :] So maybe I could create a subroutine that would incorporate the sensor info and perhaps print it in a meaningful way to an LCD display (attached to the robot).
    Are you planning on having the RC commands interpretted by the Arduino or is this all hooked up without touching the Arduino?
    I'm not too sure yet KeithTS, reading up on how RCs work and how to build them.
    If the Arduino is reading the RC commands and taking approporate action then it is simple to put in a clause so that the once it received RC commands that it stops the other stuff.
    If the Arduino has nothing to do with the RC commands then you'll need some way of disabling the automomous behaviour.

    Hoping you can help KeithTS.. I've decided to go with continuous rotational servos and have been looking into building the RF Transmitter and Receiver. Haven't made a decision yet but am considering hooking up the RC without touching the Arduino. Just turn off the Arduino when I want to use the RC, then the transmitter/receiver can control the servos which'll be powered by a NiMH battery pack.

    I'm finding the RC theory a little difficult and am wondering if you can help me understand it better so I can get a schematic together?

    I need the omni-wheels to be able to go forwards, backwards and stop. I've never used one of the commercial kits before but I know they allow for this. As far as I know, each primary channel refers to a particular function such as forward/back or left/right so I'm guessing I would need 4 channels, 1 for each function/servo? Though I'm not sure how I should implement this and a "stop wheel" function in the circuit?

    I know I'll need to purchase a 2.4 GHz TX and RX module for less interference (and safety reasons), won't need crystals as they are for MHz RC systems and that a wire antenna of around 23 cm will be required for the transmitter.

    Other components/configuration needed I'm not so sure about..diodes, transistors, capacitors etc. Maybe something like this would work?

    Grateful for any help man.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    Edit:

    I need the servos/omni-wheels to be able to go forwards, backwards and stop in the way that the joysticks and knobs on the commerical transmitters would allow for. I'm thinking a momentary on-off-on toggle switch would allow me to do this?

    I know I can use pretty much any frequency for the TX RX module as I'll be operating the robot by myself away from other RCs, so interference won't be an issue.

    Knowing all the components needed e.g. diodes, transistors, capacitors etc. and putting them all together into a circuit diagram I'm not so sure about. Should I end up with something similar to this: http://www.wzmicro.com/rf.htm


  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    Sorry it's taken so long to get back to you....
    I'm not 100% familiar with the RC side of things to be honest, if I gave you any info I would be guessing.
    If I can scrape a half hour together tomorrow I'll have a read and see if I can work something out for you but no promises.


  • Registered Users, Registered Users 2 Posts: 284 ✭✭street


    KeithTS wrote: »
    Sorry it's taken so long to get back to you....
    I'm not 100% familiar with the RC side of things to be honest, if I gave you any info I would be guessing.
    If I can scrape a half hour together tomorrow I'll have a read and see if I can work something out for you but no promises.

    No worries at all KeithTS, and listen thanks a lot but don't read up on stuff on my account, I certainly wouldn't expect that! I'm doing quite a bit of research (brain fried) but making slow steady progress. How about I post back in the near future and let you know where I'm at with the RC?

    Cheers :]


  • Registered Users, Registered Users 2 Posts: 743 ✭✭✭KeithTS


    Sounds good, I'd love to know how you get on with it.


Advertisement