Skip to main content

9 posts tagged with "spike-prime"

spike-prime

View All Tags

Build Chatbot for Submerged Season for Coding

· 3 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

In the new Submerged season of FIRST LEGO League (FLL), we are continuing our journey of using AI to help us learn, innovate, and make robotics more accessible to everyone. Our team took the initiative to build a chatbot using Microsoft Azure (with lots of helps from coaches) and publish an app that anyone can use, free of charge. This was a big step toward creating a more inclusive, cost-effective way for young engineers and coders to get the most out of AI.

One of the challenges we faced when using tools like ChatGPT is that they often require users to create an account, and there are costs associated with using advanced AI features. This creates a barrier for many students and teams who might not have access to these resources. To solve this, we built a free version of our chatbot that specifically focuses on the needs of FLL participants. We locked down the scope of the questions and answers so that they only relate to the official season documents and guides for the Submerged challenge, as well as coding instructions for the LEGO SPIKE Prime 3.

The chatbot is designed to be simple and focused, giving users clear, relevant information about the FLL challenge and the Python coding required for SPIKE Prime 3 robots. Whether a team needs help understanding the mission details or figuring out how to make their robot move in a specific way, our chatbot has the answers.

alt text

alt text

One of the key skills we emphasized this season is prompt engineering. The art of asking the right questions to get the best answers from an AI. While many people assume that AI automatically gives perfect responses, the truth is that how you ask a question can dramatically affect the quality of the answer you receive. We've been teaching our team and users of the chatbot how to frame their prompts clearly and concisely to get more accurate and useful information.

For example, instead of asking, "How do I code my robot?" a better prompt might be, "Write Python code to move my SPIKE Prime 3 robot forward for 5 seconds and stop." By being specific, users can get actionable responses that directly help with their projects.

This new chatbot, combined with prompt engineering techniques, empowers young engineers to not only rely on AI for quick solutions but also to better understand how to interact with technology in ways that enhance their learning experience. We're excited to see how teams use this tool during the Submerged season and how it helps them innovate and succeed. We hope to remove some of the barriers that traditionally come with using advanced AI tools and give every FLL team a chance to harness the power of AI for their robotic challenges.

Integrate GPT 3.5 model with Spike Prime 3

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

We've made great progress in our journey to fine-tune an AI model for Spike Prime robots. With the training dataset and validation dataset ready, it's time to take the next step: setting up an Azure endpoint and integrating it with our local Python script.

First, we configured the Azure endpoint to allow us to send and receive data. This will enable our fine-tuned model to process instructions in real-time. By doing this, we can interact with the model directly from our local machine, making it easy to integrate AI-powered code suggestions into our Spike Prime project.

For the robot connection, we used a serial port interface. This allowed us to send commands from the Python script running on our local machine to the robot in real-time. This setup ensures that we can test and execute movements and commands on the fly.

The results look promising so far. The fine-tuned model has demonstrated an ability to stick closely to the instructions we provided. It seems to understand the specifics of the Spike Prime movement commands, offering more accurate code suggestions than a generic model.

alt text

Here's a glimpse of what we've tried so far:

  • Moving forward: The model was able to generate precise movement commands using Spike Prime-specific syntax.
  • Turning: We tested multiple turning scenarios, and the model successfully adjusted the turning angle based on the instructions.
  • Combining movements: The fine-tuned model was able to chain together commands, making the robot perform complex maneuvers smoothly.

The integration between Azure and our local environment is working well, and the fine-tuned model is proving to be a valuable tool in generating Spike Prime-specific Python code. As we continue to refine the model, I'm excited to see how far we can take it!

Use fune-tuned gpt 3.5 model to write python

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Over the last 12 months, I've been amazed by all the developments happening in the AI world. From advancements in natural language processing to AI-driven coding tools, it's clear that AI is transforming the tech landscape faster than ever. With all the buzz, I decided to set a challenge for myself: to build an AI app from scratch.

