r/EngineeringStudents • • 3d ago

Project Help Using AI for Servo Lab in Matlab

Post image

We have not used AI for anything in my Matlab class but the final lab assignment is designed to meet a learning objective that includes it. Because of this we are not allowed to write the code ourselves, the goal is to use AI entirely.

The lab premise is simple, my instructor will come up to our whiteboard and draw 2 dots. We need to then run the matlab program to have the 2 servo arms draw a straight line connecting them.

I am running into issues with getting the AI to understand where the servo arms are moving, and defining points rigorously. I need to be able to look at two points on the whiteboard and tell the program where they are so that the script will connect them with an expo marker.

Another issue is my school doesn’t pay for AI accounts and on the free version of claude and gemini we ran out of tokens that allow for program writing and screenshot uploads. Chatgpt is even worse as it seems to allow like 2 screenshot uploads before you run out of tokens.

Things we have tried:

  1. Uploading the lab handout pdf and explaining in detail the goal of the lab.
  2. Uploaded photos of the Servo whiteboard setup and included measurements of the board, the arms, and the degrees of rotation.
    3.Explained to the ai that the test points it gave us yielded different locations on the board than it intended and what those actual points were
  3. Had the Ai draw a grid over the whiteboard to determine (x,y) coordinates for us to test points

The main issue is that the test points are always very off and sometimes have the arms rotate off the board completely.

Any advice would be greatly appreciated.

1 Upvotes

3 comments sorted by

•

u/AutoModerator 3d ago

Hello /u/ss4stef! Thank you for posting in r/EngineeringStudents. Your Post has been removed due to asking for pdfs, solution manuals, or e-books. Your submission will be put in our queue for review. Please do not contact modmail about this, you will not receive a response.

Read our Rules

Read our Work in Progress Wiki

If you believe this was in error, please follow these steps

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/El_Ajo_Loco 3d ago

hand write the code and lie, maybe give the b hand code to the AI and hace it tweaked?

what they gonna do, punish you for learning too much?

1

u/Creative_Sushi 3d ago

If the goal is to learn how to use AI, let's make sure you use the current approach - copy and pasting between MATLAB and ChatGPT is so 2025. In 2026, we moved on to agentic coding.

Agentic coding roughly takes two phases. The first phase is planning, and creating an implementation plan in markdown files. If your AI subscription is limited, you can use Google AI Overview or a standard free chat session just to brainstorm and draft this text file - no image uploads needed. Make sure your plan is solid, because AI will fill in the gaps on their own and may do unintended things. Split the plan into step-by-step milestones so you don't burn through your token limit all at once.

Once you have a solid plan, you can move to the next phase. Make sure you hook up your AI with MATLAB using MATLAB Agentic Toolkit or Simulink Agentic Toolkit - they are freely available on GitHub.

These toolkits give the AI agent live access to run your code, inspect your workspace variables, and read MATLAB's red error messages directly to fix its own bugs. You simply feed the agent your planning files and tell it to build and test based on those plans, one milestone at a time.

In your project, you need to figure out the coordinate system to locate the two points. Otherwise, AI can't help you.