JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 12:29 am

The home inputs of the PIC32 are to 5v permanently , I don't have limit switches and I send this inputs to HIGH, this could be the problem??

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 12:41 am

JASM123 wrote:The home inputs of the PIC32 are to 5v permanently , I don't have limit switches and I send this inputs to HIGH, this could be the problem??
The limit switches are not enabled on the sample config.
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 1:46 am

Hi kinsa thank you for the responding
this is the result for the commands:
halcmd show picnc.ready
halcmd show picnc.spi_fault
what could be the problem??
Attachments
comandresult.gif
comandresult.gif (15.77 KiB) Viewed 3321 times

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 2:10 am

Right now I have connected the pin 6 (Enable) with the Driver, and I want to move the motor whit the JOG X (+/-) but the pin 6 only sends 3.3 volts to my Driver for this my motor doesn't move, I already don't have the error but the motor doesn't move the step and the direction signal are correct but the pin 6 don't change to Low (0v) to activate my stepper.

thank you for your help

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 3:47 am

JASM123 wrote:Hi kinsa thank you for the responding
this is the result for the commands:
halcmd show picnc.ready
halcmd show picnc.spi_fault
what could be the problem??
Run the commands when linuxcnc ia running.
42

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 3:55 am

JASM123 wrote:Right now I have connected the pin 6 (Enable) with the Driver, and I want to move the motor whit the JOG X (+/-) but the pin 6 only sends 3.3 volts to my Driver for this my motor doesn't move, I already don't have the error but the motor doesn't move the step and the direction signal are correct but the pin 6 don't change to Low (0v) to activate my stepper.

thank you for your help
Sorry I made a mistake here :)

The sample config only drives the step/dir outputs. The extra inputs and outputs are never used.
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 4:14 am

Thank you kinsa for the answer, for this I have to connect the Enable pin of the driver to Ground? and disable the driver for the pin 6 of pic32?
thank you and regards

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 4:38 am

JASM123 wrote:Thank you kinsa for the answer, for this I have to connect the Enable pin of the driver to Ground? and disable the driver for the pin 6 of pic32?
thank you and regards
You can for testing purposes. Connect it later once you've finalized your setup.
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 5:05 am

Kinsa,
I have a question in my setup of the machine when I tried to move the axis X, I adjust the Feed and the velocity to move the motor, in many cases the Linux CNC enters like a infinite cycle in which my motor moves for one side and I cant stop , when this occurs I have to close linuxCNC to stop my motor. This phenomena is normal in the set up of the machine?? or maybe I have to modify the parameter of the INI file to eliminate this error?? When you setup your machine you have this problems?
In the terminal it sent me this error:
joint 0 following error
emc/task/taskintf.cc 617: Error on axis 0, command number 311
any ideas for this?

thank you so much and regards

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 5:12 am

JASM123 wrote:Kinsa,
I have a question in my setup of the machine when I tried to move the axis X, I adjust the Feed and the velocity to move the motor, in many cases the Linux CNC enters like a infinite cycle in which my motor moves for one side and I cant stop , when this occurs I have to close linuxCNC to stop my motor. This phenomena is normal in the set up of the machine?? or maybe I have to modify the parameter of the INI file to eliminate this error?? When you setup your machine you have this problems?
In the terminal it sent me this error:
joint 0 following error
emc/task/taskintf.cc 617: Error on axis 0, command number 311
any ideas for this?

thank you so much and regards

What is the status of spi_fault when that happens?

I never get that unless the communication between rpi and picnc is disrupted.
42

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 12:54 pm

JASM123 wrote:Kinsa,
I have a question in my setup of the machine when I tried to move the axis X, I adjust the Feed and the velocity to move the motor, in many cases the Linux CNC enters like a infinite cycle in which my motor moves for one side and I cant stop , when this occurs I have to close linuxCNC to stop my motor. This phenomena is normal in the set up of the machine?? or maybe I have to modify the parameter of the INI file to eliminate this error?? When you setup your machine you have this problems?
In the terminal it sent me this error:
joint 0 following error
emc/task/taskintf.cc 617: Error on axis 0, command number 311
any ideas for this?

thank you so much and regards
Note that there is a lag between pressing the keyboard//screen buttons on the mini display. This is specially true if the continuous motion is selected instead of incremental jogging.

You can also use G-Code command (G0) using the MDI page.
42

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 2:41 pm

Does the error happen if the motors are not connected? If it doesn't then most likely the problem is due to electrical noise.

To easily catch SPI communication errors, replace the following lines on your HAL file:

Code: Select all

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in
with these:

Code: Select all

# estop
loadrt estop_latch
loadrt not

addf estop-latch.0 servo-thread
addf not.0 servo-thread

net estop-loopout iocontrol.0.emc-enable-in <= estop-latch.0.ok-out
net estop-loopin iocontrol.0.user-enable-out => estop-latch.0.ok-in
net estop-reset iocontrol.0.user-request-enable => estop-latch.0.reset
net inv_fault not.0.in <= picnc.ready
net remote-estop estop-latch.0.fault-in <= not.0.out
This will assert e-stop whenever there's a problem with the SPI communication.
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 6:17 pm

Hi kinsa
I implement the modification in the HAL file but the error persist, after I move the stepper motor, during many time (increment or continuous mode) the pic32 enters in an infinite cycle and my motor turns without stopping. I seem that is a motor noise, how can eliminate this noise for my circuit??

thank you and regards

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sat Nov 15, 2014 11:26 pm

Hi kinsa I solve the problem, I modified the INI file for axis 0 I change the FERROR, that previously has a number 1, I change to 4 but the problem didn't solve for this I change this number to 40, I the error solved, but I have a question I read that the FERROR is the distance allowed by rapid moves, for this I don't understand this number would you please explain me how works this variable??.

