Help with crystal chamber motor

I have the Thrawn Hunter DIY kit, and I’m having a problem with the crystal chamber motor. I have the negative going to LED 6 and the positive going to 3.3 v on proffieboard. Per the instructions on Goth3D site, I used the following: With blade profile as:
BladeConfig blades[] = {
{ 0,
WS281XBladePtr<140, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
WS281XBladePtr<1, blade2Pin, Color8::GRB, PowerPINS >(),
SimpleBladePtr<CH1LED,NoLED, NoLED, NoLED,bladePowerPin6, -1,-1,-1>(),
When I use Proffie OS to verify, it has a problem with the line starting with “SimpleBladePtr”. I just want the motor to turn when the saber turns on. If I put the motor negative to GRD on proffieboard, it spins as soon as the kill key is removed. Thanks.

Do you have NUM_BLADES set to 3?
If that’s not it, please post the complete config file and the complete output from compilation.

PS: I don’t recommend wiring motors to the 3.3v pad, sometimes it causes problems. Using BATT+ is better. (and a resistor if you need it.)

1 Like

Yes, number of blades are 3. I am currently out of town, but i will post the info when I get back. Thanks

If I use the BATT+ pad, will the motor still turn on when the kill key is removed (like the 3.3v) without turning on the blade? Also, what resistor should I use with this motor:
Test data at 3.0V:

  • Current: 45mA
  • Stall current: 200mA
  • Motor speed: 32000RPM
  • Output speed: 46RPM
  • Torque:
  • Stall torque:

Test data at 1.5V:

  • Current:25mA
  • Stall current:100mA
  • Motor speed:17000RPM
  • Output speed: 20RPM
  • Torque:
  • Stall torque:

Using a KeepPower 18650 3000mAh battery.

If the motor can handle 4.2v, then I suggest using no resistor and use the style to reduce the speed. Based on your measurements, it’s easy to pick a resistor which will give the motor ~3.0 volts though:

\frac{batteryVoltage - targetVoltage}{current} = \frac{3.7 V - 3.0 V}{0.045 A} = 15.5555555 \Omega

We can also calculate another data point for the lower test data point:

\frac{3.7 V - 1.5 V}{0.025 A} = 88 \Omega

If we pick from the standard resistor series, maybe a 22 ohm resistor would be good?

1 Like

I’m pretty new to saber building. When you say “use the style to reduce your speed”, is there a configuration for the motor that needs to be included in a particular section (like for the crystal chamber and accents)? If so, how would that be written? Thank you so much for your help!

When you add a motor, it becomes a “blade” in ProffieOS terminology.
Each “blade” has a style associated with it. (One per preset actually.) and the style determines how to control the blade. Normally, blades are lights, so all the terminology is adjusted for that, but it can still be used to control motors.

Basically, if your “blade” is a motor, and you give it a style like StylePtr<White>() then the motor will be at full power. If you give it StylePtr<Black>(), then it will be completely off. If you give it StylePtr<Rgb<128,128,128>>(), then it will have half power.

So the idea here is that you can adjust the resistor to give you a high, but safe speed for the motor. Then you can use the config file to get the speed you actually want, without having to swap out the resistor.

With a little coding it’s even possible to have the proffieboard adjust based on the battery voltage so that you get the same speed regardless of what the battery voltage is.

1 Like

Excellent! I think I understand now. Can’t wait to try this when I return home. Thanks for your help and patience with me!

I’ve installed a few of these now and I followed the Prof’s advice of using the batt+ line (which in my case also saved running an extra wire in) and a resistor. However I’ve found that these motors can be a bit variable, so it’s worth experimenting with an external power supply of a fixed voltage and seeing how fast it spins with different resistors. Typically I’ve used a 47 ohm or a 10 ohm resistor, so it doesn’t have to be super-precise - just enough to stop the motor spinning wildly when the battery is really full at 4.2 volts. Then you can fine tune speed in the config as the Prof suggests.

I was interested in your comment that you can code to maintain the same motor speed regardless of battery voltage. Is that just a blade style or is it a bit deeper than that? If the former, do you have an example, as it would be a very useful feature? :grinning:

***** Edit Update *****
I think I’ve figured it out. Will post an example myself when I get home. :slight_smile:

It would be a LED struct.
I should check the math though. I’m not sure if the speed is an affine function from the voltage the way that LEDs are, or if something more complicated is needed.

Ah, it’s not what I thought then. I thought you might be able to simply use BatteryLevel, with the lower voltage colour set to a faster spin (Rgb<255,255,255>) and the higher voltage one set to a slower spin (Rgb<120,120,120>). Looks like it’s gonna be a bit more involved.

Sabersense, thanks for your advice. I will experiment with your suggestion.

That could work too, but a battery struct would mean that the style wouldn’t have to be adapted to each saber.

I got my saber to work(thanks to you). The only problem I still have is the crystal chamber motor turns as soon as I remove the kill key. I want it to turn when I hit the switch. I currently have the motor positive to the BATT+ as you suggested, and the negative to LED 6.

The blade style that controls it needs a layer that handles ignition and retraction, like InOutTrL

Thanks! I’ll try that.