go_away

Author Topic: Live control of DC motor with simulink  (Read 1567 times)

0 Members and 1 Guest are viewing this topic.

Offline signiousTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Live control of DC motor with simulink
« on: November 14, 2011, 01:52:21 PM »
Hello, I am wondering what would be a good (economical) control board to use to control a DC motor with a rotational encoder feeding back into simulink.

My budged for the board is around $200, but would be nice if I can find something under $100.  I am fairly new to having an actual physical element, but am well versed in the virtual side of control systems.

Thanks, N

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Live control of DC motor with simulink
« Reply #1 on: November 14, 2011, 02:29:39 PM »
Hi,

Hello, I am wondering what would be a good (economical) control board to use to control a DC motor with a rotational encoder feeding back into simulink.

My budged for the board is around $200, but would be nice if I can find something under $100.  I am fairly new to having an actual physical element, but am well versed in the virtual side of control systems.

Assuming you need USB(?), just about any board with USB ability should do. A couple of lines for controlling the motor (Speed via PWM and direction if needed), 2 input lines for the encoder and 2 USB lines - you cannot find a board that haven't got plenty more, but you have to work a bit to find them at over $100.

Perhaps take a look at this board. It's $27 and has ample power.

No matter what board you get, you'll need a motor driver to go between the board and the motor. This can be bought ready made or made for fairly cheap.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline signiousTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Live control of DC motor with simulink
« Reply #2 on: November 15, 2011, 08:49:00 PM »
The biggest concern of mine is getting something that plays well with simulink for live control (I have seen it called rapid prototyping, but dislike that phrase)

I have looked into various arduino based boards and from what I can tell, getting them to play well with matlab/ simulink is a huge pain in the... well - you get where I am going.  Do you know of anywhere that has more detailed info on how to get them to work well with the program?

thanks
-N

Edit: Also - USB/Serial are both viable options for my hardware

Edit2: I may have found the solution to my question, I have possibly found a plug for matlab that exports simulink programming into readable code via MPLab (c code based?)   Here is the link to the microchip page detailing the blocksets http://www.microchip.com/dspicblocksets any chance you could give it a quick read to double check that I am looking at the right thing? As I said, I am good at the simu part, and the mechanics, but its the electro hardware that I am lacking skill haha
« Last Edit: November 15, 2011, 09:00:33 PM by signious »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Live control of DC motor with simulink
« Reply #3 on: November 16, 2011, 09:07:05 AM »
Hi,

The biggest concern of mine is getting something that plays well with simulink for live control (I have seen it called rapid prototyping, but dislike that phrase)

What you need to send back and forth are commands for motor speed (and perhaps direction) and getting encoder data back.
While that can be done in several ways, you'll need it to conform with the protocol of Simulink.
As you'll be the one programming the microcontroller, you have to make it conform.

What else do you see as a problem in that?


I have looked into various arduino based boards and from what I can tell, getting them to play well with matlab/ simulink is a huge pain in the... well - you get where I am going.  Do you know of anywhere that has more detailed info on how to get them to work well with the program?

I assume you know the protocol of Simulink?
If not, then it's where you need to be concerned about learning more IMO.

If you were hoping for something Plug 'N' Pray, I cannot help, as I don't know any (I dislike simulators, to put it mildly, so it's not the thing I spend time reading about).


Edit2: I may have found the solution to my question, I have possibly found a plug for matlab that exports simulink programming into readable code via MPLab (c code based?)   Here is the link to the microchip page detailing the blocksets http://www.microchip.com/dspicblocksets any chance you could give it a quick read to double check that I am looking at the right thing? As I said, I am good at the simu part, and the mechanics, but its the electro hardware that I am lacking skill haha

The Microchip "Blocksets" seems to be a way of generating blocks of source code for the mentioned microcontrollers (some of the DSP enabled controllers).
Whether it's something that will help you out, I really don't know, since I'm getting unsure of what yu wanna do.

I figured you just had a need for a board that could control a motor and communicate with Simulink?
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline signiousTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Live control of DC motor with simulink
« Reply #4 on: November 16, 2011, 11:57:23 AM »
I am looking for a rapid prototyping style board - If you need an example look up the Quanser Quarc boards - I guess you could call it 'plug 'n play'.  I used those boards through university, and now just want to do some screwing around to learn more on the mechatronics part of my degree.

In essence I am looking for a board that there is with a set of blocks that will be able to translate simulink code in to a language that they can read, or a board that can read simulink code (I don't think that latter exists).

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Live control of DC motor with simulink
« Reply #5 on: November 16, 2011, 12:10:49 PM »
Hi,

I am looking for a rapid prototyping style board - If you need an example look up the Quanser Quarc boards - I guess you could call it 'plug 'n play'.  I used those boards through university, and now just want to do some screwing around to learn more on the mechatronics part of my degree.
So, you bought the (extremely expensive) software just for "screwing around"?
(I know a much cheaper way for that btw ;))

Well, it seems like you already know a solution, so why not go with one of the boards you refer to?


In essence I am looking for a board that there is with a set of blocks that will be able to translate simulink code in to a language that they can read, or a board that can read simulink code (I don't think that latter exists).
The short read about Quanser I did, seems to say that the software they make is something like a translator, to go with a lot of different controllers.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline signiousTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Live control of DC motor with simulink
« Reply #6 on: November 16, 2011, 12:27:29 PM »
The quarc system is set up for purely educational uses, and is priced as such (amplifier, controller, and software will run upwards of $9000)

and as to matlab - I have the educational version which brings the cost down significantly, and I have also used it extensively throughout the last 5 years - and have definitely gotten my money's worth on it.

I was simply coming here to see if anyone knew of a cheaper version of a RP board, with -yes, translator blocks.  I am not sure how much you have used simu, but it is no easy - or realistically doable - task to create a translator to throw out C code (or whatever the board recognizes) in a format that is usable.  We are talking a years worth of work by an engg team - which is why I don't really want to commit to making the blocks myself

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Live control of DC motor with simulink
« Reply #7 on: November 16, 2011, 03:23:51 PM »
Hi,

I am not sure how much you have used simu, but it is no easy - or realistically doable - task to create a translator to throw out C code (or whatever the board recognizes) in a format that is usable.  We are talking a years worth of work by an engg team - which is why I don't really want to commit to making the blocks myself
As I told you, I don't use sims if I can avoid it, but that really has got nothing to do with this.

I got the impression that you wanted to run the software on a PC controlling the motor and getting the encoder signal fed back, for which you just need to know the protocol.

From what you say now, I take it that you want to drag 'n' drop code on Simulink and then make a program for a µcontroller from the Simulink code?

While it sure isn't a ten minute job, I don't think it would take "years by an engineer team", but rather a couple of weeks (tops) by a single engineer. to make a translator (I have made lots of similar translators for various purposes, so I should have a pretty good idea).


As far as your problem goes, you need to define exactly what you want to do and with what, before anyone can help you in a meaningful way, but if you want to dabble seriously in robotics, you should consider other means than Simulink as well, as you need to get close to the iron when you want the code for a robot to be efficient and want to know exactly what goes on in it.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here