You may be asking too much from your l6234. That motor is 1000kv so probably has low resistance. I suspect you’ll be way over current limits, hence your heat. Can you measure winding resistance?
I think gimbal motors are recommended for the shield:
And it looks like they wont work with simple FOC shield. But they will work with boards which have DRV8301/DRV8302 driver.
I just watched your video and didnt notice that your shield works only with ~10ohm resistance motors. Can i ask you to add some warning in the description of the video about this? Just like: before ordering this shield, make sure your motors have ~10ohm resistance. Maybe im stupid and i needed to check all documentation before ordering components for this shield. But still, i can see the information about motors only in the description of simpleFOC library, which i honestly read only after i finished soldering all components.
Also maybe somebody can explain me why this L6234 fits only ~10ohm resistance motors. And why can DRV8301 move any of them?
The l6234 is unusual/amazing in that it can handle a fair amount of current 1A (up to peak of 5A if you can keep it cool enough) without external mosfets! Conceptually i think of the l6234 as drv8301 but with an additional 6 mosfets (3 half bridges) hidden inside the silicon. So to get the equivalent you’ll want a drv8301 + 6 external mosfets. Having external mosfets means they can be more easily cooled and rated differently/higher.
If you use a bench power supply (or were super careful without one) you’d probably be able to get your 1ohm motor to spin under no load but it’s torque would be 10% of its potental. I’ve run 1.3ohm motors with the shield.
Lets say i took your motor plugged it up to 12v power supply and set a current limit to 1A and used the simplefoc shield without being careful in software (i.e not setting voltage limit to 0.5 to 1V). If what you ask the motor to do e.g run at 300rpm requires 12v then using I=V/R you’ll be pulling 12/1 i.e 12A! (not sure if calc is quite that simple but it’s close).
How does the limiting bench powersupply help? It would gracefully ‘brown out’. The current would be limited to 1A but the supply voltage would fade to 1 or 2 volts. The l6234d would probably switch off (it needs about 6v to operate) but you wouldn’t have hurt the shield. So now you should go back to your software and put in equivalent software guards (voltage limit of 1 or 2v) and try again.
If you used a dumb power supply or battery, that l6234 would be facing a whole world of pain, 12Ax12v. I.e 144W. Remember how hot a 100w light bulb got? The l6234 has some protection, it might be ok but its a gamble.
I bought a 150W variable bench supply for less than $100 and it is awesome. I’ve got the 6 presets set for 3.3 , 5, 9,12,18, 24V and use it all the time
The documentation that came with the above was terrible. Lots of other 150W variable PSUs out there but i wanted the presets.
I just bought small 2112 gimbal motor with ~20ohm resistance. And this motor act like the previous one. L6234 doesnt heats anymore, but motor still dont turn and makes squeaky noise. When i put power on arduino, motor turns to the left, then to the right, and after this it starts to make squeaky noise. When i put some velosity values, noise changes a bit.
First i thought that my power supply can be a problem. I just use 19V power supply from laptop with DC/DC stepdown LX9006. But nothing changed when i switched it on 18650 battery with 4V.
I tried to change PI, ramp_voltage values in code, but it didnt help.
Maybe this squeaky noise comes from high/low PWM frequency? But i cant find any values in code to change it.
Which magnetic sensor are you using? I2c or spi? How confident are you that the sensor reading is being read properly?
What i like to do is to start with ‘voltage mode’ and set voltage to zero (with motor.move(0) and then call motor.monitor() straight after. It’ll print out “voltage angle velocity” with each loop. Then manually rotate motor 360degees. I’d then expect to see angle (second column) to change to 2*PI. If it doesn’t then go back and look at your sensor setup. If it does then continue in voltage mode changing values in motor.move() from -2v to +2v and see if motor turns in both directions. The advantage of voltage mode is that it doesn’t use PI tuning so is easier to debug hardware/connection issues.
If all that works then it’s a problem with your tuning
I use AS5047D-ATSM magnetic sensor with spi. I checked it in magnetic_sensor_spi_example. My sensor really didnt work in voltage mode, because in sketch there is MagneticSensorSPI sensor = MagneticSensorSPI(10, 16384, 0x3FFF);
And in magnetic_sensor_spi_example its MagneticSensorSPI sensor = MagneticSensorSPI(10, 14, 0x3FFF);
I changed this value and sensor started to work in voltage mode. After rotating motor on 360 degrees, sensor shows ~6.3 points, which is close to 2*PI.
But it didnt help. Motor still doesnt rotate and makes this noise. I’ve noticed only one difference: when i slide my sensor away, motor starts to shake and it looks like it tries to rotate. When i align magnet with sensor back, noise comeback and rotor stay without moving.
And another observation: while initialization, motor turns to the left and right pretty normally. But after FOC algorithm starts to work, motor doesnt turn and makes this noise.
I really start to think that there is some problem with frequency in FOC algorithm.
P.S. all of this i did in voltage sketch(mode) and changed only motor.move() command.
Maybe problem could be in Arduino UNO from China? Like it works different and calculate another frequency or something.
I just had experiments with find_pole_pairs sketch. When i run it, motor should rotate slowly. Instead of this im getting moves from left to the right. It means my board making wrong signal and somewhere i made a mistake while soldering this.
Your motor is working. Might want to change openloop to move in opposite direction by changing: target_angle -= 0.001;
After I would move back to find_pole_pairs. It should be working as the code is similar! We need to work out why its not working, it should at least spin.
Check that you’ve set the right supply motor.voltage_power_supply = 12;
Are you using this version of the code:
Can you describe what you see physically happening to motor and what the output says on the Serial
Thanks for the heads up for the library examples, I was not aware that I didn’t refactor the code well enough. I’ve updated the master branch examples.
If you are getting negative angle in each run, one of your problems can be that the motor and sensor orientation is inversed. That should be solved by inverting two motor wires for example, as @Owen_Williams already suggested.
But you have something else as a problem as well which we did not identify yet.
What is the MCU you are using?
What is the library version you are using?
Which pins are you using?