MacMATLAB modeling

R.Youden

macrumors 68020
Original poster
Hi,

I need some help with some MATLAB modeling I want to do. I already do quite a bit of work in MATLAB but I have never done anything like this more complex model I need to design.

Is there an 'expert' out there who can give me a few pointers, I will go into further detail if anyone can help.

Thanks.

macrumors G4
Is there an 'expert' out there who can give me a few pointers, I will go into further detail if anyone can help.
Going into some more detail might be helpful to let others help, though I'm personally not a matlab 'expert'.

cruzrojas

macrumors member
Hi, I haven't used matlab in a while, but I have experience doing simulations, if you give me an overall description of your project I might be able to give you some hints.

Best Regards

R.Youden

macrumors 68020
Original poster
Ok here is the general idea:

I have a small dual axis robot. I need the robot to head towards a 'coloured' light (blue) but avoid a red light. On the robot I have 4 photo-receptor sensors (2 red and 2 blue) which control the 2 motors on the robot.

I have generated equations for the robot behavior, I just need to test them and prove that the system is stable.

Below is a picture showing a general overview of what I have:

What i would like to be able to do is move the red and blue lights around to fully test my theories. At the moment the intensity of the light signal is calculated using trigonometry with a scale of 1 to 0

cruzrojas

macrumors member
I'm confused what do you mean by the equations been stable.
The way I would do it is to divide the space into a grid (64 by 64 should be enough), this would make calculations easier, specially using matlab. one of the grid point will be your robot, and another two your two lights. Maybe later on you would like to add a parameter to your robot theta that will determine witch direction the robot is using.

Remember intensity is measured W/m^2 or Power over area, that means that the Intensity is inversely proportional to the square of the distance.

I would match the time step to the time needed for the robot to travel one grid division in the slowest velocity. (remember going on diagonal takes longer, but if the grid space is small enough this might be ignored).

Start with known scenarios and make sure they work fine, like the lights fixed, or traveling on a straight line.

This should be a good first approach, better solutions could be found.

Just out of curiosity, what kind of robot are you using? I used parallax basic stamp some time ago, and parallax have a new microprocessor called propeller whit intrinsic multi threating, worth giving it a look.

I hope this helps you. Let me know if I miss understood your project, and let me know how everything goes.

Best Regards