I've heard a lot about is Azure's fine-tuning capabilities. The idea behind fine-tuning is to take a generic AI model and specialize it for a particular task or domain. In my case, I want to see if I can fine-tune a model to improve the accuracy of Python coding snippets, specifically for Spike Prime robots.

alt text

Spike Prime is a versatile LEGO robotics kit that allows users to program movements and interactions. While generic Python code can be used to program the robots, I'm curious if fine-tuning a model on Azure can make the code more optimized for Spike Prime's specific needs.

This will be my first time building a fine-tuned model on Azure, so I want to make the process as smooth as possible. Instead of trying to fine-tune every Python function related to Spike Prime, I've decided to narrow the scope and focus only on a few scenarios, such as robot movement and turning.

The fine-tuning process for this project looks like this:

  1. Dataset preparation: Gather Python code snippets that are specifically tailored for Spike Prime, focusing on movement and turning functions.
  2. Fine-tuning: Use Azure's fine-tuning service to train the model with this specialized dataset.
  3. Testing: Evaluate the fine-tuned model by inputting generic Python code and observing how it converts the code to a more Spike Prime-specific version.

This is just the beginning, and I'm excited to see what kind of improvements we can achieve. Stay tuned as I dive deeper into the world of AI fine-tuning and robotics!

Attempt to ask ChatGPT to write python

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

The team is struggling with writing Python for the first time! It's so hard, and we don't know where to start. Drag-and-drop coding in the code blocks was so easy, but now we need to learn Python and figure out what to do. The Spike Prime has some examples, but they're not so easy to understand for us.

We turned to ChatGPT for help. It does output lots of code, but it doesn't run on the app. Why? We asked our coach for help and learned that the Spike Prime only uses a specific set of Python, and the robot only knows some of the functions but not all.

It turns out that Spike Prime uses MicroPython, which is a simplified version of Python designed for microcontrollers and embedded systems. This means that not all standard Python libraries and functions are available. Some of the code that ChatGPT provides uses functions that the Spike Prime doesn't support.

This was a bit disheartening at first. We thought that learning Python would open up new possibilities, but instead, we hit a wall. However, we realized that this is just another challenge to overcome. We're now focusing on learning the specific commands and functions that are available in Spike Prime's MicroPython environment.

It's still tough, but we're making progress. We're finding tutorials and resources specifically for Spike Prime's Python coding. We're also experimenting with small bits of code to see what works and what doesn't. It's a learning process, and while it's frustrating at times, it's also exciting to see our robot respond to the code we've written.

In the end, we're hopeful that with perseverance and a better understanding of Spike Prime's Python capabilities, we'll be able to code like pros. For anyone else struggling with this, know that you're not alone, and don't hesitate to seek help and keep experimenting!

Embarking on a Coding Journey with LEGO Spike Prime

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

We've officially started exploring robot tutorials with the LEGO Spike Prime kit, and it's been quite the learning adventure! While Spike Prime is designed to be educational and user-friendly, getting started with coding was a bit trickier than I anticipated, especially for my young daughter.

alt text

As someone who's fairly comfortable with technology, I was surprised to find myself facing some hurdles, particularly when figuring out how to get the motor up and running. The block-based coding interface appears simple at first glance, but once we delved deeper, we realized there are quite a few features that aren't immediately visible. It turns out you have to enable extension blocks to unlock all the coding options, which definitely took us a moment to discover.

For my daughter, the experience was a bit overwhelming at first. Coding, even in a visual format like this, can be intimidating for a beginner, especially when you're still learning how different blocks function and interact with the hardware. But we're taking it slow, working through tutorials together, and focusing on breaking down each task step by step. Once we activated the extension blocks, it opened up a whole new set of possibilities. Suddenly, we had more control over the motors, sensors, and all the cool features we hadn't noticed before.

The good news is that Spike Prime 3 offers a lot of flexibility for different skill levels. As we continue exploring, I can already see my daughter gaining confidence. She's becoming more curious and asking questions like, "What happens if we change this block?" or "How do we make the robot move faster?" That's the beauty of this kit, it sparks curiosity and creativity, even if there are a few challenges along the way.

