It Moves!
I've been in the lab for a good while over the last week, making a lot of progress (although still not as much as I would have ideally liked).
The first big decision I had to make this week was the choice of programming language I was going to use for the microcontroller. The Pimoroni board I'm using has specific libraries and abstractions available through a customised MicroPython firmware, so that looked like the most suitable choice. This is my first time using MicroPython and I'm still a little unsure about the idea of running an interpreted language on a microcontroller. I'm somewhat tempted to try rebuilding what I have so far in Rust to take advantage of its compile-time error checking, but I've only used Rust a tiny amount compared to Python so switching languages may turn out to be shooting myself in the foot and I can't really afford to waste time at this point in the project.
After setting up the development environment, I was able to start programming some tests. The first step was just to get the fan to boot up, which requires sending a PWM signal of 1000 microseconds. I then began translating some of the jerk simulation code to MicroPython to get a smooth but fast ramp-up curve for the thruster. The full git repo can be found here and will continually be updated as the project progresses.
At this point I hit a little bit of choice paralysis, I was unsure whether I should start integrating sensors, work on getting the second thruster working, or start designing the carriage for the track. Alex thankfully broke me out of this and suggested building a small-scale temporary test track so I could begin testing different thrust durations and ramp-up timings to start seeing how these impacted the thruster's movement. Using some laser-cut MDF and a small (approx. 1m long) rail/linear bearing system, I (we! Alex provided the design and laser-cutting expertise) constructed a small-scale test track/carriage system.
I mounted the thruster to the carriage plate and checked my code's output without the fan attached to make sure the PWM values seemed sane, despite having done this, the thruster's movement was far too violent, slamming from one end of the track to the other and unplugging itself from the microcontroller (at which point the speed controller's safety cutoff kicked in). I ended up reducing the PWM signal to near minimum and raising it up to about 15% of what I'd tested it at to find a movement that seemed sane.
The next step now is to try figuring out how jerk values actually impact physical movent and begin looking at integrating sensors into the design.
I am writing this blog post from a hotel room so I'll update with pictures as soon as I can.