Tune your Pinewood Car with YAKINDU Statechart Tools

YAKINDU Statechart Tools have a wide range of use: They are used in academic and commercial contexts – and even in spare time. Let’s take a look at a project of one YAKINDU Statechart Tools user. Scott Dixon realized a light control for his son’s Pinewood Car.

In many countries Pinewood Derbies have a long tradition within scout organizations. The scouts, with the help of parents, build their own cars from wood, usually from kits containing a block of pine, plastic wheels, and metal axles. These cars do a competition ona track with two to six lanes and slopes down to the ground, since the cars are powered by gravity. Not only the fastest car wins but also the most original or beautiful one.

In 2017 the son of our user Scott Dixon wanted to take part in a race with his own car. Scott and his son had a deal:  If he did enough of the work by his own initiative Scott would add working headlights to his car.

Long story short: Huck did a great job building his own car, so Scott generated the code and flashed it on a SparkFun “Shake on Wake” board. He added brake lights on his son’s car and developed a statechart for this:

Spotlight-Pinewood-Car-YAKINDU-Statechart-Tools-Scott-Dixon.gif

The statechart during simulation.


And that's the story behind the Pinewood car:

How to tune a Pinewood Car with YAKINDU Statechart Tools

“For this year’s (2017) Boy Scout Pinewood derby I asked my son to design the car himself. The deal was that, if he did enough of the work by his own initiative I'd add working headlights to his car.

He did his part and more (cool car, Huck!) so I thought I should step up my game and add more than just headlights. I had a SparkFun "Shake on Wake" board sitting around, and I realized it had an ATTiny MCU on it with a proper ISP header. Looking at SparkFun's firmware on GitHub, I decided to repurpose the ATTiny's PWM to run the lights and to add a cool tail light feature where the "brake lights" would dim while in motion and would get bright when stopped, just like a real car. I whipped up a quick state-machine using YAKINDU Statechart Tools and routed out enough space in the car's belly for the SparkFun PCB. Three ounces of hot glue and tungsten slugs later and we had what you see here.


Preview-Scott-Dixon-Pinewood-Car-YAKINDU-Statechart-Tools.jpg


You can check out the firmware on 
GitHub. Note that I didn't have access to a pinewood derby track while building this so I couldn't calibrate proper motion detection for the taillights. Instead I just have them dim for any motion. As long as the track is slightly bumpy this works fine.”

Great story, isn't it? 

If you use YAKINDU Statechart Tools in your spare time too let us know and leave a comment! And if you don't use it yet don't forget to download the tool ;)

  Download YAKINDU Statechart Tools

About Svenja Wendler

Svenja Wendler is IT consultant for itemis AG in Lünen. She is working in model based software development, validation and project organization.