Thank you and regards

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 11:37 pm

Can you post a pic of your setup?

It's strange that your motor still runs after you shutdown linuxcnc. The firmware has a code that shutdown the stepgen if it doesn't receive a valid data from rpi.
42

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Nov 15, 2014 11:38 pm

JASM123 wrote:Hi kinsa I solve the problem, I modified the INI file for axis 0 I change the FERROR, that previously has a number 1, I change to 4 but the problem didn't solve for this I change this number to 40, I the error solved, but I have a question I read that the FERROR is the distance allowed by rapid moves, for this I don't understand this number would you please explain me how works this variable??.

Thank you and regards
http://wiki.linuxcnc.org/cgi-bin/wiki.p ... wing_Error
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sun Nov 16, 2014 4:32 am

kinsa wrote:Can you post a pic of your setup?

It's strange that your motor still runs after you shutdown linuxcnc. The firmware has a code that shutdown the stepgen if it doesn't receive a valid data from rpi.
Hi kinsa, the stepper motor stops after I shutdown linuxcnc. I successful move the X axis without problem, but if whe want to run other stepper motor with the same driver it gives me the same error, the interesting for this is that when I tried to run an axis with a high friction (mechanically hard to move), it produces a lot of electrical noise that affect my circuit. I put all coupling capacitors but the problem persist, for the test of my stepper motor I used a voltage source of 7.5 volts for this I don't obtain the correct current for my stepper motor, could be this the problem??

thank you and regards

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sun Nov 16, 2014 9:03 am

It could be the power supply. Try separating the stepper supply from rpi and picnc. Also observe proper grounding and keep the spi signal cables short.

Do you happen to use a breadboard?
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sun Nov 16, 2014 6:56 pm

I will try your suggestions, for the PIC32 I used a soldered PCB, but for the driver for testing conditions I using a protoboard to testing the motor and the driver. I joined the ground and I don't know if I can to separate the voltage of the motor and the logic because, the pololu driver (A4988) has internally joined the ground of logic and the ground of the motor supply how can separate this parts??

thank you so much

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Sun Nov 16, 2014 8:56 pm

The optocouplers connected between the Dir and step signal whit the Drivers will solve the problem???

thankyou and regards

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sun Nov 16, 2014 11:30 pm

JASM123 wrote:Hi kinsa
I implement the modification in the HAL file but the error persist, after I move the stepper motor, during many time (increment or continuous mode) the pic32 enters in an infinite cycle and my motor turns without stopping. I seem that is a motor noise, how can eliminate this noise for my circuit??

thank you and regards
I'm confused with this one.

PICnc will never go into continuous loop on its own as there are checks in the firmware to halt what it's doing if the SPI communication gets disrupted. Are you sure linuxcnc has not commanded the motors to move a certain distance that takes a while to reach? Monitor the commanded and feedback positions. The halscope program is useful in this instance.
Hi kinsa, the stepper motor stops after I shutdown linuxcnc. I successful move the X axis without problem, but if whe want to run other stepper motor with the same driver it gives me the same error, the interesting for this is that when I tried to run an axis with a high friction (mechanically hard to move), it produces a lot of electrical noise that affect my circuit. I put all coupling capacitors but the problem persist, for the test of my stepper motor I used a voltage source of 7.5 volts for this I don't obtain the correct current for my stepper motor, could be this the problem??
Steppers are open loop, there's no feedback on whether the load is light or heavy.

Noise should latch the spi_fault pin. The other possible reason is that the pic32 goes into reset, but it is unlikely as the hal driver will catch the disruption on the SPI communication...
The optocouplers connected between the Dir and step signal whit the Drivers will solve the problem???
Maybe, only if the problem happens when the motors are attached to the drivers.
42

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Mon Nov 17, 2014 7:58 pm

HI kinsa
I solved the problem!!!!, I bought a 4N25 optocouplers and it solved I move the motor without errors,I tried to buy the 6N135 which is a fast optocoupler but I didn't find , now I have a question related with the stepper and the driver, I put the driver in microsteping mode (1/16) to obtain the precision of the interface, for example if I move 5 mm in the interface the axis moves 5mm, but in the microsteping mode I lost force (Ncm) of the motor, for this I want to change to full step mode (to obtain plus force) but I don't know What I have to change in the INI or in the HAL file to calibrate this.
which variable I have to change in the ini file or hal fiel to obtain this.

thank you so much and regards

Wire
Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Mon Nov 17, 2014 8:27 pm

would avoid full stepping and go with half for smoothest operation.

As for the hal updates if you were at 1/16 and move to 1/2 stepping take your steps per inch/mm number and divide by 8 since it takes less steps to go the same distance. Math:

([old steps per inch/mm]*[old micro step setting])/[new micro step setting] = [new steps per inch/mm]

example going from 1/16 to 1/2 stepping with 1280 steps per mm with the old setting

(1280 * 0.0625)/0.5 = 160

Wire
Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Mon Nov 17, 2014 8:33 pm

I think the line you want to edit is "SCALE = 1200.0" under each of the [AXIS_x] statements in the .ini file. Have not played with that part yet so may be off.

JASM123
Posts: 54
Joined: Fri Sep 19, 2014 3:25 am

Re: LinuxCNC

Mon Nov 17, 2014 8:39 pm

Hi kinsa thank you for responding,
Ok I see, but this new configuration in which variable of the INI or in the HAL file have to change,in the INI file there are variables such as Base period, Servo period, in which variable I have to change to obtain this new resolution (1/2)??

Return to “Automation, sensing and robotics”