We're still in the early stages, but I'm excited to continue our coding journey. With every tutorial we tackle, we're learning something new, and it's a fantastic opportunity for both of us to grow together. Stay tuned for more updates as we get the hang of coding and start building some really fun projects!

alt text

Bring LEGO Robots to Life - A Fun Family Adventure

· 3 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

There's nothing quite like spending quality time with my two young kids, especially when it involves creativity, learning, and a dash of engineering. Recently, we decided to dive into the world of LEGO robotics at home, and it turned out to be an unforgettable experience for all of us.

We started by unpacking our LEGO robotics kit, and the kids' eyes lit up at the sight of all the colorful pieces, motors, and sensors. Together, we followed the instructions to build our very own robot. The process was a fantastic way to teach them about mechanical components and how different parts work together. They eagerly assembled gears, connected motors, and snapped bricks into place, watching as their creation slowly took shape.

Once our robot was built, it was time to bring it to life with code. This was where the real fun, and challenges, began. We opened up the coding software, and I could see the curiosity in their eyes as they looked at the blocks of code. At first, we struggled a bit to understand how the code blocks translated into movements for the robot. The concepts of loops, variables, and commands were new to them, and I had to brush up on my own coding skills as well. We experimented with different code sequences, trying to get the robot to move forward, stop, and even make a turn.

There were moments of frustration when the robot didn't move as expected. The kids would exclaim, "Why isn't it working?" But these challenges turned into valuable learning opportunities. We reviewed our code, identified mistakes, and tried again. It was rewarding to see them develop problem-solving skills and persistence. After some trial and error, we finally figured out how to make the robot move and turn. The joy on their faces when the robot obeyed our commands was priceless. It was like magic seeing their creation come alive and respond to the code they had written.

This experience was more than just playtime; it was an educational journey that introduced my kids to the basics of robotics and programming. They learned that with patience and perseverance, they could overcome obstacles and achieve their goals. We also discovered the importance of teamwork. Each of us brought something to the table, whether it was assembling parts, figuring out the code, or cheering each other on when things got tough.

Building and coding LEGO robots at home has been an incredibly rewarding experience. It's amazing how a box of plastic bricks can open up a world of imagination and education. I highly recommend this activity to any parents looking for a fun and engaging way to spend time with their children.

Have you tried building robots or coding with your kids? I'd love to hear about your experiences !

Get Started with Spike Prime Python Programming

· 3 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

I must say, getting young students started with text-based programming, like Python, is no easy task. For many of them, it's a whole new world compared to the block-based coding and drag-and-drop interfaces they're used to, like Scratch or even LEGO Spike Prime's visual programming. The transition can feel daunting, and I've seen firsthand how challenging it can be for kids to wrap their heads around syntax, logic, and debugging in a text-based environment.

One of the biggest hurdles I've noticed, from my own experience, is that when students get stuck, they don't always know where to turn for help. Unlike block-based programming, where mistakes are often more obvious and easier to fix visually, text-based programming can be more abstract. A missing semicolon, an indentation error, or a misplaced variable can bring everything to a halt, and for a young learner, that can be really frustrating, especially if a teacher or coach isn't immediately available to guide them.

This got me thinking: could AI be the key to helping young students bridge the gap between visual and text-based coding? With advancements in AI, there's so much potential for creating learning tools that can support students in real time. Imagine an AI-powered tutor that not only provides instant feedback when a student makes a mistake but also explains why it happened in simple terms and how to fix it.

For robotics, the complexity can be even greater because students are not just writing code, they're also dealing with hardware, sensors, and motors that don't always behave as expected. An AI assistant could help students troubleshoot both the code and the physical components of their robots, walking them through the process step by step. Whether it's detecting an issue with their Python code or suggesting ways to improve their robot's performance, such a tool could be invaluable.

Additionally, AI could offer personalized lessons that adapt to each student's pace, guiding them through the fundamentals of Python in a way that makes sense for their individual learning style. It could provide practice challenges tailored to their skill level and gradually increase in difficulty as they improve, making the learning curve less steep.

Could AI help foster independence in students? When they're stuck and no coach or teacher is around, AI could be their go-to resource for immediate, interactive support. It could help them search for solutions, offer suggestions, and even explain complex concepts in a way that's easy to understand.

Incorporating AI into programming education might transform how students approach text-based coding like Python, making it less intimidating and more accessible. It's something I'd love to see more of in the classroom, especially as more young students take on the exciting challenge of robotics and coding!

Unboxing Adventure - Our Family's First Look at LEGO Spike Prime

· One min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Exciting news! We just ordered the LEGO Spike Prime kit for our three kids, and it has finally arrived at home! I have to admit, I think I'm even more excited than the kids to see that iconic LEGO box sitting on our doorstep.

As soon as the package arrived, I couldn't wait any longer. My daughter and I decided to dive right in and open the kit together. Wow, there's so much packed inside! Motors, LEGO bricks of all shapes and sizes, gears, sensors, and a whole bunch of other cool components.

The kit is designed for educational robotics, but honestly, it feels like more than just a learning tool, it's an adventure in creativity and engineering. We're already imagining all the possibilities, from building robots that move to creating interactive projects. The blend of LEGO with robotics components is perfect for kids (and parents like me) who love building and tinkering.

Now, it's time to start assembling! Can't wait to see what we create together with Spike Prime. it's going to be a fun, hands-on journey for the entire family.

Engineering Fun with My 6-Year-Old and LEGO WeDo

· 3 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

There's a unique kind of joy in watching your child's eyes light up with curiosity and wonder. This past weekend, I experienced that magic firsthand when our eagerly awaited LEGO WeDo kit arrived. My six-year-old son and I embarked on an engineering adventure right in our living room, building creations and exploring the basics of coding.

The excitement was palpable as we unboxed the LEGO WeDo kit. My 5 year-old son could hardly contain himself, his tiny fingers itching to dive into the piles of colorful bricks, sensors, and motors. For those unfamiliar, LEGO WeDo is an introductory robotics kit that combines the joy of building with the basics of programming, designed especially for young minds.

Building Our First Robot Together

We spread out all the pieces on the floor, the instruction manual open on the tablet. Deciding on the first project was a challenge in itself: should we build the roaring lion, the drumming monkey, or perhaps the sweeping robot? We settled on the alligator, a model that promised movement and sound.

As we assembled the pieces, I was amazed at how intuitive the process was for my son. He followed the visual instructions, found the right bricks, and started snapping them together with minimal guidance. It was a proud moment seeing his determination and problem-solving skills in action.

alt text

Diving into Coding

Once our alligator took shape, it was time to bring it to life with code. We connected the model to our computer, and the real fun began. The WeDo software uses a simple drag-and-drop interface, perfect for young children to grasp the fundamentals of programming.

"Let's make the alligator's mouth open and close," I suggested.

"Can it roar, too?" my son asked eagerly.

Together, we selected blocks of code that controlled the motor and added sound effects. With a click, our creation sprang to life: the alligator's mouth snapped open and shut while emitting a playful roar. The look on my son's face was priceless.

Learning Through Play

What struck me most about this experience was how seamlessly learning blended with play. Without realizing it, my son was picking up concepts like sequences, loops, and cause-and-effect. He experimented with different coding blocks, curious about what each one would do.

"What happens if we change this number?" he wondered aloud, pointing to the duration of the motor's movement.

"Let's try it and see," I encouraged.

We spent hours tinkering, adjusting, and testing, each modification bringing a new lesson and a new burst of excitement.

A Day Well Spent

As the day wound down, we sat back and admired our work. We had not only built a functioning robot but also shared laughs, solved problems, and learned new skills together. It was more than just assembling bricks and writing code; it was about connecting with my son in a meaningful way.

Our engineering day with the LEGO WeDo kit was a resounding success. It opened up a world of creativity and learning that we can't wait to explore further. If you're a parent looking for a way to engage your child in STEM activities, I highly recommend giving LEGO WeDo a try. It's a fantastic way to have fun while laying the groundwork for critical thinking and technological literacy.

alt text